Leaked source code of windows server 2003
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.

405 lines
8.6 KiB

  1. title "EISA bus Support Assembley Code"
  2. ;++
  3. ;
  4. ; Copyright (c) 1989 Microsoft Corporation
  5. ;
  6. ; Module Name:
  7. ;
  8. ; eisaa.asm
  9. ;
  10. ; Abstract:
  11. ;
  12. ; This module implements the assembley code necessary to get configuration
  13. ; information on EISA machines.
  14. ;
  15. ; Author:
  16. ;
  17. ; Shie-Lin Tzong (shielint) 7-June-1991
  18. ;
  19. ; Environment:
  20. ;
  21. ; Real Mode 16-bit code.
  22. ;
  23. ; Revision History:
  24. ;
  25. ;
  26. ;--
  27. .386p
  28. .xlist
  29. include hweisa.inc
  30. .list
  31. _DATA SEGMENT PARA USE16 PUBLIC 'DATA'
  32. public _FunctionInformation
  33. _FunctionInformation db 0
  34. db EISA_INFORMATION_BLOCK_LENGTH dup (0)
  35. _DATA ends
  36. _TEXT SEGMENT PARA USE16 PUBLIC 'CODE'
  37. ASSUME CS: _TEXT
  38. ;++
  39. ;
  40. ; VOID
  41. ; HwGetEisaSlotInformation (
  42. ; PBTEISA_SLOT_INFORMATION SlotInformation,
  43. ; UCHAR Slot
  44. ; )
  45. ;
  46. ; Routine Description:
  47. ;
  48. ; This function retrieves the slot information for the specified slot.
  49. ;
  50. ; Arguments:
  51. ;
  52. ; SlotInformation - Supplies a pointer to the structure which will
  53. ; receive the slot information.
  54. ;
  55. ; Slot - Specifies the slot to retrieve the information.
  56. ;
  57. ; Return Value:
  58. ;
  59. ; None.
  60. ;
  61. ;--
  62. HgesSlotInformation equ [bp + 4]
  63. HgesSlot equ [bp + 6]
  64. public _HwGetEisaSlotInformation
  65. _HwGetEisaSlotInformation proc
  66. push bp ; The following INT 15H destroies
  67. mov bp, sp ; ALL the general registers.
  68. push si
  69. push di
  70. push bx
  71. mov cl, HgesSlot
  72. mov ax, GET_EISA_SLOT_INFORMATION
  73. int 15h
  74. push bx ; Save revision level
  75. mov bx, HgesSlotInformation
  76. ;
  77. ; fill values into eisa slot info structure.
  78. ;
  79. mov [bx].SlotReturn, ah
  80. mov [bx].SlotFlags, al
  81. pop ax ; [ax] = revision level
  82. mov [bx].SlotMajorRevision, ah
  83. mov [bx].SlotMinorRevision, al
  84. mov [bx].SlotChecksum, cx
  85. mov [bx].SlotNumberFunctions, dh
  86. mov [bx].SlotFunctionInformation, dl
  87. mov word ptr [bx].SlotCompressedId, di
  88. mov word ptr [bx+2].SlotCompressedId, si
  89. pop bx
  90. pop di
  91. pop si
  92. pop bp
  93. ret
  94. _HwGetEisaSlotInformation endp
  95. ;++
  96. ;
  97. ; UCHAR
  98. ; HwGetEisaFunctionInformation (
  99. ; PBTEISA_FUNCTION_INFORMATION FunctionInformation,
  100. ; UCHAR Slot,
  101. ; UCHAR Function
  102. ; )
  103. ;
  104. ; Routine Description:
  105. ;
  106. ; This function retrieves function information for the specified slot
  107. ; and function.
  108. ;
  109. ; Arguments:
  110. ;
  111. ; FunctionInformation - Supplies a pointer to the structure which will
  112. ; receive the slot information.
  113. ;
  114. ; Slot - Specifies the slot to retrieve the information.
  115. ;
  116. ; Function - Supplies the function number of the desired slot.
  117. ;
  118. ; Return Value:
  119. ;
  120. ; Return code of the EISA function call.
  121. ;
  122. ;--
  123. HgefFunctionInformation equ [bp + 4]
  124. HgefSlot equ [bp + 6]
  125. HgefFunction equ [bp + 8]
  126. public _HwGetEisaFunctionInformation
  127. _HwGetEisaFunctionInformation proc
  128. push bp
  129. mov bp, sp
  130. push si
  131. mov ax, GET_EISA_FUNCTION_INFORMATION
  132. mov cl, HgefSlot ; [cl] = slot, [ch]=function
  133. mov ch, HgefFunction
  134. mov si, HgefFunctionInformation
  135. ; (ds:si)->Function information
  136. int 15h
  137. mov al, ah ; move the return code to AL
  138. pop si
  139. pop bp
  140. ret
  141. _HwGetEisaFunctionInformation endp
  142. ;++
  143. ;
  144. ; BOOLEAN
  145. ; HwIsEisaSystem (
  146. ; VOID
  147. ; )
  148. ;
  149. ; Routine Description:
  150. ;
  151. ; This function determines if the target machines is EISA based machines.
  152. ;
  153. ; Arguments:
  154. ;
  155. ; None.
  156. ;
  157. ; Return Value:
  158. ;
  159. ; TRUE - if this is EISA machine. Otherwise, a value of FALSE is returned.
  160. ;--
  161. public _HwIsEisaSystem
  162. _HwIsEisaSystem proc
  163. push es
  164. push bx
  165. ;
  166. ; Check for an EISA system. If "EISA" is at F000:FFD9h then it
  167. ; is an EISA system.
  168. ;
  169. mov ax,0f000h ; segment
  170. mov es,ax
  171. mov bx,0ffd9h ; offset in the ROM
  172. mov eax, "ASIE"
  173. cmp eax, es:[bx]
  174. jne short hies00 ; if ne, Not EISA system, go bies00
  175. mov ax, 1 ; set return value to TRUE
  176. jmp short hies10
  177. hies00:
  178. mov ax, 0
  179. hies10:
  180. pop bx
  181. pop es
  182. ret
  183. _HwIsEisaSystem endp
  184. ;++
  185. ;
  186. ; VOID
  187. ; Int15 (
  188. ; PULONG eax,
  189. ; PULONG ebx,
  190. ; PULONG ecx,
  191. ; PULONG edx,
  192. ; PULONG CyFlag
  193. ; )
  194. ;
  195. ; Routine Description:
  196. ;
  197. ; Calls Int15 with the requesed registers and returns the result
  198. ;
  199. ;--
  200. public _Int15
  201. _Int15 proc
  202. push bp
  203. mov bp, sp
  204. push esi
  205. push edi
  206. push ebx
  207. mov si, [bp+4] ; pointer to eax
  208. mov eax, [si]
  209. mov si, [bp+6] ; pointer to ebx
  210. mov ebx, [si]
  211. mov si, [bp+8] ; pointer to ecx
  212. mov ecx, [si]
  213. mov si, [bp+10] ; pointer to edx
  214. mov edx, [si]
  215. int 15h ; do it
  216. mov si, [bp+4] ; pointer to eax
  217. mov [si], eax
  218. mov si, [bp+6] ; pointer to ebx
  219. mov [si], ebx
  220. mov si, [bp+8] ; pointer to ecx
  221. mov [si], ecx
  222. mov si, [bp+10] ; pointer to edx
  223. mov [si], edx
  224. sbb eax, eax
  225. mov si, [bp+12] ; pointer CyFlag
  226. mov [si], eax
  227. pop ebx
  228. pop edi
  229. pop esi
  230. pop bp
  231. ret
  232. _Int15 endp
  233. ;++
  234. ;
  235. ; BOOLEAN
  236. ; Int15E820 (
  237. ; E820Frame *Frame
  238. ; );
  239. ;
  240. ;
  241. ; Description:
  242. ;
  243. ; Gets address range descriptor by calling int 15 function E820h.
  244. ;
  245. ; Arguments:
  246. ;
  247. ; Returns:
  248. ;
  249. ; BOOLEAN - failed or succeed.
  250. ;
  251. ;--
  252. cmdpFrame equ [bp + 6]
  253. public _Int15E820
  254. _Int15E820 proc near
  255. push ebp
  256. mov bp, sp
  257. mov bp, cmdpFrame ; (bp) = Frame
  258. push es
  259. push edi
  260. push esi
  261. push ebx
  262. push ss
  263. pop es
  264. mov ebx, [bp].Key
  265. mov ecx, [bp].DescSize
  266. lea di, [bp].BaseAddrLow
  267. mov eax, 0E820h
  268. mov edx, 'SMAP' ; (edx) = signature
  269. INT 15h
  270. mov [bp].Key, ebx ; update callers ebx
  271. mov [bp].DescSize, ecx ; update callers size
  272. sbb ecx, ecx ; ecx = -1 if carry, else 0
  273. sub eax, 'SMAP' ; eax = 0 if signature matched
  274. or ecx, eax
  275. mov [bp].ErrorFlag, ecx ; return 0 or non-zero
  276. pop ebx
  277. pop esi
  278. pop edi
  279. pop es
  280. pop ebp
  281. ret
  282. _Int15E820 endp
  283. ;++
  284. ;
  285. ; BOOLEAN
  286. ; Int15E980 (
  287. ; E820Frame *Frame
  288. ; );
  289. ;
  290. ;
  291. ; Description:
  292. ;
  293. ; Gets Geyserville information by calling INT 15 E980h
  294. ;
  295. ; Arguments:
  296. ;
  297. ; Returns:
  298. ;
  299. ; BOOLEAN - failed or succeed.
  300. ;
  301. ;--
  302. cmdpFrame equ [bp + 6]
  303. public _Int15E980
  304. _Int15E980 proc near
  305. push ebp
  306. mov bp, sp
  307. mov bp, cmdpFrame ; (bp) = Frame
  308. push es
  309. push edi
  310. push esi
  311. push ebx
  312. push ss
  313. pop es
  314. mov eax, 0E980h
  315. mov edx, 47534943h ; (edx) = signature 'GSIC'
  316. INT 15h
  317. sbb eax, eax ; eax = -1 if carry, else 0
  318. not eax
  319. ;
  320. ; Pass back the information that the caller wanted
  321. ;
  322. mov [bp].CommandPortAddress, bx
  323. shr ebx, 16
  324. mov [bp].CommandDataValue, bl
  325. mov [bp].EventPortAddress, cx
  326. shr ecx, 16
  327. mov [bp].EventPortBitmask, cl
  328. mov [bp].MaxLevelAc, dh
  329. mov [bp].MaxLevelDc, dl
  330. shr edx, 16
  331. mov [bp].PollInterval, dx
  332. pop ebx
  333. pop esi
  334. pop edi
  335. pop es
  336. pop ebp
  337. ret
  338. _Int15E980 endp
  339. _TEXT ends
  340. end