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.

258 lines
7.6 KiB

  1. ;/*
  2. ;
  3. ; Copyright (c) 1989 Microsoft Corporation
  4. ;
  5. ; Module Name:
  6. ;
  7. ; spmp.inc
  8. ;
  9. ; Abstract:
  10. ;
  11. ; SystemPro MP include file
  12. ;
  13. ; Author:
  14. ;
  15. ;--
  16. if 0 ; */
  17. // ---------------------------------------------------
  18. // C section
  19. // ---------------------------------------------------
  20. #ifndef SPMPC_INCLUDE
  21. #define SPMPC_INCLUDE 1
  22. //
  23. // All Values in the C section must match with the assembly.
  24. //
  25. #define SMP_SYSPRO1 1 // Original SystemPro and Compatibles
  26. #define SMP_SYSPRO2 2 // SystemPro XL and ProLiant 2000,4000,4500
  27. #define SMP_ACER 3 // Acer SystemPro Style
  28. #define SP_M8259 1 // Each processor has 8259 set
  29. #define SP_SMPDEVINTS 2 // Distribute device ints amoung all processors
  30. #define SP_SMPCLOCK 4 // Clock is broadcast to each processor
  31. #define SECOND_IPI_DISPATCH 24 // Vector offset for second level ipi dispatch
  32. #endif
  33. /*
  34. endif
  35. ; ---------------------------------------------------
  36. ; Assembly section
  37. ; ---------------------------------------------------
  38. ;*****************************
  39. ; Compaq MP defines
  40. ;
  41. RESET_WO_EOI equ 00ah ; Reset with out EOI
  42. WarmResetVector equ 467h ; warm reset vector in ROM data segment
  43. ; Multi-Processor Control Register I/O Locations:
  44. PRODUCT_ID_OFFSET equ 0C80h
  45. EBC_OFFSET equ 0C84h
  46. PCR_OFFSET equ 0C6Ah
  47. PROC_ID_PORT equ 0c70h ; who am I
  48. ; Multi-Processor Control Register Bit Definitions:
  49. INTDIS equ 080h ; INTDIS bit in Processor control register
  50. PINT equ 040h ; PINT bit in Processor control register
  51. ERR387 equ 020h ; 387ERR bit in Processor control register
  52. FLUSH equ 010h ; flushes the processor's cache
  53. SLEEP equ 008h ; puts processor in HOLD
  54. CACHEON equ 004h ; enables cache
  55. PRES387 equ 002h ; 387PRES bit in Processor control register
  56. RESET equ 001h ; RESET processor
  57. ;*****************************
  58. ; end of list
  59. ;
  60. ; The kernel leaves some space (64 byte) of the PCR for the HAL to use
  61. ; as it needs. Currently this space is used for some efficiency in
  62. ; some of the MP specific code and is highly implementation
  63. ; dependant.
  64. ;
  65. PcrE struc
  66. PcrNumber db 0 ; Processor's number
  67. PcrPic db 0 ; 1 if processor has an 8259s
  68. PcrIpiClockTick db 0 ; Emulate a clock tick
  69. db 0 ; (alignment)
  70. PcrIpiType dd 0 ; How to handle different IPI implementations
  71. PcrIpiSecondLevelDispatch dd 0 ; To exit IPI interrupt
  72. PcrControlPort dw 0 ; Processor's control port
  73. PcrPerfSkew dd 0 ; Skew to apply to this P perf counter
  74. PcrE ends
  75. SECOND_IPI_DISPATCH equ 24 ; Vector offset for second level ipi dispatch
  76. SWClockTick equ 10h ; Software level of emulated clock tick
  77. SWCLOCK_LEVEL equ 4 ; Software level of emulated clock tick
  78. cr equ 0ah
  79. lf equ 0dh
  80. SMP_SYSPRO1 equ 1
  81. SMP_SYSPRO2 equ 2
  82. SMP_ACER equ 3
  83. ;
  84. ; 8259PerProcessorMode bit mask
  85. ;
  86. SP_M8259 equ 1 ; Each processor has 8259 set
  87. SP_SMPDEVINTS equ 2 ; Distribute device ints amoung all processors
  88. SP_SMPCLOCK equ 4 ; Clock is broadcast to each processor
  89. ;*****************************
  90. ; Compaq SMP defines
  91. ;
  92. ;+++EQU+++ Belize Specific defines (Symmetrical SystemProII).
  93. ;
  94. ; INT/MPx local registers, and their initial value. Registers are offseted
  95. ; by 2 (except INT13-INT14) and there is 15 registers (INT does not have one,
  96. ; it is used for cascade).
  97. ;
  98. TIME_DELAY equ 0ffffffh
  99. SMP_MAX_PROCESSORS equ 8 ;BELIZE/PHOENIX supports 8 cpus MAX
  100. SMP_MPINT0 equ 0cb0h
  101. SMP_MPINT1 equ 0cb2h
  102. ;SMP_MPINT2 **** DOESNOT EXIST ****
  103. SMP_MPINT3 equ 0cb4h
  104. SMP_MPINT4 equ 0cb6h
  105. SMP_MPINT5 equ 0cb8h
  106. SMP_MPINT6 equ 0cbah
  107. SMP_MPINT7 equ 0cbch
  108. SMP_MPINT8 equ 0cbeh
  109. SMP_MPINT9 equ 0cc0h
  110. SMP_MPINT10 equ 0cc2h
  111. SMP_MPINT11 equ 0cc4h
  112. SMP_MPINT12 equ 0cc6h
  113. SMP_MPINT13 equ 0cc8h
  114. SMP_MPINT14 equ 0ccch
  115. SMP_MPINT15 equ 0cceh
  116. SMP_IPI_MASKPORT equ 0cd0h ; IntrMask and IntrPort..DWORD
  117. SMP_IPI_PROG_INTRPORT equ 0cd3h ; IntrPort
  118. ; IRQ assigned to IPI_LEVEL. It could be any of the above IRQs.
  119. ;
  120. SMP_IPI_VECTOR equ 13 ; IRQ13 assigned to IPI
  121. SMP_IPI_MPINTx_PORT equ SMP_MPINT13 ; IRQ13
  122. ; SymmetricalMpMode registers (belize mode).
  123. ;
  124. SMP_MODE_PORT equ 0c67h ; Global: ModeSelectPort
  125. SMP_CSR_PORT equ 0c6ah ; Local: ControlStatusRegPort
  126. SMP_WHOAMI_PORT equ 0c70h ; Local: Whoami Port
  127. SMP_INDEX_PORT equ 0c74h ; Global: Index Port
  128. SMP_ASSIGNMENT_PORT equ 0c71h ; Global: cpu assignment port
  129. ; Supported Modes on Symmetrical SysPro ...
  130. ;
  131. SMP_ASYMMETRICAL_MODE equ 0 ; SysPro compatible mode
  132. SMP_SYMMETRICAL_MODE equ 1 shl 5 ; Belize mode
  133. ; PCR, ProcessorControl/StatusRegister Port bit pattern.
  134. ;
  135. SMP_CTRL_SLEEP equ 1 shl 0 ; 1: assert sleep to CPU
  136. SMP_CTRL_AWAKE equ 1 shl 1 ; 1: Awake processor
  137. SMP_CTRL_CACHEON equ 1 shl 2 ; 1: enable intr/extr cache
  138. SMP_CTRL_CACHEOFF equ 1 shl 3 ; 1: disable intr/extr cache
  139. SMP_CTRL_FLUSH equ 1 shl 4 ; 1: flush 486 secondary cache
  140. SMP_CTRL_RESET equ 1 shl 5 ; 1: reset CPU
  141. SMP_RESET_CPU equ (SMP_CTRL_RESET+SMP_CTRL_AWAKE+SMP_CTRL_CACHEON)
  142. SMP_STAT_NCPIN equ 1 shl 1 ; NCP installed, always 1
  143. SMP_STAT_CACHEON equ 1 shl 2 ; 0: in/ex cache off, 1: on
  144. SMP_STAT_SLEEP equ 1 shl 3 ; 0: awake, 1: Sleeping
  145. SMP_STAT_NCPERR equ 1 shl 5 ; 0: no NCP error, 1:NCP error
  146. SMP_INTx_SET_PINT equ 1 shl 0
  147. SMP_INTx_CLR_PINT equ 1 shl 1
  148. SMP_INTx_ENABLE equ 1 shl 2
  149. SMP_INTx_DISABLE equ 1 shl 3
  150. ;* MP INT13 Extended Control/Status Port...
  151. ;
  152. SMP_MPINT13PORT equ 0cc9h
  153. SMP_ENBL_NCPERR equ 1 shl 0
  154. SMP_DSBL_NCPERR equ 1 shl 1
  155. SMP_ENBL_DMACHAIN equ 1 shl 2
  156. SMP_DSBL_DMACHAIN equ 1 shl 3
  157. SMP_ENBL_MCERR equ 1 shl 4
  158. SMP_DSBL_MCERR equ 1 shl 5
  159. ;
  160. ; The following macro performs an indexed IO read to the specified
  161. ; IO address on the specified processor. The result of the read is
  162. ; placed in the 'al' register.
  163. ;
  164. ; Warning: Assumes 8254 lock is owned
  165. ;
  166. INDEXED_IO_READ macro cpu,ioaddress
  167. push edx
  168. push eax
  169. mov dx, SMP_INDEX_PORT
  170. mov al, cpu
  171. out dx, al ;select cpu
  172. inc dx
  173. mov ax, ioaddress
  174. out dx, ax ;select cpu's IO address to read from
  175. add dx, 2
  176. pop eax
  177. in al, dx ;read from the target cpu's IO address
  178. pop edx
  179. jmp $+2
  180. endm ;INDEXED_IO_READ
  181. ;
  182. ; The following macro performs an indexed IO write to the specified
  183. ; IO address on the specified processor.
  184. ;
  185. INDEXED_IO_WRITE macro cpu,ioaddress,data
  186. push edx
  187. push eax
  188. mov dx, SMP_INDEX_PORT
  189. mov al, data
  190. shl eax, 16
  191. mov ax, ioaddress
  192. shl eax, 8
  193. mov al, cpu
  194. out dx, eax
  195. pop eax
  196. pop edx
  197. jmp $+2
  198. endm ;INDEXED_IO_WRITE
  199. ;*/