//+------------------------------------------------------------------------- // // Microsoft Windows // // Copyright (C) Microsoft Corporation, 1998 - 1999 // // File: util.h // //-------------------------------------------------------------------------- #ifndef _UTIL_ #define _UTIL_ #define GetStatus(RegisterBase) \ (P5ReadPortUchar((RegisterBase)+DSR_OFFSET)) #define GetControl(RegisterBase) \ (P5ReadPortUchar((RegisterBase)+DCR_OFFSET)) #define StoreControl(RegisterBase,ControlByte) \ { \ P5WritePortUchar((RegisterBase)+DCR_OFFSET, \ (UCHAR)ControlByte ); \ } // The following macros may be used to test the contents of the Device // Status Regisger (DSR). These macros account for the hardware // inversion of the nBusy (aka PtrBusy, PeriphAck) signal. ////////////////////////////////////////////////////////////////////////////// #if (1 == DVRH_USE_FAST_MACROS) #define DSR_TEST_MASK(b7,b6,b5,b4,b3) \ ((UCHAR)(b7==DONT_CARE? 0: BIT_7_SET) | \ (b6==DONT_CARE? 0: BIT_6_SET) | \ (b5==DONT_CARE? 0: BIT_5_SET) | \ (b4==DONT_CARE? 0: BIT_4_SET) | \ (b3==DONT_CARE? 0: BIT_3_SET) ) #else #define DSR_TEST_MASK(b7,b6,b5,b4,b3) \ ((UCHAR)((b7==DONT_CARE?0:1)<bCriticalSection = TRUE #define ParExitCriticalSection(Xtension) xTension->bCriticalSection = FALSE // The following macros may be used to test the contents of the Device // Status Regisger (DSR). These macros account for the hardware // inversion of the nBusy (aka PtrBusy, PeriphAck) signal. ////////////////////////////////////////////////////////////////////////////// #if (1 == DVRH_USE_FAST_MACROS) #define DSR_TEST_MASK(b7,b6,b5,b4,b3) \ ((UCHAR)(b7==DONT_CARE? 0: BIT_7_SET) | \ (b6==DONT_CARE? 0: BIT_6_SET) | \ (b5==DONT_CARE? 0: BIT_5_SET) | \ (b4==DONT_CARE? 0: BIT_4_SET) | \ (b3==DONT_CARE? 0: BIT_3_SET) ) #else #define DSR_TEST_MASK(b7,b6,b5,b4,b3) \ ((UCHAR)((b7==DONT_CARE?0:1)<