home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / DASD / DEVHELP / DHCALL2B.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-04-14  |  2.9 KB  |  165 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  4. ;
  5. ;    The following IBM OS/2 WARP source code is provided to you solely for
  6. ;    the purpose of assisting you in your development of OS/2 WARP device
  7. ;    drivers. You may use this code in accordance with the IBM License
  8. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  9. ;    Copyright statement may not be removed.;
  10. ;*****************************************************************************/
  11. ; SCCSID = %w% %e%
  12. ;**************************************************************************
  13. ;*
  14. ;* SOURCE FILE NAME = DHCALL2B.ASM
  15. ;*
  16. ;* DESCRIPTIVE NAME = C callable DevHelp interface
  17. ;*              Memory Management Related DevHelp Calls
  18. ;*
  19. ;*
  20. ;* VERSION = V2.0
  21. ;*
  22. ;* DATE
  23. ;*
  24. ;* DESCRIPTION :
  25. ;*
  26. ;* Purpose:
  27. ;*
  28. ;*
  29. ;*
  30. ;*
  31. ;* FUNCTIONS  :
  32. ;*
  33. ;*
  34. ;*
  35. ;*
  36. ;*
  37. ;*
  38. ;*
  39. ;* NOTES
  40. ;*
  41. ;*
  42. ;* STRUCTURES
  43. ;*
  44. ;* EXTERNAL REFERENCES
  45. ;*
  46. ;*
  47. ;*
  48. ;* EXTERNAL FUNCTIONS
  49. ;*
  50. ;* CHANGE ACTIVITY =
  51. ;*   DATE      FLAG       APAR   CHANGE DESCRIPTION
  52. ;*   --------  ----------  -----  --------------------------------------
  53. ;*   10/22/93  @V74979       74979  Fix DevHelp_PhysToUVirt
  54. ;*   10/22/93  @V74979       74979  Change return type to USHORT
  55. ;*    2/ 5/94           78794  File created
  56. ;*
  57. ;****************************************************************************
  58.  
  59.     .xlist
  60.     include dhmacs.inc
  61.     .list
  62.  
  63. ;*
  64. ;*  Memory Management
  65. ;*
  66.  
  67. Code    segment dword public 'CODE'
  68.     assume    CS:Code,DS:_DATA
  69.  
  70. ;*
  71. ;*
  72. ;* USHORT APIENTRY DevHlp_PhysToUVirt( ULONG PhysAddr, USHORT usLength,
  73. ;*                       USHORT Flags, USHORT TagType,
  74. ;*                       PVOID SelOffset);
  75. ;*
  76. ;*
  77. ;*
  78.  
  79.  
  80.     DHDef    PhysToUVirt
  81.     DHArgs    ULONG,     PhysAddr
  82.     DHArgs    USHORT,  usLength
  83.     DHArgs    USHORT,  Flags
  84.     DHArgs    USHORT,  TagType
  85.     DHArgs    PVOID,     SelOffset
  86.  
  87.  
  88.     mov    ax, Stk.PhysAddr[2]
  89.     mov    bx, Stk.PhysAddr[0]
  90.     mov    cx, Stk.usLength
  91.     mov    dh, Stk.Flags
  92.     mov    si, Stk.TagType
  93.  
  94.     DHCall
  95.  
  96.     push    es
  97.     push    bx
  98.     les    si, Stk.SelOffset                       ;@V74979
  99.     pop    es:[si][0]
  100.     pop    es:[si][2]
  101.  
  102.     DHRet1
  103.  
  104.  
  105. ;*
  106. ;*
  107. ;* USHORT APIENTRY DevHlp_PhysToVirt( ULONG PhysAddr, USHORT usLength,
  108. ;*                      PVOID SelOffset, PUSHORT ModeFlag );
  109. ;*
  110. ;*
  111.  
  112.     DHDef    PhysToVirt
  113.     DHArgs    ULONG,     PhysAddr
  114.     DHArgs    USHORT,  usLength
  115.     DHArgs    PULONG,  SelOffset
  116.     DHArgs    PUSHORT, ModeFlag
  117.  
  118.     mov    ax, Stk.PhysAddr[2]
  119.     mov    bx, Stk.PhysAddr[0]
  120.     mov    cx, Stk.usLength
  121.     mov    dh, 1
  122.  
  123.     DHCall
  124.  
  125.     push    es
  126.     push    di
  127.     les    si, Stk.SelOffset
  128.     pop    es:[si][0]
  129.     pop    es:[si][2]
  130.  
  131.     mov    bx, 1
  132.     les    si, Stk.ModeFlag
  133.     jz    ptov0010
  134.     mov    bx, 0
  135. ptov0010:
  136.     mov    es:[si], bx
  137.  
  138.     DHRet1
  139.  
  140. ;*
  141. ;*
  142. ;* USHORT APIENTRY DevHlp_UnPhysToVirt( PUSHORT ModeFlag );
  143. ;*
  144. ;*
  145.  
  146.     DHDef    UnPhysToVirt
  147.     DHArgs    PUSHORT, ModeFlag
  148.  
  149.     DHCall
  150.  
  151.     mov    bx, 1
  152.     les    si, Stk.ModeFlag
  153.     jz    uptv0010
  154.     mov    bx, 0
  155. uptv0010:
  156.     mov    es:[si], bx
  157.  
  158.     DHRet1
  159.  
  160.  
  161.  
  162. Code    Ends
  163.     End
  164.  
  165.