1 | /* DEVHELP.H - DevHelp header file for Watcom-based device drivers
|
---|
2 | *
|
---|
3 | * Markus Thielen 09/2010:
|
---|
4 | * some modifications for OpenWatcom/os2ahci.add
|
---|
5 | *
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef DEVHELP_INCLUDED
|
---|
9 | #define DEVHELP_INCLUDED
|
---|
10 |
|
---|
11 | #ifdef __WATCOMC__
|
---|
12 |
|
---|
13 | #ifndef OS2_INCLUDED
|
---|
14 | #define INCL_NOPMAPI
|
---|
15 | #include <os2.h>
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | #ifdef __cplusplus
|
---|
19 | extern "C" {
|
---|
20 | #endif
|
---|
21 |
|
---|
22 | typedef ULONG LIN; // 32-Bit Linear Addess
|
---|
23 | typedef ULONG __far *PLIN; // 16:16 Ptr to a 32-Bit Linear Addess
|
---|
24 |
|
---|
25 | typedef struct _PAGELIST {
|
---|
26 | ULONG PhysAddr;
|
---|
27 | ULONG Size;
|
---|
28 | } PAGELIST, __near *NPPAGELIST, __far *PPAGELIST;
|
---|
29 |
|
---|
30 | extern PFN Device_Help;
|
---|
31 |
|
---|
32 | #define DEVHELP_CALL \
|
---|
33 | "call dword ptr [Device_Help]" \
|
---|
34 | "jc error" \
|
---|
35 | "sub ax,ax" \
|
---|
36 | "error:" \
|
---|
37 | value [ax]
|
---|
38 |
|
---|
39 | USHORT DevHelp_ABIOSCall(USHORT Lid, NPBYTE ReqBlk, USHORT Entry_Type);
|
---|
40 | #pragma aux DevHelp_ABIOSCall = \
|
---|
41 | "mov dl,36h" \
|
---|
42 | DEVHELP_CALL \
|
---|
43 | parm caller [ax] [si] [dh] \
|
---|
44 | modify exact [ax dl];
|
---|
45 |
|
---|
46 | USHORT DevHelp_ABIOSCommonEntry(NPBYTE ReqBlk, USHORT Entry_Type);
|
---|
47 | #pragma aux DevHelp_ABIOSCommonEntry = \
|
---|
48 | "mov dl,37h" \
|
---|
49 | DEVHELP_CALL \
|
---|
50 | parm caller [si] [dh] \
|
---|
51 | modify exact [ax dl];
|
---|
52 |
|
---|
53 | USHORT DevHelp_AllocateCtxHook(NPFN HookHandler, PULONG HookHandle);
|
---|
54 | #pragma aux DevHelp_AllocateCtxHook = \
|
---|
55 | "push bx" \
|
---|
56 | "movzx eax,ax" \
|
---|
57 | "mov ebx,-1" \
|
---|
58 | "mov dl,63h" \
|
---|
59 | "call dword ptr [Device_Help]" \
|
---|
60 | "pop bx" \
|
---|
61 | "jc error" \
|
---|
62 | "mov es:[bx],eax" \
|
---|
63 | "sub ax,ax" \
|
---|
64 | "error:" \
|
---|
65 | value [ax] \
|
---|
66 | parm caller nomemory [ax] [es bx] \
|
---|
67 | modify exact [ax bx dl es];
|
---|
68 |
|
---|
69 | USHORT DevHelp_AllocGDTSelector(PSEL Selectors, USHORT Count);
|
---|
70 | #pragma aux DevHelp_AllocGDTSelector = \
|
---|
71 | "mov dl,2Dh" \
|
---|
72 | DEVHELP_CALL \
|
---|
73 | parm caller [es di] [cx] \
|
---|
74 | modify nomemory exact [ax dl];
|
---|
75 |
|
---|
76 | #define MEMTYPE_ABOVE_1M 0
|
---|
77 | #define MEMTYPE_BELOW_1M 1
|
---|
78 |
|
---|
79 | USHORT DevHelp_AllocPhys(ULONG lSize, USHORT MemType, PULONG PhysAddr);
|
---|
80 | #pragma aux DevHelp_AllocPhys = \
|
---|
81 | "xchg ax,bx" \
|
---|
82 | "mov dl,18h" \
|
---|
83 | "call dword ptr [Device_Help]" \
|
---|
84 | "jc error" \
|
---|
85 | "mov es:[di],bx" \
|
---|
86 | "mov es:[di+2],ax" \
|
---|
87 | "sub ax,ax" \
|
---|
88 | "error:" \
|
---|
89 | value [ax] \
|
---|
90 | parm caller nomemory [ax bx] [dh] [es di] \
|
---|
91 | modify exact [ax bx dx];
|
---|
92 |
|
---|
93 | #define WAIT_NOT_ALLOWED 0
|
---|
94 | #define WAIT_IS_ALLOWED 1
|
---|
95 |
|
---|
96 | USHORT DevHelp_AllocReqPacket(USHORT WaitFlag, PBYTE __far *ReqPktAddr);
|
---|
97 | #pragma aux DevHelp_AllocReqPacket = \
|
---|
98 | "mov dl,0Dh", \
|
---|
99 | "call dword ptr [Device_Help]" \
|
---|
100 | "jc error" \
|
---|
101 | "push es" \
|
---|
102 | "push bx" \
|
---|
103 | "mov bx,sp" \
|
---|
104 | "les bx,ss:[bx]" \
|
---|
105 | "pop es:[bx]" \
|
---|
106 | "pop es:[bx+2]" \
|
---|
107 | "error:" \
|
---|
108 | "mov ax,0" \
|
---|
109 | "sbb ax,0" \
|
---|
110 | value [ax] \
|
---|
111 | parm caller [dh] [] \
|
---|
112 | modify exact [ax bx dl es];
|
---|
113 |
|
---|
114 | USHORT DevHelp_ArmCtxHook(ULONG HookData, ULONG HookHandle);
|
---|
115 | #pragma aux DevHelp_ArmCtxHook = \
|
---|
116 | "mov bx,sp" \
|
---|
117 | "mov dl,65h", \
|
---|
118 | "mov eax,ss:[bx]" \
|
---|
119 | "mov ecx,-1" \
|
---|
120 | "mov ebx,ss:[bx+4]" \
|
---|
121 | DEVHELP_CALL \
|
---|
122 | parm caller nomemory [] \
|
---|
123 | modify nomemory exact [ax bx cx dl];
|
---|
124 |
|
---|
125 | typedef struct _IDCTABLE {
|
---|
126 | USHORT Reserved[3];
|
---|
127 | VOID (__far *ProtIDCEntry) (VOID);
|
---|
128 | USHORT ProtIDC_DS;
|
---|
129 | } IDCTABLE, __near *NPIDCTABLE;
|
---|
130 |
|
---|
131 | USHORT DevHelp_AttachDD(NPSZ DDName, NPBYTE DDTable);
|
---|
132 | #pragma aux DevHelp_AttachDD = \
|
---|
133 | "mov dl,2Ah" \
|
---|
134 | "call dword ptr [Device_Help]" \
|
---|
135 | "mov ax,0" \
|
---|
136 | "sbb ax,0" \
|
---|
137 | value [ax] \
|
---|
138 | parm caller [bx] [di] \
|
---|
139 | modify exact [ax dl];
|
---|
140 |
|
---|
141 | USHORT DevHelp_Beep(USHORT Frequency, USHORT DurationMS);
|
---|
142 | #pragma aux DevHelp_Beep = \
|
---|
143 | "mov dl,52h" \
|
---|
144 | DEVHELP_CALL \
|
---|
145 | parm caller nomemory [bx] [cx] \
|
---|
146 | modify nomemory exact [ax dx];
|
---|
147 |
|
---|
148 | USHORT DevHelp_CloseEventSem(ULONG hEvent);
|
---|
149 | #pragma aux DevHelp_CloseEventSem = \
|
---|
150 | "movzx esp,sp" \
|
---|
151 | "mov dl,68h" \
|
---|
152 | "mov eax,[esp]" \
|
---|
153 | DEVHELP_CALL \
|
---|
154 | parm caller nomemory [] \
|
---|
155 | modify nomemory exact [ax dl];
|
---|
156 |
|
---|
157 | USHORT DevHelp_DeRegister(USHORT MonitorPID, USHORT MonitorHandle, PUSHORT MonitorsLeft);
|
---|
158 | #pragma aux DevHelp_DeRegister = \
|
---|
159 | "mov dl,21h" \
|
---|
160 | "call dword ptr [Device_Help]" \
|
---|
161 | "jc error" \
|
---|
162 | "mov es:[di],ax" \
|
---|
163 | "sub ax,ax" \
|
---|
164 | "error:" \
|
---|
165 | value [ax] \
|
---|
166 | parm caller nomemory [bx] [ax] [es di] \
|
---|
167 | modify exact [ax dl];
|
---|
168 |
|
---|
169 | USHORT DevHelp_DevDone(PBYTE ReqPktAddr);
|
---|
170 | #pragma aux DevHelp_DevDone = \
|
---|
171 | "mov dl,1" \
|
---|
172 | DEVHELP_CALL \
|
---|
173 | parm caller [es bx] \
|
---|
174 | modify exact [ax dl];
|
---|
175 |
|
---|
176 | #define DYNAPI_CALLGATE16 0x0001 /* 16:16 CallGate */
|
---|
177 | #define DYNAPI_CALLGATE32 0x0000 /* 0:32 CallGate */
|
---|
178 |
|
---|
179 | #define DYNAPI_ROUTINE16 0x0002 /* 16:16 Routine Addr */
|
---|
180 | #define DYNAPI_ROUTINE32 0x0000 /* 0:32 Routine Addr */
|
---|
181 |
|
---|
182 | USHORT DevHelp_DynamicAPI(PVOID RoutineAddress, USHORT ParmCount, USHORT Flags, PSEL CallGateSel);
|
---|
183 | #pragma aux DevHelp_DynamicAPI = \
|
---|
184 | "mov dl,6Ch" \
|
---|
185 | "xchg ax,bx" \
|
---|
186 | "call dword ptr [Device_Help]" \
|
---|
187 | "jc error" \
|
---|
188 | "mov es:[si],di" \
|
---|
189 | "sub ax,ax" \
|
---|
190 | "error:" \
|
---|
191 | value [ax] \
|
---|
192 | parm caller [ax bx] [cx] [dh] [es si] \
|
---|
193 | modify exact [ax bx di dl];
|
---|
194 |
|
---|
195 | USHORT DevHelp_EOI(USHORT IRQLevel);
|
---|
196 | #pragma aux DevHelp_EOI = \
|
---|
197 | "mov dl,31h" \
|
---|
198 | "call dword ptr [Device_Help]" \
|
---|
199 | "sub ax,ax" \
|
---|
200 | value [ax] \
|
---|
201 | parm caller nomemory [al] \
|
---|
202 | modify nomemory exact [ax dl];
|
---|
203 |
|
---|
204 | USHORT DevHelp_FreeCtxHook(ULONG HookHandle);
|
---|
205 | #pragma aux DevHelp_FreeCtxHook = \
|
---|
206 | "movzx esp,sp" \
|
---|
207 | "mov dl,64h", \
|
---|
208 | "mov eax,[esp]" \
|
---|
209 | DEVHELP_CALL \
|
---|
210 | parm caller nomemory [] \
|
---|
211 | modify nomemory exact [ax dl];
|
---|
212 |
|
---|
213 | USHORT DevHelp_FreeGDTSelector(SEL Selector);
|
---|
214 | #pragma aux DevHelp_FreeGDTSelector = \
|
---|
215 | "mov dl,53h" \
|
---|
216 | DEVHELP_CALL \
|
---|
217 | parm caller nomemory [ax] \
|
---|
218 | modify nomemory exact [ax dl];
|
---|
219 |
|
---|
220 | USHORT DevHelp_FreeLIDEntry(USHORT LIDNumber);
|
---|
221 | #pragma aux DevHelp_FreeLIDEntry = \
|
---|
222 | "mov dl,35h" \
|
---|
223 | DEVHELP_CALL \
|
---|
224 | parm caller nomemory [ax] \
|
---|
225 | modify nomemory exact [ax dl];
|
---|
226 |
|
---|
227 | USHORT DevHelp_FreePhys(ULONG PhysAddr);
|
---|
228 | #pragma aux DevHelp_FreePhys = \
|
---|
229 | "xchg ax,bx" \
|
---|
230 | "mov dl,19h" \
|
---|
231 | "call dword ptr [Device_Help]" \
|
---|
232 | "mov ax,0" \
|
---|
233 | "sbb ax,0" \
|
---|
234 | value [ax] \
|
---|
235 | parm caller nomemory [ax bx] \
|
---|
236 | modify exact [ax bx dl];
|
---|
237 |
|
---|
238 | USHORT DevHelp_FreeReqPacket(PBYTE ReqPktAddr);
|
---|
239 | #pragma aux DevHelp_FreeReqPacket = \
|
---|
240 | "mov dl,0Eh", \
|
---|
241 | "call dword ptr [Device_Help]" \
|
---|
242 | "sub ax,ax" \
|
---|
243 | value [ax] \
|
---|
244 | parm caller [es bx] \
|
---|
245 | modify exact [ax dl];
|
---|
246 |
|
---|
247 | typedef struct _SELDESCINFO {
|
---|
248 | UCHAR Type;
|
---|
249 | UCHAR Granularity;
|
---|
250 | LIN BaseAddr;
|
---|
251 | ULONG Limit;
|
---|
252 | } SELDESCINFO, __far *PSELDESCINFO;
|
---|
253 |
|
---|
254 | typedef struct _GATEDESCINFO {
|
---|
255 | UCHAR Type;
|
---|
256 | UCHAR ParmCount;
|
---|
257 | SEL Selector;
|
---|
258 | USHORT Reserved_1;
|
---|
259 | ULONG Offset;
|
---|
260 | } GATEDESCINFO, __far *PGATEDESCINFO;
|
---|
261 |
|
---|
262 | USHORT DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo);
|
---|
263 | #pragma aux DevHelp_GetDescInfo = \
|
---|
264 | "mov dl,5Dh" \
|
---|
265 | "call dword ptr [Device_Help]" \
|
---|
266 | "jc error" \
|
---|
267 | "mov es:[bx],ax" \
|
---|
268 | "mov es:[bx+2],ecx" \
|
---|
269 | "mov es:[bx+6],edx" \
|
---|
270 | "sub ax,ax" \
|
---|
271 | "error:" \
|
---|
272 | value [ax] \
|
---|
273 | parm caller nomemory [ax] [es bx] \
|
---|
274 | modify exact [ax cx dx];
|
---|
275 |
|
---|
276 | USHORT DevHelp_GetDeviceBlock(USHORT Lid, PPVOID DeviceBlockPtr);
|
---|
277 | #pragma aux DevHelp_GetDeviceBlock = \
|
---|
278 | "mov dl,38h" \
|
---|
279 | "call dword ptr [Device_Help]" \
|
---|
280 | "jc error" \
|
---|
281 | "mov es:[si],dx" \
|
---|
282 | "mov es:[si+2],cx" \
|
---|
283 | "sub ax,ax" \
|
---|
284 | "error:" \
|
---|
285 | value [ax] \
|
---|
286 | parm caller nomemory [ax] [es si] \
|
---|
287 | modify exact [ax bx cx dx];
|
---|
288 |
|
---|
289 | #define DHGETDOSV_SYSINFOSEG 1
|
---|
290 | #define DHGETDOSV_LOCINFOSEG 2
|
---|
291 | #define DHGETDOSV_VECTORSDF 4
|
---|
292 | #define DHGETDOSV_VECTORREBOOT 5
|
---|
293 | #define DHGETDOSV_YIELDFLAG 7 /*@V76282*/
|
---|
294 | #define DHGETDOSV_TCYIELDFLAG 8 /*@V76282*/
|
---|
295 | #define DHGETDOSV_DOSCODEPAGE 11 /*@V76282*/
|
---|
296 | #define DHGETDOSV_INTERRUPTLEV 13
|
---|
297 | #define DHGETDOSV_DEVICECLASSTABLE 14 /*@V76282*/
|
---|
298 | #define DHGETDOSV_DMQSSELECTOR 15 /*@V76282*/
|
---|
299 | #define DHGETDOSV_APMINFO 16 /*@V76282*/
|
---|
300 |
|
---|
301 | USHORT DevHelp_GetDOSVar(USHORT VarNumber, USHORT VarMember, PPVOID KernalVar);
|
---|
302 | #pragma aux DevHelp_GetDOSVar = \
|
---|
303 | "mov dl,24h" \
|
---|
304 | "call dword ptr [Device_Help]" \
|
---|
305 | "mov es:[di],bx" \
|
---|
306 | "mov es:[di+2],ax" \
|
---|
307 | "sub ax,ax" \
|
---|
308 | value [ax] \
|
---|
309 | parm caller nomemory [al] [cx] [es di] \
|
---|
310 | modify exact [ax bx dl];
|
---|
311 |
|
---|
312 | USHORT DevHelp_GetLIDEntry(USHORT DeviceType, SHORT LIDIndex, USHORT Type, PUSHORT LID);
|
---|
313 | #pragma aux DevHelp_GetLIDEntry = \
|
---|
314 | "mov dl,34h" \
|
---|
315 | "call dword ptr [Device_Help]" \
|
---|
316 | "jc error" \
|
---|
317 | "mov es:[di],ax" \
|
---|
318 | "sub ax,ax" \
|
---|
319 | "error:" \
|
---|
320 | value [ax] \
|
---|
321 | parm caller nomemory [al] [bl] [dh] [es di] \
|
---|
322 | modify exact [ax dl];
|
---|
323 |
|
---|
324 | USHORT DevHelp_InternalError(PSZ MsgText, USHORT MsgLength );
|
---|
325 | #pragma aux DevHelp_InternalError aborts = \
|
---|
326 | "push ds" \
|
---|
327 | "push es" \
|
---|
328 | "pop ds" \
|
---|
329 | "pop es" \
|
---|
330 | "mov dl,2Bh" \
|
---|
331 | "jmp far ptr es:[Device_Help]" \
|
---|
332 | parm [es si] [di] \
|
---|
333 | modify nomemory exact [];
|
---|
334 |
|
---|
335 | USHORT DevHelp_LinToGDTSelector(SEL Selector, LIN LinearAddr, ULONG Size);
|
---|
336 | #pragma aux DevHelp_LinToGDTSelector = \
|
---|
337 | "mov bx,sp" \
|
---|
338 | "mov dl,5Ch" \
|
---|
339 | "mov ecx,ss:[bx+4]" \
|
---|
340 | "mov ebx,ss:[bx]" \
|
---|
341 | "call dword ptr [Device_Help]" \
|
---|
342 | "jc error" \
|
---|
343 | "sub ax,ax" \
|
---|
344 | "error:" \
|
---|
345 | value [ax] \
|
---|
346 | parm caller nomemory [ax] [] \
|
---|
347 | modify nomemory exact [ax bx cx dl];
|
---|
348 |
|
---|
349 | #define LOCKTYPE_SHORT_ANYMEM 0x00
|
---|
350 | #define LOCKTYPE_LONG_ANYMEM 0x01
|
---|
351 | #define LOCKTYPE_LONG_HIGHMEM 0x03
|
---|
352 | #define LOCKTYPE_SHORT_VERIFY 0x04
|
---|
353 |
|
---|
354 | USHORT DevHelp_Lock(SEL Segment, USHORT LockType, USHORT WaitFlag, PULONG LockHandle);
|
---|
355 | #pragma aux DevHelp_Lock = \
|
---|
356 | "mov dl,13h" \
|
---|
357 | "call dword ptr [Device_Help]" \
|
---|
358 | "jc error" \
|
---|
359 | "mov es:[di],bx" \
|
---|
360 | "mov es:[di+2],ax" \
|
---|
361 | "sub ax,ax" \
|
---|
362 | "error:" \
|
---|
363 | value [ax] \
|
---|
364 | parm caller [ax] [bh] [bl] [es di] \
|
---|
365 | modify exact [ax dl];
|
---|
366 |
|
---|
367 | USHORT DevHelp_MonFlush(USHORT MonitorHandle);
|
---|
368 | #pragma aux DevHelp_MonFlush = \
|
---|
369 | "mov dl,23h" \
|
---|
370 | DEVHELP_CALL \
|
---|
371 | parm caller [ax] \
|
---|
372 | modify exact [ax dl];
|
---|
373 |
|
---|
374 | USHORT DevHelp_MonitorCreate(USHORT MonitorHandle, PBYTE FinalBuffer, NPFN NotifyRtn, PUSHORT MonitorChainHandle);
|
---|
375 | #pragma aux DevHelp_MonitorCreate = \
|
---|
376 | "mov dl,1Fh" \
|
---|
377 | "call dword ptr [Device_Help]" \
|
---|
378 | "jc error" \
|
---|
379 | "mov si,[esp]" \
|
---|
380 | "mov es,[esp+2]" \
|
---|
381 | "mov es:[si],ax" \
|
---|
382 | "sub ax,ax" \
|
---|
383 | "error:" \
|
---|
384 | value [ax] \
|
---|
385 | parm caller [ax] [es si] [di] [] \
|
---|
386 | modify exact [ax dl es si];
|
---|
387 |
|
---|
388 | /* DevHelp_MonWrite has one change compared to the original specification.
|
---|
389 | The DataRecord parameter was originally a far (16:16) pointer. It has
|
---|
390 | been changed to a near pointer because DS must point to the default data
|
---|
391 | segment and therefore the DataRecord parameter must be near. This
|
---|
392 | allows the compiler to catch the error.
|
---|
393 | */
|
---|
394 |
|
---|
395 | USHORT DevHelp_MonWrite(USHORT MonitorHandle, NPBYTE DataRecord, USHORT Count, ULONG TimeStampMS, USHORT WaitFlag);
|
---|
396 | #pragma aux DevHelp_MonWrite = \
|
---|
397 | "mov dl,22h" \
|
---|
398 | DEVHELP_CALL \
|
---|
399 | parm caller [ax] [si] [cx] [di bx] [dh] \
|
---|
400 | modify exact [ax dl];
|
---|
401 |
|
---|
402 | USHORT DevHelp_OpenEventSem(ULONG hEvent);
|
---|
403 | #pragma aux DevHelp_OpenEventSem = \
|
---|
404 | "mov eax,[esp]" \
|
---|
405 | "mov dl,67h" \
|
---|
406 | DEVHELP_CALL \
|
---|
407 | parm caller nomemory [] \
|
---|
408 | modify nomemory exact [ax dl];
|
---|
409 |
|
---|
410 | #define GDTSEL_R3CODE 0x0000 /*@V76282*/
|
---|
411 | #define GDTSEL_R3DATA 0x0001 /*@V76282*/
|
---|
412 | #define GDTSEL_R2CODE 0x0003 /*@V76282*/
|
---|
413 | #define GDTSEL_R2DATA 0x0004 /*@V76282*/
|
---|
414 | #define GDTSEL_R0CODE 0x0005 /*@V76282*/
|
---|
415 | #define GDTSEL_R0DATA 0x0006 /*@V76282*/
|
---|
416 |
|
---|
417 | /* GDTSEL_ADDR32 may be OR'd with above defines */ /*@V76282*/
|
---|
418 | #define GDTSEL_ADDR32 0x0080 /*@V76282*/
|
---|
419 |
|
---|
420 | USHORT DevHelp_PageListToGDTSelector(SEL Selector, ULONG Size, USHORT Access, LIN pPageList);
|
---|
421 | #pragma aux DevHelp_PageListToGDTSelector = \
|
---|
422 | "mov ecx,[esp]" \
|
---|
423 | "mov dh,[esp+4]" \
|
---|
424 | "mov edi,[esp+6]" \
|
---|
425 | "mov dl,60h" \
|
---|
426 | "call dword ptr [Device_Help]" \
|
---|
427 | "jc error" \
|
---|
428 | "sub ax,ax" \
|
---|
429 | "error:" \
|
---|
430 | value [ax] \
|
---|
431 | parm caller [] \
|
---|
432 | modify nomemory exact [ax cx dx di];
|
---|
433 |
|
---|
434 | USHORT DevHelp_PageListToLin(ULONG Size, LIN pPageList, PLIN LinearAddr);
|
---|
435 | #pragma aux DevHelp_PageListToLin = \
|
---|
436 | "mov ecx,[esp]" \
|
---|
437 | "mov edi,[esp+4]" \
|
---|
438 | "mov dl,5Fh" \
|
---|
439 | "call dword ptr [Device_Help]" \
|
---|
440 | "jc error" \
|
---|
441 | "les di,[esp+8]" \
|
---|
442 | "mov es:[di],eax" \
|
---|
443 | "sub ax,ax" \
|
---|
444 | "error:" \
|
---|
445 | value [ax] \
|
---|
446 | parm caller [] \
|
---|
447 | modify exact [ax cx dx di];
|
---|
448 |
|
---|
449 | /* NOTE: After the DevHelp call, SI contains the modified selector. However,
|
---|
450 | the C interface has no provisions for returning this value to the caller.
|
---|
451 | You can, however, use the _SI() inline function defined in include.h.
|
---|
452 | */
|
---|
453 |
|
---|
454 | USHORT DevHelp_PhysToGDTSel(ULONG PhysAddr, ULONG Count, SEL Selector, UCHAR Access);
|
---|
455 | #pragma aux DevHelp_PhysToGDTSel = \
|
---|
456 | "push bp" \
|
---|
457 | "mov dl,54h" \
|
---|
458 | "mov bp,sp" \
|
---|
459 | "mov eax,[bp+2]" \
|
---|
460 | "mov ecx,[bp+6]" \
|
---|
461 | "mov si,[bp+10]" \
|
---|
462 | "mov dh,[bp+12]" \
|
---|
463 | "call dword ptr [Device_Help]" \
|
---|
464 | "jc error" \
|
---|
465 | "sub ax,ax" \
|
---|
466 | "error:" \
|
---|
467 | "pop bp" \
|
---|
468 | value [ax] \
|
---|
469 | parm caller nomemory [] \
|
---|
470 | modify nomemory exact [ax cx dx si];
|
---|
471 |
|
---|
472 | USHORT DevHelp_PhysToGDTSelector(ULONG PhysAddr, USHORT Count, SEL Selector);
|
---|
473 | #pragma aux DevHelp_PhysToGDTSelector = \
|
---|
474 | "xchg ax,bx" \
|
---|
475 | "mov dl,2Eh" \
|
---|
476 | DEVHELP_CALL \
|
---|
477 | parm nomemory [ax bx] [cx] [si] \
|
---|
478 | modify nomemory exact [ax bx dl];
|
---|
479 |
|
---|
480 | #define SELTYPE_R3CODE 0
|
---|
481 | #define SELTYPE_R3DATA 1
|
---|
482 | #define SELTYPE_FREE 2
|
---|
483 | #define SELTYPE_R2CODE 3
|
---|
484 | #define SELTYPE_R2DATA 4
|
---|
485 | #define SELTYPE_R3VIDEO 5
|
---|
486 |
|
---|
487 | USHORT DevHelp_PhysToUVirt(ULONG PhysAddr, USHORT Length, USHORT flags, USHORT TagType, PVOID SelOffset);
|
---|
488 | #pragma aux DevHelp_PhysToUVirt = \
|
---|
489 | "xchg ax,bx" \
|
---|
490 | "mov dl,17h" \
|
---|
491 | "call dword ptr [Device_Help]" \
|
---|
492 | "jc error" \
|
---|
493 | "push es" \
|
---|
494 | "push bx" \
|
---|
495 | "mov bx,sp" \
|
---|
496 | "les bx,ss:[bx+4]" \
|
---|
497 | "pop es:[bx]" \
|
---|
498 | "pop es:[bx+2]" \
|
---|
499 | "sub ax,ax" \
|
---|
500 | "error:" \
|
---|
501 | value [ax] \
|
---|
502 | parm caller nomemory [bx ax] [cx] [dh] [si] [] \
|
---|
503 | modify exact [ax bx dl es];
|
---|
504 |
|
---|
505 | USHORT DevHelp_PhysToVirt(ULONG PhysAddr, USHORT usLength, PVOID SelOffset, PUSHORT ModeFlag);
|
---|
506 | #pragma aux DevHelp_PhysToVirt = \
|
---|
507 | "xchg ax,bx" \
|
---|
508 | "mov dx,15h" \
|
---|
509 | "push ds" \
|
---|
510 | "call dword ptr [Device_Help]" \
|
---|
511 | "jc error" \
|
---|
512 | "sub ax,ax" \
|
---|
513 | "mov es:[di],si" \
|
---|
514 | "mov es:[di+2],ds" \
|
---|
515 | "error:" \
|
---|
516 | "pop ds" \
|
---|
517 | value [ax] \
|
---|
518 | parm caller nomemory [bx ax] [cx] [es di] [] \
|
---|
519 | modify exact [ax bx dx si];
|
---|
520 |
|
---|
521 | USHORT DevHelp_PostEventSem(ULONG hEvent);
|
---|
522 | #pragma aux DevHelp_PostEventSem = \
|
---|
523 | "mov eax,[esp]" \
|
---|
524 | "mov dl,69h" \
|
---|
525 | DEVHELP_CALL \
|
---|
526 | parm caller nomemory [] \
|
---|
527 | modify nomemory exact [ax dl];
|
---|
528 |
|
---|
529 | #define WAIT_IS_INTERRUPTABLE 0
|
---|
530 | #define WAIT_IS_NOT_INTERRUPTABLE 1
|
---|
531 |
|
---|
532 | #define WAIT_INTERRUPTED 0x8003
|
---|
533 | #define WAIT_TIMED_OUT 0x8001
|
---|
534 |
|
---|
535 | USHORT DevHelp_ProcBlock(ULONG EventId, ULONG WaitTime, USHORT IntWaitFlag);
|
---|
536 | #pragma aux DevHelp_ProcBlock = \
|
---|
537 | "mov dl,4" \
|
---|
538 | "xchg ax,bx" \
|
---|
539 | "xchg cx,di" \
|
---|
540 | "call dword ptr [Device_Help]" \
|
---|
541 | "jc error" \
|
---|
542 | "mov ax,0" /* doesn't affect zero flag like sub ax,ax does */ \
|
---|
543 | "error:" \
|
---|
544 | value [ax] \
|
---|
545 | parm caller nomemory [ax bx] [di cx] [dh] \
|
---|
546 | modify nomemory exact [ax bx cx dl di];
|
---|
547 |
|
---|
548 | USHORT DevHelp_ProcRun(ULONG EventId, PUSHORT AwakeCount);
|
---|
549 | #pragma aux DevHelp_ProcRun = \
|
---|
550 | "mov dl,5" \
|
---|
551 | "xchg ax,bx" \
|
---|
552 | "call dword ptr [Device_Help]" \
|
---|
553 | "mov es:[si],ax" \
|
---|
554 | "sub ax,ax" \
|
---|
555 | value [ax] \
|
---|
556 | parm caller nomemory [ax bx] [es si] \
|
---|
557 | modify exact [ax bx dl];
|
---|
558 |
|
---|
559 | USHORT DevHelp_PullParticular(NPBYTE Queue, PBYTE ReqPktAddr);
|
---|
560 | #pragma aux DevHelp_PullParticular= \
|
---|
561 | "mov dl,0Bh" \
|
---|
562 | DEVHELP_CALL \
|
---|
563 | parm [si] [es bx] \
|
---|
564 | modify exact [ax dl];
|
---|
565 |
|
---|
566 | USHORT DevHelp_PullRequest(NPBYTE Queue, PBYTE __far *ReqPktAddr);
|
---|
567 | #pragma aux DevHelp_PullRequest = \
|
---|
568 | "push es" \
|
---|
569 | "mov dl,0Ah" \
|
---|
570 | "call dword ptr [Device_Help]" \
|
---|
571 | "jc error" \
|
---|
572 | "movzx esp,sp" \
|
---|
573 | "push es" \
|
---|
574 | "push bx" \
|
---|
575 | "mov bx,sp" \
|
---|
576 | "les bx,[esp]" \
|
---|
577 | "pop es:[bx]" \
|
---|
578 | "pop es:[bx+2]" \
|
---|
579 | "sub ax,ax" \
|
---|
580 | "error:" \
|
---|
581 | value [ax] \
|
---|
582 | parm [si] [] \
|
---|
583 | modify exact [ax bx dl es];
|
---|
584 |
|
---|
585 | USHORT DevHelp_PushRequest(NPBYTE Queue, PBYTE ReqPktddr);
|
---|
586 | #pragma aux DevHelp_PushRequest = \
|
---|
587 | "mov dl,09h" \
|
---|
588 | "call dword ptr [Device_Help]" \
|
---|
589 | "sub ax,ax" \
|
---|
590 | value [ax] \
|
---|
591 | parm [si] [es bx] \
|
---|
592 | modify exact [ax dl];
|
---|
593 |
|
---|
594 | USHORT DevHelp_QueueFlush(NPBYTE Queue);
|
---|
595 | #pragma aux DevHelp_QueueFlush = \
|
---|
596 | "mov dl,10h" \
|
---|
597 | "call dword ptr [Device_Help]" \
|
---|
598 | "sub ax,ax" \
|
---|
599 | value [ax] \
|
---|
600 | parm [bx] \
|
---|
601 | modify exact [ax dl];
|
---|
602 |
|
---|
603 | typedef struct _QUEUEHDR {
|
---|
604 | USHORT QSize;
|
---|
605 | USHORT QChrOut;
|
---|
606 | USHORT QCount;
|
---|
607 | BYTE Queue[1];
|
---|
608 | } QUEUEHDR, __far *PQUEUEHDR;
|
---|
609 |
|
---|
610 | USHORT DevHelp_QueueInit(NPBYTE Queue);
|
---|
611 | #pragma aux DevHelp_QueueInit = \
|
---|
612 | "mov dl,0Fh" \
|
---|
613 | "call dword ptr [Device_Help]" \
|
---|
614 | "sub ax,ax" \
|
---|
615 | value [ax] \
|
---|
616 | parm [bx] \
|
---|
617 | modify exact [ax dl];
|
---|
618 |
|
---|
619 | USHORT DevHelp_QueueRead(NPBYTE Queue, PBYTE Char);
|
---|
620 | #pragma aux DevHelp_QueueRead = \
|
---|
621 | "mov dl,12h" \
|
---|
622 | "call dword ptr [Device_Help]" \
|
---|
623 | "jc error" \
|
---|
624 | "mov es:[di],al" \
|
---|
625 | "sub ax,ax" \
|
---|
626 | "error:" \
|
---|
627 | value [ax] \
|
---|
628 | parm [bx] [es di] \
|
---|
629 | modify exact [ax dl];
|
---|
630 |
|
---|
631 | USHORT DevHelp_QueueWrite(NPBYTE Queue, UCHAR Char);
|
---|
632 | #pragma aux DevHelp_QueueWrite = \
|
---|
633 | "mov dl,11h" \
|
---|
634 | DEVHELP_CALL \
|
---|
635 | parm [bx] [al] \
|
---|
636 | modify exact [ax dl];
|
---|
637 |
|
---|
638 | USHORT DevHelp_RAS(USHORT Major, USHORT Minor, USHORT Size, PBYTE Data);
|
---|
639 | #pragma aux DevHelp_RAS = \
|
---|
640 | "push ds" \
|
---|
641 | "push es" \
|
---|
642 | "pop ds" \
|
---|
643 | "pop es" \
|
---|
644 | "mov dl,28h" \
|
---|
645 | "call dword ptr es:[Device_Help]" \
|
---|
646 | "push es" \
|
---|
647 | "pop ds" \
|
---|
648 | "mov ax,0" \
|
---|
649 | "sbb ax,0" \
|
---|
650 | value [ax] \
|
---|
651 | parm [ax] [cx] [bx] [es si] \
|
---|
652 | modify nomemory exact [ax dl es];
|
---|
653 |
|
---|
654 | #define CHAIN_AT_TOP 0
|
---|
655 | #define CHAIN_AT_BOTTOM 1
|
---|
656 |
|
---|
657 | USHORT DevHelp_Register(USHORT MonitorHandle, USHORT MonitorPID, PBYTE InputBuffer, NPBYTE OutputBuffer, USHORT ChainFlag);
|
---|
658 | #pragma aux DevHelp_Register = \
|
---|
659 | "mov dl,20h" \
|
---|
660 | DEVHELP_CALL \
|
---|
661 | parm caller nomemory [ax] [cx] [es si] [di] [dh] \
|
---|
662 | modify nomemory exact [ax dl];
|
---|
663 |
|
---|
664 | USHORT DevHelp_RegisterBeep(PFN BeepHandler);
|
---|
665 | #pragma aux DevHelp_RegisterBeep = \
|
---|
666 | "mov dl,51h" \
|
---|
667 | "call dword ptr [Device_Help]" \
|
---|
668 | "sub ax,ax" \
|
---|
669 | value [ax] \
|
---|
670 | parm caller nomemory [cx di] \
|
---|
671 | modify nomemory exact [ax dl];
|
---|
672 |
|
---|
673 | #define DEVICECLASS_ADDDM 1 /*@V74979*/
|
---|
674 | #define DEVICECLASS_MOUSE 2 /*@V74979*/
|
---|
675 |
|
---|
676 | USHORT DevHelp_RegisterDeviceClass(NPSZ DeviceString, PFN DriverEP, USHORT DeviceFlags, USHORT DeviceClass, PUSHORT DeviceHandle);
|
---|
677 | #pragma aux DevHelp_RegisterDeviceClass = \
|
---|
678 | "mov dl,43h" \
|
---|
679 | "xchg ax,bx" \
|
---|
680 | "call dword ptr [Device_Help]" \
|
---|
681 | "jc error" \
|
---|
682 | "les bx,[esp]" \
|
---|
683 | "mov es:[bx],ax" \
|
---|
684 | "sub ax,ax" \
|
---|
685 | "error:" \
|
---|
686 | value [ax] \
|
---|
687 | parm [si] [ax bx] [di] [cx] [] \
|
---|
688 | modify exact [ax bx dl es];
|
---|
689 |
|
---|
690 | USHORT DevHelp_RegisterPDD(NPSZ PhysDevName, PFN HandlerRoutine);
|
---|
691 | #pragma aux DevHelp_RegisterPDD = \
|
---|
692 | "mov dl,50h" \
|
---|
693 | DEVHELP_CALL \
|
---|
694 | parm caller [si] [es di] \
|
---|
695 | modify nomemory exact [ax dl];
|
---|
696 |
|
---|
697 | typedef struct _STACKUSAGEDATA {
|
---|
698 | USHORT Size;
|
---|
699 | USHORT Flags;
|
---|
700 | USHORT IRQLevel;
|
---|
701 | USHORT CLIStack;
|
---|
702 | USHORT STIStack;
|
---|
703 | USHORT EOIStack;
|
---|
704 | USHORT NestingLevel;
|
---|
705 | } STACKUSAGEDATA;
|
---|
706 |
|
---|
707 | USHORT DevHelp_RegisterStackUsage(PVOID StackUsageData);
|
---|
708 | #pragma aux DevHelp_RegisterStackUsage = \
|
---|
709 | "mov dl,3Ah" \
|
---|
710 | "call dword ptr [Device_Help]" \
|
---|
711 | "mov ax,0" \
|
---|
712 | "sbb ax,0" \
|
---|
713 | value [ax] \
|
---|
714 | parm caller [bx] \
|
---|
715 | modify nomemory exact [ax dl];
|
---|
716 |
|
---|
717 | USHORT DevHelp_RegisterTmrDD(NPFN TimerEntry, PULONG TmrRollover, PULONG Tmr);
|
---|
718 | #pragma aux DevHelp_RegisterTmrDD = \
|
---|
719 | "mov dl,61h" \
|
---|
720 | "call dword ptr [Device_Help]" \
|
---|
721 | "mov ax,bx" \
|
---|
722 | "les bx,[esp]" \
|
---|
723 | "mov es:[bx],ax" \
|
---|
724 | "mov es:[bx+2],di" \
|
---|
725 | "les bx,[esp+4]" \
|
---|
726 | "mov es:[bx],cx" \
|
---|
727 | "mov es:[bx+2],di" \
|
---|
728 | "sub ax,ax" \
|
---|
729 | value [ax] \
|
---|
730 | parm caller nomemory [di] [] \
|
---|
731 | modify exact [ax bx cx di dl es];
|
---|
732 |
|
---|
733 | USHORT DevHlp_ResetEventSem(ULONG hEvent, PULONG pNumPosts);
|
---|
734 | #pragma aux DevHelp_ResetEventSem = \
|
---|
735 | "mov eax,[esp]" \
|
---|
736 | "mov edi,[esp+4]" \
|
---|
737 | "mov dl,6Ah" \
|
---|
738 | DEVHELP_CALL \
|
---|
739 | parm caller nomemory [] \
|
---|
740 | modify exact [ax di dl];
|
---|
741 |
|
---|
742 | USHORT DevHelp_ResetTimer(NPFN TimerHandler);
|
---|
743 | #pragma aux DevHelp_ResetTimer = \
|
---|
744 | "mov dl,1Eh" \
|
---|
745 | DEVHELP_CALL \
|
---|
746 | parm caller nomemory [ax] \
|
---|
747 | modify nomemory exact [ax dl];
|
---|
748 |
|
---|
749 | typedef struct _MSGTABLE {
|
---|
750 | USHORT MsgId; /* Message Id # */
|
---|
751 | USHORT cMsgStrings; /* # of (%) substitution strings */
|
---|
752 | PSZ MsgStrings[1]; /* Substitution string pointers */
|
---|
753 | } MSGTABLE, __near *NPMSGTABLE;
|
---|
754 |
|
---|
755 | USHORT DevHelp_Save_Message(NPBYTE MsgTable);
|
---|
756 | #pragma aux DevHelp_Save_Message = \
|
---|
757 | "sub bx,bx" \
|
---|
758 | "mov dl,3Dh" \
|
---|
759 | DEVHELP_CALL \
|
---|
760 | parm caller [si] \
|
---|
761 | modify nomemory exact [ax bx dl];
|
---|
762 |
|
---|
763 | USHORT DevHelp_SchedClock(PFN NEAR *SchedRoutineAddr);
|
---|
764 | #pragma aux DevHelp_SchedClock = \
|
---|
765 | "mov dl,0h" \
|
---|
766 | "call dword ptr [Device_Help]" \
|
---|
767 | "sub ax,ax" \
|
---|
768 | value [ax] \
|
---|
769 | parm caller [ax] \
|
---|
770 | modify nomemory exact [ax dl];
|
---|
771 |
|
---|
772 | USHORT DevHelp_SemClear(ULONG SemHandle);
|
---|
773 | #pragma aux DevHelp_SemClear = \
|
---|
774 | "xchg ax,bx" \
|
---|
775 | "mov dl,7h" \
|
---|
776 | DEVHELP_CALL \
|
---|
777 | parm nomemory [ax bx] \
|
---|
778 | modify nomemory exact [ax bx dl];
|
---|
779 |
|
---|
780 | #define SEMUSEFLAG_IN_USE 0
|
---|
781 | #define SEMUSEFLAG_NOT_IN_USE 1
|
---|
782 |
|
---|
783 | USHORT DevHelp_SemHandle(ULONG SemKey, USHORT SemUseFlag, PULONG SemHandle);
|
---|
784 | #pragma aux DevHelp_SemHandle = \
|
---|
785 | "xchg ax,bx" \
|
---|
786 | "mov dl,8h" \
|
---|
787 | "call dword ptr [Device_Help]" \
|
---|
788 | "jc error" \
|
---|
789 | "mov es:[si],bx" \
|
---|
790 | "mov es:[si+2],ax" \
|
---|
791 | "sub ax,ax" \
|
---|
792 | "error:" \
|
---|
793 | value [ax] \
|
---|
794 | parm nomemory [ax bx] [dh] [es si] \
|
---|
795 | modify exact [ax bx dl];
|
---|
796 |
|
---|
797 | USHORT DevHelp_SemRequest(ULONG SemHandle, ULONG SemTimeout);
|
---|
798 | #pragma aux DevHelp_SemRequest = \
|
---|
799 | "xchg ax,bx" \
|
---|
800 | "xchg di,cx" \
|
---|
801 | "mov dl,06h" \
|
---|
802 | DEVHELP_CALL \
|
---|
803 | parm nomemory [ax bx] [cx di] \
|
---|
804 | modify nomemory exact [ax bx cx di dl];
|
---|
805 |
|
---|
806 | #define EVENT_MOUSEHOTKEY 0
|
---|
807 | #define EVENT_CTRLBREAK 1
|
---|
808 | #define EVENT_CTRLC 2
|
---|
809 | #define EVENT_CTRLNUMLOCK 3
|
---|
810 | #define EVENT_CTRLPRTSC 4
|
---|
811 | #define EVENT_SHIFTPRTSC 5
|
---|
812 | #define EVENT_KBDHOTKEY 6
|
---|
813 | #define EVENT_KBDREBOOT 7
|
---|
814 |
|
---|
815 | USHORT DevHelp_SendEvent(USHORT EventType, USHORT Parm);
|
---|
816 | #pragma aux DevHelp_SendEvent = \
|
---|
817 | "mov dl,25h" \
|
---|
818 | "call dword ptr [Device_Help]" \
|
---|
819 | "mov ax,0" \
|
---|
820 | "sbb ax,0" \
|
---|
821 | value [ax] \
|
---|
822 | parm nomemory [ah] [bx] \
|
---|
823 | modify nomemory exact [ax dl];
|
---|
824 |
|
---|
825 | USHORT DevHelp_SetIRQ(NPFN IRQHandler, USHORT IRQLevel, USHORT SharedFlag);
|
---|
826 | #pragma aux DevHelp_SetIRQ = \
|
---|
827 | "mov dl,1Bh" \
|
---|
828 | DEVHELP_CALL \
|
---|
829 | parm caller nomemory [ax] [bx] [dh] \
|
---|
830 | modify nomemory exact [ax dl];
|
---|
831 |
|
---|
832 | USHORT DevHelp_SetTimer(NPFN TimerHandler);
|
---|
833 | #pragma aux DevHelp_SetTimer = \
|
---|
834 | "mov dl,1Dh" \
|
---|
835 | DEVHELP_CALL \
|
---|
836 | parm caller nomemory [ax] \
|
---|
837 | modify nomemory exact [ax dl];
|
---|
838 |
|
---|
839 | USHORT DevHelp_SortRequest(NPBYTE Queue, PBYTE ReqPktAddr);
|
---|
840 | #pragma aux DevHelp_SortRequest = \
|
---|
841 | "mov dl,0Ch" \
|
---|
842 | "call dword ptr [Device_Help]" \
|
---|
843 | "sub ax,ax" \
|
---|
844 | value [ax] \
|
---|
845 | parm [si] [es bx] \
|
---|
846 | modify exact [ax dl];
|
---|
847 |
|
---|
848 | USHORT DevHelp_TCYield(void);
|
---|
849 | #pragma aux DevHelp_TCYield = \
|
---|
850 | "mov dl,3" \
|
---|
851 | "call dword ptr [Device_Help]" \
|
---|
852 | "sub ax,ax" \
|
---|
853 | value [ax] \
|
---|
854 | parm caller nomemory [] \
|
---|
855 | modify nomemory exact [ax dl];
|
---|
856 |
|
---|
857 | USHORT DevHelp_TickCount(NPFN TimerHandler, USHORT TickCount);
|
---|
858 | #pragma aux DevHelp_TickCount = \
|
---|
859 | "mov dl,33h" \
|
---|
860 | DEVHELP_CALL \
|
---|
861 | parm caller nomemory [ax] [bx] \
|
---|
862 | modify nomemory exact [ax dl];
|
---|
863 |
|
---|
864 | USHORT DevHelp_UnLock(ULONG LockHandle);
|
---|
865 | #pragma aux DevHelp_UnLock = \
|
---|
866 | "xchg ax,bx" \
|
---|
867 | "mov dl,14h" \
|
---|
868 | DEVHELP_CALL \
|
---|
869 | parm nomemory [ax bx] \
|
---|
870 | modify nomemory exact [ax bx dl];
|
---|
871 |
|
---|
872 | USHORT DevHelp_UnSetIRQ(USHORT IRQLevel);
|
---|
873 | #pragma aux DevHelp_UnSetIRQ = \
|
---|
874 | "mov dl,1Ch" \
|
---|
875 | DEVHELP_CALL \
|
---|
876 | parm caller nomemory [bx] \
|
---|
877 | modify nomemory exact [ax dl];
|
---|
878 |
|
---|
879 | #define VERIFY_READONLY 0
|
---|
880 | #define VERIFY_READWRITE 1
|
---|
881 |
|
---|
882 | USHORT DevHelp_VerifyAccess(SEL MemSelector, USHORT Length, USHORT MemOffset, UCHAR AccessFlag);
|
---|
883 | #pragma aux DevHelp_VerifyAccess = \
|
---|
884 | "mov dl,27h" \
|
---|
885 | DEVHELP_CALL \
|
---|
886 | parm caller nomemory [ax] [cx] [di] [dh] \
|
---|
887 | modify nomemory exact [ax dl];
|
---|
888 |
|
---|
889 | #define VIDEO_PAUSE_OFF 0
|
---|
890 | #define VIDEO_PAUSE_ON 1
|
---|
891 |
|
---|
892 | USHORT DevHelp_VideoPause(USHORT OnOff);
|
---|
893 | #pragma aux DevHelp_VideoPause = \
|
---|
894 | "mov dl,3Ch" \
|
---|
895 | "call dword ptr [Device_Help]" \
|
---|
896 | "mov ax,0" \
|
---|
897 | "sbb ax,0" \
|
---|
898 | value [ax] \
|
---|
899 | parm nomemory [al] \
|
---|
900 | modify nomemory exact [ax dl];
|
---|
901 |
|
---|
902 | USHORT DevHelp_VirtToLin(SEL Selector, ULONG Offset, PLIN LinearAddr);
|
---|
903 | #pragma aux DevHelp_VirtToLin = \
|
---|
904 | "movzx esp,sp" \
|
---|
905 | "mov esi,[esp]" \
|
---|
906 | "mov dl,5bh" \
|
---|
907 | "call dword ptr [Device_Help]" \
|
---|
908 | "jc error" \
|
---|
909 | "les bx,[esp+4]" \
|
---|
910 | "mov es:[bx],eax" \
|
---|
911 | "sub ax,ax" \
|
---|
912 | "error:" \
|
---|
913 | value [ax] \
|
---|
914 | parm caller nomemory [ax] [] \
|
---|
915 | modify exact [ax si es bx dl];
|
---|
916 |
|
---|
917 | USHORT DevHelp_VirtToPhys(PVOID SelOffset, PULONG PhysAddr);
|
---|
918 | #pragma aux DevHelp_VirtToPhys = \
|
---|
919 | "int 3" \
|
---|
920 | "push ds" \
|
---|
921 | "mov dl,16h" \
|
---|
922 | "push es" \
|
---|
923 | "mov si,ds" \
|
---|
924 | "mov es,si" \
|
---|
925 | "mov ds,bx" \
|
---|
926 | "mov si,ax" \
|
---|
927 | "call dword ptr es:[Device_Help]" \
|
---|
928 | "pop es" \
|
---|
929 | "mov es:[di],bx" \
|
---|
930 | "mov es:[di+2],ax" \
|
---|
931 | "pop ds" \
|
---|
932 | "sub ax,ax" \
|
---|
933 | value [ax] \
|
---|
934 | parm caller nomemory [ax bx] [es di] \
|
---|
935 | modify exact [ax bx dl es si];
|
---|
936 |
|
---|
937 | #define VMDHA_16M 0x0001 /*@V76282*/
|
---|
938 | #define VMDHA_FIXED 0x0002 /*@V76282*/
|
---|
939 | #define VMDHA_SWAP 0x0004 /*@V76282*/
|
---|
940 | #define VMDHA_CONTIG 0x0008 /*@V76282*/
|
---|
941 | #define VMDHA_PHYS 0x0010 /*@V76282*/
|
---|
942 | #define VMDHA_PROCESS 0x0020 /*@V76282*/
|
---|
943 | #define VMDHA_SGSCONT 0x0040 /*@V76282*/
|
---|
944 | #define VMDHA_RESERVE 0x0100 /*@V76282*/
|
---|
945 | #define VMDHA_USEHIGHMEM 0x0800 /*@V76282*/
|
---|
946 |
|
---|
947 | USHORT DevHelp_VMAlloc(ULONG Flags, ULONG Size, ULONG PhysAddr, PLIN LinearAddr, PPVOID SelOffset);
|
---|
948 | #pragma aux DevHelp_VMAlloc = \
|
---|
949 | "movzx esp,sp" \
|
---|
950 | "mov eax,[esp]" \
|
---|
951 | "mov ecx,[esp+4]" \
|
---|
952 | "mov edi,[esp+8]" \
|
---|
953 | "mov dl,57h" \
|
---|
954 | "call dword ptr [Device_Help]" \
|
---|
955 | "jc error" \
|
---|
956 | "les di,[esp+12]" \
|
---|
957 | "mov es:[di],eax" \
|
---|
958 | "les di,[esp+16]" \
|
---|
959 | "mov es:[di],ecx" \
|
---|
960 | "sub ax,ax" \
|
---|
961 | "error:" \
|
---|
962 | value [ax] \
|
---|
963 | parm caller nomemory [] \
|
---|
964 | modify exact [ax cx di dl es];
|
---|
965 |
|
---|
966 | USHORT DevHelp_VMFree(LIN LinearAddr);
|
---|
967 | #pragma aux DevHelp_VMFree = \
|
---|
968 | "movzx esp,sp" \
|
---|
969 | "mov dl,58h" \
|
---|
970 | "mov eax,[esp]" \
|
---|
971 | DEVHELP_CALL \
|
---|
972 | parm caller nomemory [] \
|
---|
973 | modify nomemory exact [ax dl];
|
---|
974 |
|
---|
975 | #define VMDHGP_WRITE 0x0001 /*@V76282*/
|
---|
976 | #define VMDHGP_SELMAP 0x0002 /*@V76282*/
|
---|
977 | #define VMDHGP_SGSCONTROL 0x0004 /*@V76282*/
|
---|
978 | #define VMDHGP_4MEG 0x0008 /*@V76282*/
|
---|
979 |
|
---|
980 | USHORT DevHelp_VMGlobalToProcess(ULONG Flags, LIN LinearAddr, ULONG Length, PLIN ProcessLinearAddr);
|
---|
981 | #pragma aux DevHelp_VMGlobalToProcess = \
|
---|
982 | "mov dl,5Ah" \
|
---|
983 | "mov eax,[esp]" \
|
---|
984 | "mov ebx,[esp+4]" \
|
---|
985 | "mov ecx,[esp+8]" \
|
---|
986 | "call dword ptr [Device_Help]" \
|
---|
987 | "jc error" \
|
---|
988 | "les bx,[esp+12]" \
|
---|
989 | "mov es:[bx],eax" \
|
---|
990 | "sub ax,ax" \
|
---|
991 | "error:" \
|
---|
992 | value [ax] \
|
---|
993 | parm caller nomemory [] \
|
---|
994 | modify exact [ax bx cx dl es];
|
---|
995 |
|
---|
996 | #define VMDHL_NOBLOCK 0x0001
|
---|
997 | #define VMDHL_CONTIGUOUS 0x0002
|
---|
998 | #define VMDHL_16M 0x0004
|
---|
999 | #define VMDHL_WRITE 0x0008
|
---|
1000 | #define VMDHL_LONG 0x0010
|
---|
1001 | #define VMDHL_VERIFY 0x0020
|
---|
1002 |
|
---|
1003 | USHORT DevHelp_VMLock(ULONG Flags, LIN LinearAddr, ULONG Length, LIN pPagelist, LIN pLockHandle, PULONG PageListCount);
|
---|
1004 | #pragma aux DevHelp_VMLock = \
|
---|
1005 | "mov dl,55h" \
|
---|
1006 | "mov eax,[esp]" \
|
---|
1007 | "mov ebx,[esp+4]" \
|
---|
1008 | "mov ecx,[esp+8]" \
|
---|
1009 | "mov edi,[esp+12]" \
|
---|
1010 | "mov esi,[esp+16]" \
|
---|
1011 | "call dword ptr [Device_Help]" \
|
---|
1012 | "jc error" \
|
---|
1013 | "les bx,[esp+20]" \
|
---|
1014 | "mov es:[bx],eax" \
|
---|
1015 | "sub ax,ax" \
|
---|
1016 | "error:" \
|
---|
1017 | value [ax] \
|
---|
1018 | parm caller nomemory [] \
|
---|
1019 | modify exact [ax bx cx dl si di es];
|
---|
1020 |
|
---|
1021 | #define VMDHPG_READONLY 0x0000 /*@V76282*/
|
---|
1022 | #define VMDHPG_WRITE 0x0001 /*@V76282*/
|
---|
1023 |
|
---|
1024 | USHORT DevHelp_VMProcessToGlobal(ULONG Flags, LIN LinearAddr, ULONG Length, PLIN GlobalLinearAddr);
|
---|
1025 | #pragma aux DevHelp_ProcessToGlobal = \
|
---|
1026 | "mov dl,59h" \
|
---|
1027 | "mov eax,[esp]" \
|
---|
1028 | "mov ebx,[esp+4]" \
|
---|
1029 | "mov ecx,[esp+8]" \
|
---|
1030 | "call dword ptr [Device_Help]" \
|
---|
1031 | "jc error" \
|
---|
1032 | "les bx,[esp+12]" \
|
---|
1033 | "mov es:[bx],eax" \
|
---|
1034 | "sub ax,ax" \
|
---|
1035 | "error:" \
|
---|
1036 | value [ax] \
|
---|
1037 | parm caller nomemory [] \
|
---|
1038 | modify exact [ax bx cx dl es];
|
---|
1039 |
|
---|
1040 | #define VMDHS_DECOMMIT 0x0001 /*@V76282*/
|
---|
1041 | #define VMDHS_RESIDENT 0x0002 /*@V76282*/
|
---|
1042 | #define VMDHS_SWAP 0x0004 /*@V76282*/
|
---|
1043 |
|
---|
1044 | USHORT DevHelp_VMSetMem(LIN LinearAddr, ULONG Size, ULONG Flags);
|
---|
1045 | #pragma aux DevHelp_VMSetMem = \
|
---|
1046 | "mov dl,66h" \
|
---|
1047 | "mov ebx,[esp]" \
|
---|
1048 | "mov ecx,[esp+4]" \
|
---|
1049 | "mov eax,[esp+8]" \
|
---|
1050 | DEVHELP_CALL \
|
---|
1051 | parm caller nomemory [] \
|
---|
1052 | modify nomemory exact [ax bx cx dl];
|
---|
1053 |
|
---|
1054 | USHORT DevHelp_VMUnLock(LIN pLockHandle);
|
---|
1055 | #pragma aux DevHelp_VMUnLock = \
|
---|
1056 | "mov dl,56h" \
|
---|
1057 | "mov esi,[esp]" \
|
---|
1058 | DEVHELP_CALL \
|
---|
1059 | parm caller [] \
|
---|
1060 | modify exact [ax si dl];
|
---|
1061 |
|
---|
1062 | USHORT DevHelp_Yield(void);
|
---|
1063 | #pragma aux DevHelp_Yield = \
|
---|
1064 | "mov dl,2" \
|
---|
1065 | "call dword ptr [Device_Help]" \
|
---|
1066 | "sub ax,ax" \
|
---|
1067 | value [ax] \
|
---|
1068 | parm caller nomemory [] \
|
---|
1069 | modify nomemory exact [ax dl];
|
---|
1070 |
|
---|
1071 | /*
|
---|
1072 | ** DevHlp Error Codes (from ABERROR.INC)
|
---|
1073 | */
|
---|
1074 |
|
---|
1075 | #define MSG_MEMORY_ALLOCATION_FAILED 0x00
|
---|
1076 | #define ERROR_LID_ALREADY_OWNED 0x01
|
---|
1077 | #define ERROR_LID_DOES_NOT_EXIST 0x02
|
---|
1078 | #define ERROR_ABIOS_NOT_PRESENT 0x03
|
---|
1079 | #define ERROR_NOT_YOUR_LID 0x04
|
---|
1080 | #define ERROR_INVALID_ENTRY_POINT 0x05
|
---|
1081 |
|
---|
1082 | #ifdef __cplusplus
|
---|
1083 | }
|
---|
1084 | #endif
|
---|
1085 |
|
---|
1086 | #endif
|
---|
1087 | #endif
|
---|