home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odtlktv4.zip / ODTLKT / TOOLKIT / INC / MVDM.INC < prev    next >
Text File  |  1995-12-04  |  5KB  |  265 lines

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