source: trunk/src/include/devhelp.h@ 21

Last change on this file since 21 was 21, checked in by markus, 15 years ago

more WATCOM/devhelp issues

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