- Timestamp:
- Mar 27, 2013, 5:56:17 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/include/devhelp.h
r146 r149 1 /* DEVHELP.H - DevHelp header file for Watcom-based device drivers 1 /* 2 * devhelp.h OS/2 device help calls for DD 16-bit development. 2 3 * 3 * Markus Thielen 09/2010: 4 * some modifications for OpenWatcom/os2ahci.add 4 * Open Watcom Project 5 5 * 6 * TODO: the Watcom build is broken - the resulting ADD does not work.6 * Copyright (c) 2004-2007 The Open Watcom Contributors. All Rights Reserved. 7 7 * 8 */ 8 * This file was copied from the updated DDK. 9 * 10 * ========================================================================= 11 */ 9 12 10 13 #ifndef DEVHELP_INCLUDED … … 26 29 27 30 typedef struct _PAGELIST { 28 ULONG PhysAddr;29 ULONG Size;31 ULONG PhysAddr; 32 ULONG Size; 30 33 } PAGELIST, __near *NPPAGELIST, __far *PPAGELIST; 31 34 35 typedef ULONG HSpinLock; 36 37 // Device_Help: dev help offset from INIT 32 38 extern PFN Device_Help; 33 39 40 // 11 Jun 07 SHL change from far ptr to dword ptr 41 // MKG - Due to Lars Erdmann comment: 42 // Explanation: "CALL DWORD PTR" calls a far routine indirectly through the 43 // function pointer saved in the address passed to the call (which is 44 // correct since the devhelps use a function pointer) while "CALL FAR PTR" 45 // calls a far routine directly, that is, the address passed to the call is 46 // the far routine address (which is wrong for the devhelp calls). 47 34 48 #define DEVHELP_CALL \ 35 49 "call dword ptr [Device_Help]" \ … … 39 53 value [ax] 40 54 55 /* This service starts an ABIOS function for the Operating System Transfer 56 * Convention. 57 */ 41 58 USHORT DevHelp_ABIOSCall(USHORT Lid, NPBYTE ReqBlk, USHORT Entry_Type); 42 59 #pragma aux DevHelp_ABIOSCall = \ … … 46 63 modify exact [ax dl]; 47 64 65 /* This service starts an ABIOS common entry point according to the Advanced 66 * BIOS Transfer Convention. 67 */ 48 68 USHORT DevHelp_ABIOSCommonEntry(NPBYTE ReqBlk, USHORT Entry_Type); 49 69 #pragma aux DevHelp_ABIOSCommonEntry = \ … … 52 72 parm caller [si] [dh] \ 53 73 modify exact [ax dl]; 74 75 USHORT DevHelp_AcquireSpinLock(HSpinLock spl); 76 #pragma aux DevHelp_AcquireSpinLock = \ 77 "mov ax,dx" \ 78 "mov dl,71h" \ 79 DEVHELP_CALL \ 80 parm caller nomemory [dx bx] \ 81 modify nomemory exact [ax bx cx dx si di]; 54 82 55 83 USHORT DevHelp_AllocateCtxHook(NPFN HookHandler, PULONG HookHandle); … … 157 185 modify nomemory exact [ax dl]; 158 186 187 USHORT DevHelp_CreateSpinLock(HSpinLock FAR * pSpl); 188 #pragma aux DevHelp_CreateSpinLock = \ 189 "mov ax,dx" \ 190 "mov dl,79h" \ 191 DEVHELP_CALL \ 192 parm caller [dx bx] \ 193 modify exact [ax bx cx dx si di]; 194 159 195 USHORT DevHelp_DeRegister(USHORT MonitorPID, USHORT MonitorHandle, PUSHORT MonitorsLeft); 160 196 #pragma aux DevHelp_DeRegister = \ … … 226 262 parm caller nomemory [ax] \ 227 263 modify nomemory exact [ax dl]; 264 265 USHORT DevHelp_FreeSpinLock(HSpinLock spl); 266 #pragma aux DevHelp_FreeSpinLock = \ 267 "mov ax,dx" \ 268 "mov dl,7ah" \ 269 DEVHELP_CALL \ 270 parm caller nomemory [dx bx] \ 271 modify nomemory exact [ax bx cx dx si di]; 228 272 229 273 USHORT DevHelp_FreePhys(ULONG PhysAddr); … … 295 339 #define DHGETDOSV_YIELDFLAG 7 /*@V76282*/ 296 340 #define DHGETDOSV_TCYIELDFLAG 8 /*@V76282*/ 341 #define DHGETDOSV_DOSTABLES 9 // Undocumented by IBM, gets the dostables. 297 342 #define DHGETDOSV_DOSCODEPAGE 11 /*@V76282*/ 298 343 #define DHGETDOSV_INTERRUPTLEV 13 … … 331 376 "pop es" \ 332 377 "mov dl,2Bh" \ 333 "jmp farptr es:[Device_Help]" \378 "jmp dword ptr es:[Device_Help]" \ 334 379 parm [es si] [di] \ 335 380 modify nomemory exact []; … … 532 577 #define WAIT_IS_NOT_INTERRUPTABLE 1 533 578 534 #define WAIT_INTERRUPTED 0x 8003535 #define WAIT_TIMED_OUT 0x 8001579 #define WAIT_INTERRUPTED 0x2 580 #define WAIT_TIMED_OUT 0x1 536 581 537 582 USHORT DevHelp_ProcBlock(ULONG EventId, ULONG WaitTime, USHORT IntWaitFlag); … … 541 586 "xchg cx,di" \ 542 587 "call dword ptr [Device_Help]" \ 543 "jc error" \ 544 "mov ax,0" /* doesn't affect zero flag like sub ax,ax does */ \ 545 "error:" \ 588 "setnz al" \ 589 "setc bl" \ 590 "inc al" \ 591 "neg bl" \ 592 "and al,bl" \ 593 "xor ah,ah" \ 546 594 value [ax] \ 547 595 parm caller nomemory [ax bx] [di cx] [dh] \ … … 733 781 modify exact [ax bx cx di dl es]; 734 782 735 USHORT DevHlp_ResetEventSem(ULONG hEvent, PULONG pNumPosts); 783 USHORT DevHelp_ReleaseSpinLock(HSpinLock spl); 784 #pragma aux DevHelp_ReleaseSpinLock = \ 785 "mov ax,dx" \ 786 "mov dl,72h" \ 787 DEVHELP_CALL \ 788 parm caller nomemory [dx bx] \ 789 modify nomemory exact [ax bx cx dx si di]; 790 791 USHORT DevHelp_ResetEventSem(ULONG hEvent, LIN pNumPosts); 736 792 #pragma aux DevHelp_ResetEventSem = \ 737 793 "mov eax,[esp]" \ … … 919 975 USHORT DevHelp_VirtToPhys(PVOID SelOffset, PULONG PhysAddr); 920 976 #pragma aux DevHelp_VirtToPhys = \ 921 ";int 3" \922 977 "push ds" \ 923 978 "mov dl,16h" \ … … 1025 1080 1026 1081 USHORT DevHelp_VMProcessToGlobal(ULONG Flags, LIN LinearAddr, ULONG Length, PLIN GlobalLinearAddr); 1027 #pragma aux DevHelp_ ProcessToGlobal = \1082 #pragma aux DevHelp_VMProcessToGlobal = \ 1028 1083 "mov dl,59h" \ 1029 1084 "mov eax,[esp]" \ … … 1086 1141 #endif 1087 1142 1088 #endif 1089 #endif 1143 #endif // end __WATCOMC__ 1144 #endif // end DEVHELP_INCLUDED 1145
Note:
See TracChangeset
for help on using the changeset viewer.