home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name UTCRIT -- Obtain address of DOS critical section flag.
- *
- * Synopsis utcrit();
- *
- * Description This function loads the global variable b_critad
- * with the address of the DOS critical section flag for
- * use by UTDOSRDY and other functions.
- *
- * The DOS critical section flag is a one-byte value
- * indicating whether any DOS functions are in progress and
- * therefore whether DOS services are available to an
- * interrupting process. The byte has a zero value when
- * DOS services are available.
- *
- * UTCRIT itself invokes DOS, so do NOT use it inside a
- * hardware ISR.
- *
- * Returns Nothing.
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1987,1989
- *
- **/
-
-
- #include <dos.h>
- #include <butil.h>
-
- unsigned char far *b_critad = FARNIL;
-
-
- unsigned char far *utcrit()
- {
- union REGS regs;
- struct SREGS sregs;
-
- regs.x.ax = 0x3400; /* DOS function number. */
-
- int86x (UTDOSINT, ®s, ®s, &sregs);
-
- b_critad = uttofar (sregs.es, regs.x.bx, unsigned char);
-
- return (b_critad);
- }