home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / INC / MVDM.INC < prev    next >
Text File  |  1995-08-24  |  6KB  |  259 lines

  1. ;***    MVDM.INC
  2. ;
  3. ;
  4. ;       Copyright (c) IBM Corporation 1987, 1992
  5. ;
  6. ;       All Rights Reserved
  7. ;       MVDM constants and types
  8. ;
  9. ;       Include file hierarchy:
  10. ;
  11. ;         mvdm.inc
  12. ;           basemac.inc
  13. ;           basedef.inc
  14. ;           vdmprop.inc
  15. ;           vdmm.inc
  16. ;           v8086.inc
  17. ;           vdos.inc
  18. ;           vpic.inc
  19. ;           vdmbios.inc
  20. ;           vkbd.inc
  21. ;           vlpt.inc
  22. ;           vdma.inc
  23. ;
  24. ;       By default, ALL portions of ALL include files are included (ie,
  25. ;       INCL_ALL is assumed).
  26. ;
  27. ;       To control what is included, use INCL_NONE and then select from
  28. ;       the following:
  29. ;
  30. ;           INCL_DEF
  31. ;           INCL_TYPES
  32. ;           INCL_MVDMTYPES
  33. ;           INCL_SSTODS
  34. ;           INCL_ROMBIOS
  35. ;           INCL_PAGE
  36. ;           INCL_VDH
  37. ;           INCL_VDHVPIC
  38. ;           INCL_VDHALL
  39. ;           INCL_VDDHELPERS
  40. ;           INCL_VDHVKBD
  41. ;           INCL_VDHVLPT
  42. ;           INCL_VDHVDMA
  43. ;
  44. ;
  45.  
  46.  
  47. ifndef INCL_NONE
  48. INCL_DEF        EQU 1
  49. INCL_TYPES      EQU 1
  50. INCL_MVDMTYPES  EQU 1
  51. INCL_SSTODS     EQU 1
  52. INCL_ROMBIOS    EQU 1
  53. INCL_PAGE       EQU 1
  54. INCL_VDHALL     EQU 1
  55. INCL_VDDHELPERS         EQU 1
  56. INCL_VDHVKBD    EQU 1
  57. INCL_VDHVLPT    EQU 1
  58. INCL_VDHVDMA    EQU 1
  59. endif
  60.  
  61. ifdef  INCL_VDHALL             ;if all VDH services, set defines
  62. INCL_VDH        EQU 1
  63. INCL_VDHVPIC    EQU 1
  64. INCL_VDHVKBD    EQU 1
  65. INCL_VDHVLPT    EQU 1
  66. INCL_VDHVDMA    EQU 1
  67. endif
  68.  
  69. ifdef  INCL_VDH                ;VDH services require MVDM types
  70. INCL_MVDMTYPES  EQU 1
  71. endif
  72.  
  73. ifdef  INCL_VDHVPIC            ;VDH services require MVDM types
  74. INCL_MVDMTYPES  EQU 1
  75. endif
  76.  
  77. ifdef  INCL_VDHVKBD            ;VDH services require MVDM types
  78. INCL_MVDMTYPES  EQU 1
  79. endif
  80.  
  81. ifdef  INCL_VDHVLPT            ;VDH services require MVDM types
  82. INCL_MVDMTYPES  EQU 1
  83. endif
  84.  
  85. ifdef  INCL_VDHVDMA            ;VDH services require MVDM types
  86. INCL_MVDMTYPES  EQU 1
  87. endif
  88.  
  89. ifdef  INCL_MVDMTYPES          ;MVDM types depend on basic types
  90. INCL_TYPES      EQU 1
  91. endif
  92.  
  93. ifdef  INCL_TYPES              ;types depend on basemaca.inc macros
  94. INCL_DEF        EQU 1
  95. endif
  96.  
  97.  
  98. ;*** Required generic include files
  99. ;
  100.  
  101. include basemaca.inc          ;macros for MASM
  102.  
  103. include basedef.inc             ;basic OS/2 data types
  104.  
  105.  
  106. ;*** MVDM-specific equates (required for function prototypes)
  107. ;
  108.  
  109. DefEntry VDHENTRY PASCAL NEAR    ;to declare exported VDH services
  110. DefEntry HOOKENTRY PASCAL NEAR   ;to declare "hook" entry points
  111. DefEntry PDDENTRY PASCAL FAR32   ;to declare PDD and VDD entry points
  112. DefEntry VDDENTRY PASCAL FAR32 _loadds
  113.  
  114.  
  115. ;*** MVDM-specific macros
  116. ;
  117.  
  118.  
  119.  
  120. ifdef  INCL_VDDHELPERS
  121.  
  122. PRIVENTRY vdhSaveFlags          <VOID>     ;prototypes for helper externals
  123. PRIVENTRY vdhRestoreFlags               <ULONG>
  124. PRIVENTRY vdhInt3               <VOID>
  125. PRIVENTRY vdhXCHG               <PULONG, ULONG>
  126. PRIVENTRY vdhBTC                <PULONG, ULONG>
  127. PRIVENTRY vdhBTR                <PULONG, ULONG>
  128. PRIVENTRY vdhBTS                <PULONG, ULONG>
  129. PRIVENTRY vdhBSF                <ULONG>
  130. PRIVENTRY vdhBSR                <ULONG>
  131. PRIVENTRY vdhOutSB              <PORT, PBYTE, ULONG, BOOL>
  132. PRIVENTRY vdhFindToken          <PSZ>
  133. PRIVENTRY vdhCompareStr         <PSZ, PSZ, BOOL>
  134. PRIVENTRY vdhMoveMem            <PVOID, PVOID, _INT, _INT, UINT, BOOL>
  135.  
  136.  
  137. DISABLE macro               ;alias for CLI (similar to C)
  138.         cli
  139.         endm
  140.  
  141. ENABLE  macro               ;alias for STI (similar to C)
  142.         sti
  143.         endm
  144.  
  145. PUSHFLAGS macro             ;alias for PUSHF
  146.         pushf
  147.         endm
  148.  
  149. POPFLAGS macro              ;alias for POPF
  150.         popf
  151.         endm
  152.  
  153. INT3    macro               ;alias for _INT 3
  154.         int 3
  155.         endm
  156.  
  157. INB     macro   ral,rdx     ;alias for IN AL,DX (also supports IN AH,DX)
  158.         ifidni  <ral>,<ah>
  159.           xchg    al,ah
  160.           in      al,rdx
  161.           xchg    al,ah
  162.         else
  163.           in      ral,rdx
  164.         endif
  165.         endm
  166.  
  167. INW     macro   rax,rdx     ;alias for IN AX,DX (provides support for IO8BIT)
  168.         IFNDEF IO8BIT
  169.         in      rax,rdx
  170.         ELSE
  171.         in      al,rdx
  172.         xchg    al,ah
  173.         inc     rdx
  174.         jmp     $+2
  175.         in      al,rdx
  176.         xchg    al,ah
  177.         dec     rdx
  178.         ENDIF
  179.         endm
  180.  
  181. OUTB    macro   rdx,ral     ;alias for OUT DX,AL (also supports OUT DX,AH)
  182.         ifidni  <ral>,<ah>
  183.           xchg    al,ah
  184.           out     rdx,al
  185.           xchg    al,ah
  186.         else
  187.           out     rdx,ral
  188.         endif
  189.         endm
  190.  
  191. OUTW    macro   rdx,rax     ;alias for OUT DX,AX (provides support for IO8BIT)
  192.         IFNDEF IO8BIT
  193.         out     rdx,rax
  194.         ELSE
  195.         out     rdx,al
  196.         xchg    al,ah
  197.         inc     rdx
  198.         jmp     $+2
  199.         out     rdx,al
  200.         xchg    al,ah
  201.         dec     rdx
  202.         ENDIF
  203.         endm
  204.  
  205. endif  ;INCL_VDDHELPERS
  206.  
  207.  
  208. ;*** MVDM-specific types
  209. ;
  210.  
  211. ifdef  INCL_MVDMTYPES
  212.  
  213. DefType PVDM,PVOID                      ;linear pointer into VDM      ;pvdm
  214.  
  215. DefType PBVDM,PBYTE                     ;same as PVDM, but often needs less casting
  216.  
  217. DefType VBREG,_BYTE                     ;virtual byte register        ;vb
  218.  
  219. endif  ;INCL_MVDMTYPES
  220.  
  221.  
  222. ;*** MVDM-specific include files
  223. ;
  224.  
  225. ifdef  INCL_VDH
  226.         include vdmprop.inc             ;DOS property services
  227.         include vdmm.inc                ;VDM Manager services
  228.         include v8086.inc               ;8086 emulation services
  229.         include vdos.inc                ;DOS emulation services
  230. endif
  231.  
  232. ifdef  INCL_VDHVPIC
  233.         include vpic.inc                ;VPIC services
  234. endif
  235.  
  236. ifdef  INCL_VDHVKBD
  237.         include vkbd.inc                ;VKBD services
  238. endif
  239.  
  240. ifdef  INCL_VDHVLPT
  241.         include vlpt.inc                ;VLPT services
  242. endif
  243.  
  244. ifdef  INCL_VDHVDMA
  245.         include vdma.inc                ;VDMA services
  246. endif
  247.  
  248. ifdef  INCL_ROMBIOS            ;ROM BIOS Data Area definitions
  249.         include vdmbios.inc
  250. endif
  251.  
  252. ifdef  INCL_MI
  253. DefType _t,db
  254. DefType _t,dw
  255. DefType _t,dd
  256.  
  257.         include mi.inc
  258. endif
  259.