Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
4.6 KiB

  1. ; Copyright (c) Microsoft Corporation 1989-1991. All Rights Reserved.
  2. ;******************************************************************************
  3. ;
  4. ; Title: smartdrv.inc - smartdrv equates & structures
  5. ;
  6. ; Version: 1.00
  7. ;
  8. ; Date: 15-Sep-1989
  9. ;
  10. ; Author: ARR
  11. ;
  12. ;------------------------------------------------------------------------------
  13. ;
  14. ; Change log:
  15. ;
  16. ; DATE REV DESCRIPTION
  17. ; ----------- --- -----------------------------------------------------------
  18. ; 15-Sep-1989 ARR Original
  19. ;
  20. ;==============================================================================
  21. ;
  22. ; Device name of SMARTDRV
  23. ;
  24. SD_DEV_NAME equ "SMARTAAR",0
  25. ;
  26. ; SMARTDRV cache type (XMS or EMS) -- SD_IR_Driver_Type field
  27. ;
  28. SD_CACHE_XMS equ 1 ; Cache is in XMS
  29. SD_CACHE_EMS equ 2 ; Cache is in EMS
  30. ;
  31. ; Structure of the data returned on the SMARTDRV IOCTL read call
  32. ;
  33. SD_IOCTL_Read struc
  34. SD_IR_Write_Through db ? ; Write-through flag, currently always 1
  35. SD_IR_Write_Buff db ? ; Buffer write flag, currently always 0
  36. SD_IR_Enable_Int13 db ? ; Cache enable flag, 1 = enabled
  37. SD_IR_Driver_Type db ? ; Type 1 (XMS cache) or 2 (EMS cache)
  38. SD_IR_Tick_Setting dw ? ; Ticks between flushes, currently unused
  39. SD_IR_Lock_Cache db ? ; Non-zero if cache is locked
  40. SD_IR_Reboot_Flush db ? ; Non-zero if cache should be flushed on reboot
  41. SD_IR_Cache_All db ? ; Zero if full track writes are not cached
  42. db ? ; Unused
  43. SD_IR_Original_INT13 dd ? ; INT 13 address SMARTDRV hooked
  44. SD_IR_Version dw ? ; SMARTDrive version, packed BCD
  45. dw ? ; Unused
  46. ; Next three values are used for computing
  47. ; cache statistics. They may be scaled rather
  48. ; than absolute values
  49. SD_IR_Total_Sec_Read dw ? ; Count of sectors read
  50. SD_IR_Cache_Sec_Read dw ? ; Count of sectors read from cache
  51. SD_IR_Track_Sec_Read dw ? ; Count of sectors read from track buffer
  52. ; Cache statistics
  53. SD_IR_Cache_Hit_Ratio db ? ; = Cache_Sec_Read * 100 / Total_Sec_Read
  54. SD_IR_Track_Hit_Ratio db ? ; = Track_Sec_Read * 100 / Total_Sec_Read
  55. SD_IR_Total_Tracks dw ? ; Number of tracks in the cache
  56. SD_IR_Total_Used dw ? ; Tracks currently in use
  57. SD_IR_Total_Locked dw ? ; Tracks currently locked
  58. SD_IR_Total_Dirty dw ? ; Tracks currently dirty
  59. ; Information for resizing cache
  60. ; All values are in terms of 16Kb pages.
  61. SD_IR_Current_Size dw ? ; Current size of the cache, in 16Kb pages
  62. SD_IR_Dev_Size dw ? ; Original size requested by user
  63. SD_IR_Min_Cache_Size dw ? ; Minimum allowable size
  64. SD_IOCTL_Read ends
  65. ;
  66. ; IOCTL Write functions
  67. ; The function is encoded in the first byte of the IOCTL write data
  68. ;
  69. SD_IOCTL_WR_Flush equ 0 ; Flush the cache
  70. SD_IOCTL_WR_Flush_Invalidate equ 1 ; Flush the cache and discard it
  71. SD_IOCTL_WR_Disable_Cache equ 2 ; Turn caching off
  72. SD_IOCTL_WR_Enable_Cache equ 3 ; Turn caching on
  73. SD_IOCTL_WR_Set_Tick equ 5 ; Set tick count for flush
  74. SD_IOCTL_WR_Lock equ 6 ; Lock current cache contents
  75. SD_IOCTL_WR_Unlock equ 7 ; Unlock current cache contents
  76. SD_IOCTL_WR_Reboot_Flush equ 8 ; Set Reboot_Flush flag
  77. SD_IOCTL_WR_Shrink_Cache equ 11 ; Reduce cache size
  78. SD_IOCTL_WR_Grow_Cache equ 12 ; Increase cache size
  79. SD_IOCTL_WR_Set_INT_13 equ 13 ; Set the address SMARTDRV
  80. ; chains to on INT 13s
  81. ;
  82. ; Structures for the IOCTL write calls
  83. ;
  84. ; These calls do not take any parameters so the correct write count is 1
  85. ; (the function code byte)
  86. ;
  87. ; WR_Flush
  88. ; WR_Flush_Invalidate
  89. ; WR_Disable_Cache
  90. ; WR_Enable_Cache
  91. ; WR_Set_Tick
  92. ; WR_Lock
  93. ; WR_Unlock
  94. ;
  95. SD_IOCTL_WR_NoParm struc
  96. SD_I_W_Func db ?
  97. SD_IOCTL_WR_NoParm ends
  98. ;
  99. ; WR_Reboot_Flush
  100. ;
  101. SD_IOCTL_WR_Reboot struc
  102. SD_I_W_FuncR db SD_IOCTL_WR_Reboot_Flush
  103. SD_I_W_RebootFlg db ? ; 0 to turn reboot flush off
  104. ; 1 to turn reboot flush on
  105. SD_IOCTL_WR_Reboot ends
  106. ;
  107. ; WR_Shrink_Cache
  108. ; WR_Grow_Cache
  109. ;
  110. SD_IOCTL_WR_GrwShrk struc
  111. SD_I_W_FuncGS db ? ; Function, one of:
  112. ; SD_IOCTL_WR_Shrink_Cache
  113. ; SD_IOCTL_WR_Grow_Cache
  114. SD_I_W_GS_Size dw ? ; Count of 16k "pages" to
  115. ; grow or shrink cache by
  116. ; THIS IS A SIZE DELTA
  117. ; not a total size.
  118. SD_IOCTL_WR_GrwShrk ends
  119. ;
  120. ; WR_Set_INT_13
  121. ;
  122. SD_IOCTL_WR_SetI13 struc
  123. SD_I_W_FuncS13 db SD_IOCTL_WR_Set_INT_13
  124. SD_I_W_S13_Addr dd ? ; Segment:Offset address
  125. ; to set Original_INT13 to.
  126. ; NO RECORD IS KEPT OF PREV
  127. ; VALUE, caller's responsible
  128. ; for save and restore.
  129. SD_IOCTL_WR_SetI13 ends