head_32.S 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  1. /*
  2. * head.S: The initial boot code for the Sparc port of Linux.
  3. *
  4. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  5. * Copyright (C) 1995,1999 Pete Zaitcev (zaitcev@yahoo.com)
  6. * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
  7. * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  8. * Copyright (C) 1997 Michael A. Griffith (grif@acm.org)
  9. *
  10. * CompactPCI platform by Eric Brower, 1999.
  11. */
  12. #include <linux/version.h>
  13. #include <linux/init.h>
  14. #include <asm/head.h>
  15. #include <asm/asi.h>
  16. #include <asm/contregs.h>
  17. #include <asm/ptrace.h>
  18. #include <asm/psr.h>
  19. #include <asm/page.h>
  20. #include <asm/kdebug.h>
  21. #include <asm/winmacro.h>
  22. #include <asm/thread_info.h> /* TI_UWINMASK */
  23. #include <asm/errno.h>
  24. #include <asm/pgtsrmmu.h> /* SRMMU_PGDIR_SHIFT */
  25. .data
  26. /* The following are used with the prom_vector node-ops to figure out
  27. * the cpu-type
  28. */
  29. .align 4
  30. cputyp:
  31. .word 1
  32. .align 4
  33. .globl cputypval
  34. cputypval:
  35. .asciz "sun4m"
  36. .ascii " "
  37. /* Tested on SS-5, SS-10 */
  38. .align 4
  39. cputypvar:
  40. .asciz "compatible"
  41. .align 4
  42. sun4c_notsup:
  43. .asciz "Sparc-Linux sun4/sun4c support does no longer exist.\n\n"
  44. .align 4
  45. sun4e_notsup:
  46. .asciz "Sparc-Linux sun4e support does not exist\n\n"
  47. .align 4
  48. /* The Sparc trap table, bootloader gives us control at _start. */
  49. __HEAD
  50. .globl _stext, _start, __stext
  51. .globl trapbase
  52. _start: /* danger danger */
  53. __stext:
  54. _stext:
  55. trapbase:
  56. #ifdef CONFIG_SMP
  57. trapbase_cpu0:
  58. #endif
  59. /* We get control passed to us here at t_zero. */
  60. t_zero: b gokernel; nop; nop; nop;
  61. t_tflt: SRMMU_TFAULT /* Inst. Access Exception */
  62. t_bins: TRAP_ENTRY(0x2, bad_instruction) /* Illegal Instruction */
  63. t_pins: TRAP_ENTRY(0x3, priv_instruction) /* Privileged Instruction */
  64. t_fpd: TRAP_ENTRY(0x4, fpd_trap_handler) /* Floating Point Disabled */
  65. t_wovf: WINDOW_SPILL /* Window Overflow */
  66. t_wunf: WINDOW_FILL /* Window Underflow */
  67. t_mna: TRAP_ENTRY(0x7, mna_handler) /* Memory Address Not Aligned */
  68. t_fpe: TRAP_ENTRY(0x8, fpe_trap_handler) /* Floating Point Exception */
  69. t_dflt: SRMMU_DFAULT /* Data Miss Exception */
  70. t_tio: TRAP_ENTRY(0xa, do_tag_overflow) /* Tagged Instruction Ovrflw */
  71. t_wpt: TRAP_ENTRY(0xb, do_watchpoint) /* Watchpoint Detected */
  72. t_badc: BAD_TRAP(0xc) BAD_TRAP(0xd) BAD_TRAP(0xe) BAD_TRAP(0xf) BAD_TRAP(0x10)
  73. t_irq1: TRAP_ENTRY_INTERRUPT(1) /* IRQ Software/SBUS Level 1 */
  74. t_irq2: TRAP_ENTRY_INTERRUPT(2) /* IRQ SBUS Level 2 */
  75. t_irq3: TRAP_ENTRY_INTERRUPT(3) /* IRQ SCSI/DMA/SBUS Level 3 */
  76. t_irq4: TRAP_ENTRY_INTERRUPT(4) /* IRQ Software Level 4 */
  77. t_irq5: TRAP_ENTRY_INTERRUPT(5) /* IRQ SBUS/Ethernet Level 5 */
  78. t_irq6: TRAP_ENTRY_INTERRUPT(6) /* IRQ Software Level 6 */
  79. t_irq7: TRAP_ENTRY_INTERRUPT(7) /* IRQ Video/SBUS Level 5 */
  80. t_irq8: TRAP_ENTRY_INTERRUPT(8) /* IRQ SBUS Level 6 */
  81. t_irq9: TRAP_ENTRY_INTERRUPT(9) /* IRQ SBUS Level 7 */
  82. t_irq10:TRAP_ENTRY_INTERRUPT(10) /* IRQ Timer #1 (one we use) */
  83. t_irq11:TRAP_ENTRY_INTERRUPT(11) /* IRQ Floppy Intr. */
  84. t_irq12:TRAP_ENTRY_INTERRUPT(12) /* IRQ Zilog serial chip */
  85. t_irq13:TRAP_ENTRY_INTERRUPT(13) /* IRQ Audio Intr. */
  86. t_irq14:TRAP_ENTRY_INTERRUPT(14) /* IRQ Timer #2 */
  87. .globl t_nmi
  88. t_nmi: TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
  89. t_racc: TRAP_ENTRY(0x20, do_reg_access) /* General Register Access Error */
  90. t_iacce:BAD_TRAP(0x21) /* Instr Access Error */
  91. t_bad22:BAD_TRAP(0x22) BAD_TRAP(0x23)
  92. t_cpdis:TRAP_ENTRY(0x24, do_cp_disabled) /* Co-Processor Disabled */
  93. t_uflsh:SKIP_TRAP(0x25, unimp_flush) /* Unimplemented FLUSH inst. */
  94. t_bad26:BAD_TRAP(0x26) BAD_TRAP(0x27)
  95. t_cpexc:TRAP_ENTRY(0x28, do_cp_exception) /* Co-Processor Exception */
  96. t_dacce:SRMMU_DFAULT /* Data Access Error */
  97. t_hwdz: TRAP_ENTRY(0x2a, do_hw_divzero) /* Division by zero, you lose... */
  98. t_dserr:BAD_TRAP(0x2b) /* Data Store Error */
  99. t_daccm:BAD_TRAP(0x2c) /* Data Access MMU-Miss */
  100. t_bad2d:BAD_TRAP(0x2d) BAD_TRAP(0x2e) BAD_TRAP(0x2f) BAD_TRAP(0x30) BAD_TRAP(0x31)
  101. t_bad32:BAD_TRAP(0x32) BAD_TRAP(0x33) BAD_TRAP(0x34) BAD_TRAP(0x35) BAD_TRAP(0x36)
  102. t_bad37:BAD_TRAP(0x37) BAD_TRAP(0x38) BAD_TRAP(0x39) BAD_TRAP(0x3a) BAD_TRAP(0x3b)
  103. t_iaccm:BAD_TRAP(0x3c) /* Instr Access MMU-Miss */
  104. t_bad3d:BAD_TRAP(0x3d) BAD_TRAP(0x3e) BAD_TRAP(0x3f) BAD_TRAP(0x40) BAD_TRAP(0x41)
  105. t_bad42:BAD_TRAP(0x42) BAD_TRAP(0x43) BAD_TRAP(0x44) BAD_TRAP(0x45) BAD_TRAP(0x46)
  106. t_bad47:BAD_TRAP(0x47) BAD_TRAP(0x48) BAD_TRAP(0x49) BAD_TRAP(0x4a) BAD_TRAP(0x4b)
  107. t_bad4c:BAD_TRAP(0x4c) BAD_TRAP(0x4d) BAD_TRAP(0x4e) BAD_TRAP(0x4f) BAD_TRAP(0x50)
  108. t_bad51:BAD_TRAP(0x51) BAD_TRAP(0x52) BAD_TRAP(0x53) BAD_TRAP(0x54) BAD_TRAP(0x55)
  109. t_bad56:BAD_TRAP(0x56) BAD_TRAP(0x57) BAD_TRAP(0x58) BAD_TRAP(0x59) BAD_TRAP(0x5a)
  110. t_bad5b:BAD_TRAP(0x5b) BAD_TRAP(0x5c) BAD_TRAP(0x5d) BAD_TRAP(0x5e) BAD_TRAP(0x5f)
  111. t_bad60:BAD_TRAP(0x60) BAD_TRAP(0x61) BAD_TRAP(0x62) BAD_TRAP(0x63) BAD_TRAP(0x64)
  112. t_bad65:BAD_TRAP(0x65) BAD_TRAP(0x66) BAD_TRAP(0x67) BAD_TRAP(0x68) BAD_TRAP(0x69)
  113. t_bad6a:BAD_TRAP(0x6a) BAD_TRAP(0x6b) BAD_TRAP(0x6c) BAD_TRAP(0x6d) BAD_TRAP(0x6e)
  114. t_bad6f:BAD_TRAP(0x6f) BAD_TRAP(0x70) BAD_TRAP(0x71) BAD_TRAP(0x72) BAD_TRAP(0x73)
  115. t_bad74:BAD_TRAP(0x74) BAD_TRAP(0x75) BAD_TRAP(0x76) BAD_TRAP(0x77) BAD_TRAP(0x78)
  116. t_bad79:BAD_TRAP(0x79) BAD_TRAP(0x7a) BAD_TRAP(0x7b) BAD_TRAP(0x7c) BAD_TRAP(0x7d)
  117. t_bad7e:BAD_TRAP(0x7e) BAD_TRAP(0x7f)
  118. t_bad80:BAD_TRAP(0x80) /* SunOS System Call */
  119. t_sbkpt:BREAKPOINT_TRAP /* Software Breakpoint/KGDB */
  120. t_divz: TRAP_ENTRY(0x82, do_hw_divzero) /* Divide by zero trap */
  121. t_flwin:TRAP_ENTRY(0x83, do_flush_windows) /* Flush Windows Trap */
  122. t_clwin:BAD_TRAP(0x84) /* Clean Windows Trap */
  123. t_rchk: BAD_TRAP(0x85) /* Range Check */
  124. t_funal:BAD_TRAP(0x86) /* Fix Unaligned Access Trap */
  125. t_iovf: BAD_TRAP(0x87) /* Integer Overflow Trap */
  126. t_bad88:BAD_TRAP(0x88) /* Slowaris System Call */
  127. t_bad89:BAD_TRAP(0x89) /* Net-B.S. System Call */
  128. t_bad8a:BAD_TRAP(0x8a) BAD_TRAP(0x8b) BAD_TRAP(0x8c) BAD_TRAP(0x8d) BAD_TRAP(0x8e)
  129. t_bad8f:BAD_TRAP(0x8f)
  130. t_linux:LINUX_SYSCALL_TRAP /* Linux System Call */
  131. t_bad91:BAD_TRAP(0x91) BAD_TRAP(0x92) BAD_TRAP(0x93) BAD_TRAP(0x94) BAD_TRAP(0x95)
  132. t_bad96:BAD_TRAP(0x96) BAD_TRAP(0x97) BAD_TRAP(0x98) BAD_TRAP(0x99) BAD_TRAP(0x9a)
  133. t_bad9b:BAD_TRAP(0x9b) BAD_TRAP(0x9c) BAD_TRAP(0x9d) BAD_TRAP(0x9e) BAD_TRAP(0x9f)
  134. t_getcc:GETCC_TRAP /* Get Condition Codes */
  135. t_setcc:SETCC_TRAP /* Set Condition Codes */
  136. t_getpsr:GETPSR_TRAP /* Get PSR Register */
  137. t_bada3:BAD_TRAP(0xa3) BAD_TRAP(0xa4) BAD_TRAP(0xa5) BAD_TRAP(0xa6)
  138. t_bada7:BAD_TRAP(0xa7)
  139. t_bada8:BAD_TRAP(0xa8) BAD_TRAP(0xa9) BAD_TRAP(0xaa) BAD_TRAP(0xab)
  140. t_badac:BAD_TRAP(0xac) BAD_TRAP(0xad) BAD_TRAP(0xae) BAD_TRAP(0xaf) BAD_TRAP(0xb0)
  141. t_badb1:BAD_TRAP(0xb1) BAD_TRAP(0xb2) BAD_TRAP(0xb3) BAD_TRAP(0xb4) BAD_TRAP(0xb5)
  142. t_badb6:BAD_TRAP(0xb6) BAD_TRAP(0xb7) BAD_TRAP(0xb8) BAD_TRAP(0xb9) BAD_TRAP(0xba)
  143. t_badbb:BAD_TRAP(0xbb) BAD_TRAP(0xbc) BAD_TRAP(0xbd) BAD_TRAP(0xbe) BAD_TRAP(0xbf)
  144. t_badc0:BAD_TRAP(0xc0) BAD_TRAP(0xc1) BAD_TRAP(0xc2) BAD_TRAP(0xc3) BAD_TRAP(0xc4)
  145. t_badc5:BAD_TRAP(0xc5) BAD_TRAP(0xc6) BAD_TRAP(0xc7) BAD_TRAP(0xc8) BAD_TRAP(0xc9)
  146. t_badca:BAD_TRAP(0xca) BAD_TRAP(0xcb) BAD_TRAP(0xcc) BAD_TRAP(0xcd) BAD_TRAP(0xce)
  147. t_badcf:BAD_TRAP(0xcf) BAD_TRAP(0xd0) BAD_TRAP(0xd1) BAD_TRAP(0xd2) BAD_TRAP(0xd3)
  148. t_badd4:BAD_TRAP(0xd4) BAD_TRAP(0xd5) BAD_TRAP(0xd6) BAD_TRAP(0xd7) BAD_TRAP(0xd8)
  149. t_badd9:BAD_TRAP(0xd9) BAD_TRAP(0xda) BAD_TRAP(0xdb) BAD_TRAP(0xdc) BAD_TRAP(0xdd)
  150. t_badde:BAD_TRAP(0xde) BAD_TRAP(0xdf) BAD_TRAP(0xe0) BAD_TRAP(0xe1) BAD_TRAP(0xe2)
  151. t_bade3:BAD_TRAP(0xe3) BAD_TRAP(0xe4) BAD_TRAP(0xe5) BAD_TRAP(0xe6) BAD_TRAP(0xe7)
  152. t_bade8:BAD_TRAP(0xe8) BAD_TRAP(0xe9) BAD_TRAP(0xea) BAD_TRAP(0xeb) BAD_TRAP(0xec)
  153. t_baded:BAD_TRAP(0xed) BAD_TRAP(0xee) BAD_TRAP(0xef) BAD_TRAP(0xf0) BAD_TRAP(0xf1)
  154. t_badf2:BAD_TRAP(0xf2) BAD_TRAP(0xf3) BAD_TRAP(0xf4) BAD_TRAP(0xf5) BAD_TRAP(0xf6)
  155. t_badf7:BAD_TRAP(0xf7) BAD_TRAP(0xf8) BAD_TRAP(0xf9) BAD_TRAP(0xfa) BAD_TRAP(0xfb)
  156. t_badfc:BAD_TRAP(0xfc)
  157. t_kgdb: KGDB_TRAP(0xfd)
  158. dbtrap: BAD_TRAP(0xfe) /* Debugger/PROM breakpoint #1 */
  159. dbtrap2:BAD_TRAP(0xff) /* Debugger/PROM breakpoint #2 */
  160. .globl end_traptable
  161. end_traptable:
  162. #ifdef CONFIG_SMP
  163. /* Trap tables for the other cpus. */
  164. .globl trapbase_cpu1, trapbase_cpu2, trapbase_cpu3
  165. trapbase_cpu1:
  166. BAD_TRAP(0x0) SRMMU_TFAULT TRAP_ENTRY(0x2, bad_instruction)
  167. TRAP_ENTRY(0x3, priv_instruction) TRAP_ENTRY(0x4, fpd_trap_handler)
  168. WINDOW_SPILL WINDOW_FILL TRAP_ENTRY(0x7, mna_handler)
  169. TRAP_ENTRY(0x8, fpe_trap_handler) SRMMU_DFAULT
  170. TRAP_ENTRY(0xa, do_tag_overflow) TRAP_ENTRY(0xb, do_watchpoint)
  171. BAD_TRAP(0xc) BAD_TRAP(0xd) BAD_TRAP(0xe) BAD_TRAP(0xf) BAD_TRAP(0x10)
  172. TRAP_ENTRY_INTERRUPT(1) TRAP_ENTRY_INTERRUPT(2)
  173. TRAP_ENTRY_INTERRUPT(3) TRAP_ENTRY_INTERRUPT(4)
  174. TRAP_ENTRY_INTERRUPT(5) TRAP_ENTRY_INTERRUPT(6)
  175. TRAP_ENTRY_INTERRUPT(7) TRAP_ENTRY_INTERRUPT(8)
  176. TRAP_ENTRY_INTERRUPT(9) TRAP_ENTRY_INTERRUPT(10)
  177. TRAP_ENTRY_INTERRUPT(11) TRAP_ENTRY_INTERRUPT(12)
  178. TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14)
  179. TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
  180. TRAP_ENTRY(0x20, do_reg_access) BAD_TRAP(0x21) BAD_TRAP(0x22)
  181. BAD_TRAP(0x23) TRAP_ENTRY(0x24, do_cp_disabled) SKIP_TRAP(0x25, unimp_flush)
  182. BAD_TRAP(0x26) BAD_TRAP(0x27) TRAP_ENTRY(0x28, do_cp_exception)
  183. SRMMU_DFAULT TRAP_ENTRY(0x2a, do_hw_divzero) BAD_TRAP(0x2b) BAD_TRAP(0x2c)
  184. BAD_TRAP(0x2d) BAD_TRAP(0x2e) BAD_TRAP(0x2f) BAD_TRAP(0x30) BAD_TRAP(0x31)
  185. BAD_TRAP(0x32) BAD_TRAP(0x33) BAD_TRAP(0x34) BAD_TRAP(0x35) BAD_TRAP(0x36)
  186. BAD_TRAP(0x37) BAD_TRAP(0x38) BAD_TRAP(0x39) BAD_TRAP(0x3a) BAD_TRAP(0x3b)
  187. BAD_TRAP(0x3c) BAD_TRAP(0x3d) BAD_TRAP(0x3e) BAD_TRAP(0x3f) BAD_TRAP(0x40)
  188. BAD_TRAP(0x41) BAD_TRAP(0x42) BAD_TRAP(0x43) BAD_TRAP(0x44) BAD_TRAP(0x45)
  189. BAD_TRAP(0x46) BAD_TRAP(0x47) BAD_TRAP(0x48) BAD_TRAP(0x49) BAD_TRAP(0x4a)
  190. BAD_TRAP(0x4b) BAD_TRAP(0x4c) BAD_TRAP(0x4d) BAD_TRAP(0x4e) BAD_TRAP(0x4f)
  191. BAD_TRAP(0x50)
  192. BAD_TRAP(0x51) BAD_TRAP(0x52) BAD_TRAP(0x53) BAD_TRAP(0x54) BAD_TRAP(0x55)
  193. BAD_TRAP(0x56) BAD_TRAP(0x57) BAD_TRAP(0x58) BAD_TRAP(0x59) BAD_TRAP(0x5a)
  194. BAD_TRAP(0x5b) BAD_TRAP(0x5c) BAD_TRAP(0x5d) BAD_TRAP(0x5e) BAD_TRAP(0x5f)
  195. BAD_TRAP(0x60) BAD_TRAP(0x61) BAD_TRAP(0x62) BAD_TRAP(0x63) BAD_TRAP(0x64)
  196. BAD_TRAP(0x65) BAD_TRAP(0x66) BAD_TRAP(0x67) BAD_TRAP(0x68) BAD_TRAP(0x69)
  197. BAD_TRAP(0x6a) BAD_TRAP(0x6b) BAD_TRAP(0x6c) BAD_TRAP(0x6d) BAD_TRAP(0x6e)
  198. BAD_TRAP(0x6f) BAD_TRAP(0x70) BAD_TRAP(0x71) BAD_TRAP(0x72) BAD_TRAP(0x73)
  199. BAD_TRAP(0x74) BAD_TRAP(0x75) BAD_TRAP(0x76) BAD_TRAP(0x77) BAD_TRAP(0x78)
  200. BAD_TRAP(0x79) BAD_TRAP(0x7a) BAD_TRAP(0x7b) BAD_TRAP(0x7c) BAD_TRAP(0x7d)
  201. BAD_TRAP(0x7e) BAD_TRAP(0x7f)
  202. BAD_TRAP(0x80)
  203. BREAKPOINT_TRAP
  204. TRAP_ENTRY(0x82, do_hw_divzero)
  205. TRAP_ENTRY(0x83, do_flush_windows) BAD_TRAP(0x84) BAD_TRAP(0x85)
  206. BAD_TRAP(0x86) BAD_TRAP(0x87) BAD_TRAP(0x88)
  207. BAD_TRAP(0x89) BAD_TRAP(0x8a) BAD_TRAP(0x8b) BAD_TRAP(0x8c)
  208. BAD_TRAP(0x8d) BAD_TRAP(0x8e) BAD_TRAP(0x8f)
  209. LINUX_SYSCALL_TRAP BAD_TRAP(0x91) BAD_TRAP(0x92) BAD_TRAP(0x93) BAD_TRAP(0x94)
  210. BAD_TRAP(0x95) BAD_TRAP(0x96) BAD_TRAP(0x97) BAD_TRAP(0x98) BAD_TRAP(0x99)
  211. BAD_TRAP(0x9a) BAD_TRAP(0x9b) BAD_TRAP(0x9c) BAD_TRAP(0x9d) BAD_TRAP(0x9e)
  212. BAD_TRAP(0x9f) GETCC_TRAP SETCC_TRAP GETPSR_TRAP
  213. BAD_TRAP(0xa3) BAD_TRAP(0xa4) BAD_TRAP(0xa5) BAD_TRAP(0xa6)
  214. BAD_TRAP(0xa7) BAD_TRAP(0xa8) BAD_TRAP(0xa9) BAD_TRAP(0xaa) BAD_TRAP(0xab)
  215. BAD_TRAP(0xac) BAD_TRAP(0xad) BAD_TRAP(0xae) BAD_TRAP(0xaf) BAD_TRAP(0xb0)
  216. BAD_TRAP(0xb1) BAD_TRAP(0xb2) BAD_TRAP(0xb3) BAD_TRAP(0xb4) BAD_TRAP(0xb5)
  217. BAD_TRAP(0xb6) BAD_TRAP(0xb7) BAD_TRAP(0xb8) BAD_TRAP(0xb9) BAD_TRAP(0xba)
  218. BAD_TRAP(0xbb) BAD_TRAP(0xbc) BAD_TRAP(0xbd) BAD_TRAP(0xbe) BAD_TRAP(0xbf)
  219. BAD_TRAP(0xc0) BAD_TRAP(0xc1) BAD_TRAP(0xc2) BAD_TRAP(0xc3) BAD_TRAP(0xc4)
  220. BAD_TRAP(0xc5) BAD_TRAP(0xc6) BAD_TRAP(0xc7) BAD_TRAP(0xc8) BAD_TRAP(0xc9)
  221. BAD_TRAP(0xca) BAD_TRAP(0xcb) BAD_TRAP(0xcc) BAD_TRAP(0xcd) BAD_TRAP(0xce)
  222. BAD_TRAP(0xcf) BAD_TRAP(0xd0) BAD_TRAP(0xd1) BAD_TRAP(0xd2) BAD_TRAP(0xd3)
  223. BAD_TRAP(0xd4) BAD_TRAP(0xd5) BAD_TRAP(0xd6) BAD_TRAP(0xd7) BAD_TRAP(0xd8)
  224. BAD_TRAP(0xd9) BAD_TRAP(0xda) BAD_TRAP(0xdb) BAD_TRAP(0xdc) BAD_TRAP(0xdd)
  225. BAD_TRAP(0xde) BAD_TRAP(0xdf) BAD_TRAP(0xe0) BAD_TRAP(0xe1) BAD_TRAP(0xe2)
  226. BAD_TRAP(0xe3) BAD_TRAP(0xe4) BAD_TRAP(0xe5) BAD_TRAP(0xe6) BAD_TRAP(0xe7)
  227. BAD_TRAP(0xe8) BAD_TRAP(0xe9) BAD_TRAP(0xea) BAD_TRAP(0xeb) BAD_TRAP(0xec)
  228. BAD_TRAP(0xed) BAD_TRAP(0xee) BAD_TRAP(0xef) BAD_TRAP(0xf0) BAD_TRAP(0xf1)
  229. BAD_TRAP(0xf2) BAD_TRAP(0xf3) BAD_TRAP(0xf4) BAD_TRAP(0xf5) BAD_TRAP(0xf6)
  230. BAD_TRAP(0xf7) BAD_TRAP(0xf8) BAD_TRAP(0xf9) BAD_TRAP(0xfa) BAD_TRAP(0xfb)
  231. BAD_TRAP(0xfc) KGDB_TRAP(0xfd) BAD_TRAP(0xfe) BAD_TRAP(0xff)
  232. trapbase_cpu2:
  233. BAD_TRAP(0x0) SRMMU_TFAULT TRAP_ENTRY(0x2, bad_instruction)
  234. TRAP_ENTRY(0x3, priv_instruction) TRAP_ENTRY(0x4, fpd_trap_handler)
  235. WINDOW_SPILL WINDOW_FILL TRAP_ENTRY(0x7, mna_handler)
  236. TRAP_ENTRY(0x8, fpe_trap_handler) SRMMU_DFAULT
  237. TRAP_ENTRY(0xa, do_tag_overflow) TRAP_ENTRY(0xb, do_watchpoint)
  238. BAD_TRAP(0xc) BAD_TRAP(0xd) BAD_TRAP(0xe) BAD_TRAP(0xf) BAD_TRAP(0x10)
  239. TRAP_ENTRY_INTERRUPT(1) TRAP_ENTRY_INTERRUPT(2)
  240. TRAP_ENTRY_INTERRUPT(3) TRAP_ENTRY_INTERRUPT(4)
  241. TRAP_ENTRY_INTERRUPT(5) TRAP_ENTRY_INTERRUPT(6)
  242. TRAP_ENTRY_INTERRUPT(7) TRAP_ENTRY_INTERRUPT(8)
  243. TRAP_ENTRY_INTERRUPT(9) TRAP_ENTRY_INTERRUPT(10)
  244. TRAP_ENTRY_INTERRUPT(11) TRAP_ENTRY_INTERRUPT(12)
  245. TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14)
  246. TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
  247. TRAP_ENTRY(0x20, do_reg_access) BAD_TRAP(0x21) BAD_TRAP(0x22)
  248. BAD_TRAP(0x23) TRAP_ENTRY(0x24, do_cp_disabled) SKIP_TRAP(0x25, unimp_flush)
  249. BAD_TRAP(0x26) BAD_TRAP(0x27) TRAP_ENTRY(0x28, do_cp_exception)
  250. SRMMU_DFAULT TRAP_ENTRY(0x2a, do_hw_divzero) BAD_TRAP(0x2b) BAD_TRAP(0x2c)
  251. BAD_TRAP(0x2d) BAD_TRAP(0x2e) BAD_TRAP(0x2f) BAD_TRAP(0x30) BAD_TRAP(0x31)
  252. BAD_TRAP(0x32) BAD_TRAP(0x33) BAD_TRAP(0x34) BAD_TRAP(0x35) BAD_TRAP(0x36)
  253. BAD_TRAP(0x37) BAD_TRAP(0x38) BAD_TRAP(0x39) BAD_TRAP(0x3a) BAD_TRAP(0x3b)
  254. BAD_TRAP(0x3c) BAD_TRAP(0x3d) BAD_TRAP(0x3e) BAD_TRAP(0x3f) BAD_TRAP(0x40)
  255. BAD_TRAP(0x41) BAD_TRAP(0x42) BAD_TRAP(0x43) BAD_TRAP(0x44) BAD_TRAP(0x45)
  256. BAD_TRAP(0x46) BAD_TRAP(0x47) BAD_TRAP(0x48) BAD_TRAP(0x49) BAD_TRAP(0x4a)
  257. BAD_TRAP(0x4b) BAD_TRAP(0x4c) BAD_TRAP(0x4d) BAD_TRAP(0x4e) BAD_TRAP(0x4f)
  258. BAD_TRAP(0x50)
  259. BAD_TRAP(0x51) BAD_TRAP(0x52) BAD_TRAP(0x53) BAD_TRAP(0x54) BAD_TRAP(0x55)
  260. BAD_TRAP(0x56) BAD_TRAP(0x57) BAD_TRAP(0x58) BAD_TRAP(0x59) BAD_TRAP(0x5a)
  261. BAD_TRAP(0x5b) BAD_TRAP(0x5c) BAD_TRAP(0x5d) BAD_TRAP(0x5e) BAD_TRAP(0x5f)
  262. BAD_TRAP(0x60) BAD_TRAP(0x61) BAD_TRAP(0x62) BAD_TRAP(0x63) BAD_TRAP(0x64)
  263. BAD_TRAP(0x65) BAD_TRAP(0x66) BAD_TRAP(0x67) BAD_TRAP(0x68) BAD_TRAP(0x69)
  264. BAD_TRAP(0x6a) BAD_TRAP(0x6b) BAD_TRAP(0x6c) BAD_TRAP(0x6d) BAD_TRAP(0x6e)
  265. BAD_TRAP(0x6f) BAD_TRAP(0x70) BAD_TRAP(0x71) BAD_TRAP(0x72) BAD_TRAP(0x73)
  266. BAD_TRAP(0x74) BAD_TRAP(0x75) BAD_TRAP(0x76) BAD_TRAP(0x77) BAD_TRAP(0x78)
  267. BAD_TRAP(0x79) BAD_TRAP(0x7a) BAD_TRAP(0x7b) BAD_TRAP(0x7c) BAD_TRAP(0x7d)
  268. BAD_TRAP(0x7e) BAD_TRAP(0x7f)
  269. BAD_TRAP(0x80)
  270. BREAKPOINT_TRAP
  271. TRAP_ENTRY(0x82, do_hw_divzero)
  272. TRAP_ENTRY(0x83, do_flush_windows) BAD_TRAP(0x84) BAD_TRAP(0x85)
  273. BAD_TRAP(0x86) BAD_TRAP(0x87) BAD_TRAP(0x88)
  274. BAD_TRAP(0x89) BAD_TRAP(0x8a) BAD_TRAP(0x8b) BAD_TRAP(0x8c)
  275. BAD_TRAP(0x8d) BAD_TRAP(0x8e) BAD_TRAP(0x8f)
  276. LINUX_SYSCALL_TRAP BAD_TRAP(0x91) BAD_TRAP(0x92) BAD_TRAP(0x93) BAD_TRAP(0x94)
  277. BAD_TRAP(0x95) BAD_TRAP(0x96) BAD_TRAP(0x97) BAD_TRAP(0x98) BAD_TRAP(0x99)
  278. BAD_TRAP(0x9a) BAD_TRAP(0x9b) BAD_TRAP(0x9c) BAD_TRAP(0x9d) BAD_TRAP(0x9e)
  279. BAD_TRAP(0x9f) GETCC_TRAP SETCC_TRAP GETPSR_TRAP
  280. BAD_TRAP(0xa3) BAD_TRAP(0xa4) BAD_TRAP(0xa5) BAD_TRAP(0xa6)
  281. BAD_TRAP(0xa7) BAD_TRAP(0xa8) BAD_TRAP(0xa9) BAD_TRAP(0xaa) BAD_TRAP(0xab)
  282. BAD_TRAP(0xac) BAD_TRAP(0xad) BAD_TRAP(0xae) BAD_TRAP(0xaf) BAD_TRAP(0xb0)
  283. BAD_TRAP(0xb1) BAD_TRAP(0xb2) BAD_TRAP(0xb3) BAD_TRAP(0xb4) BAD_TRAP(0xb5)
  284. BAD_TRAP(0xb6) BAD_TRAP(0xb7) BAD_TRAP(0xb8) BAD_TRAP(0xb9) BAD_TRAP(0xba)
  285. BAD_TRAP(0xbb) BAD_TRAP(0xbc) BAD_TRAP(0xbd) BAD_TRAP(0xbe) BAD_TRAP(0xbf)
  286. BAD_TRAP(0xc0) BAD_TRAP(0xc1) BAD_TRAP(0xc2) BAD_TRAP(0xc3) BAD_TRAP(0xc4)
  287. BAD_TRAP(0xc5) BAD_TRAP(0xc6) BAD_TRAP(0xc7) BAD_TRAP(0xc8) BAD_TRAP(0xc9)
  288. BAD_TRAP(0xca) BAD_TRAP(0xcb) BAD_TRAP(0xcc) BAD_TRAP(0xcd) BAD_TRAP(0xce)
  289. BAD_TRAP(0xcf) BAD_TRAP(0xd0) BAD_TRAP(0xd1) BAD_TRAP(0xd2) BAD_TRAP(0xd3)
  290. BAD_TRAP(0xd4) BAD_TRAP(0xd5) BAD_TRAP(0xd6) BAD_TRAP(0xd7) BAD_TRAP(0xd8)
  291. BAD_TRAP(0xd9) BAD_TRAP(0xda) BAD_TRAP(0xdb) BAD_TRAP(0xdc) BAD_TRAP(0xdd)
  292. BAD_TRAP(0xde) BAD_TRAP(0xdf) BAD_TRAP(0xe0) BAD_TRAP(0xe1) BAD_TRAP(0xe2)
  293. BAD_TRAP(0xe3) BAD_TRAP(0xe4) BAD_TRAP(0xe5) BAD_TRAP(0xe6) BAD_TRAP(0xe7)
  294. BAD_TRAP(0xe8) BAD_TRAP(0xe9) BAD_TRAP(0xea) BAD_TRAP(0xeb) BAD_TRAP(0xec)
  295. BAD_TRAP(0xed) BAD_TRAP(0xee) BAD_TRAP(0xef) BAD_TRAP(0xf0) BAD_TRAP(0xf1)
  296. BAD_TRAP(0xf2) BAD_TRAP(0xf3) BAD_TRAP(0xf4) BAD_TRAP(0xf5) BAD_TRAP(0xf6)
  297. BAD_TRAP(0xf7) BAD_TRAP(0xf8) BAD_TRAP(0xf9) BAD_TRAP(0xfa) BAD_TRAP(0xfb)
  298. BAD_TRAP(0xfc) KGDB_TRAP(0xfd) BAD_TRAP(0xfe) BAD_TRAP(0xff)
  299. trapbase_cpu3:
  300. BAD_TRAP(0x0) SRMMU_TFAULT TRAP_ENTRY(0x2, bad_instruction)
  301. TRAP_ENTRY(0x3, priv_instruction) TRAP_ENTRY(0x4, fpd_trap_handler)
  302. WINDOW_SPILL WINDOW_FILL TRAP_ENTRY(0x7, mna_handler)
  303. TRAP_ENTRY(0x8, fpe_trap_handler) SRMMU_DFAULT
  304. TRAP_ENTRY(0xa, do_tag_overflow) TRAP_ENTRY(0xb, do_watchpoint)
  305. BAD_TRAP(0xc) BAD_TRAP(0xd) BAD_TRAP(0xe) BAD_TRAP(0xf) BAD_TRAP(0x10)
  306. TRAP_ENTRY_INTERRUPT(1) TRAP_ENTRY_INTERRUPT(2)
  307. TRAP_ENTRY_INTERRUPT(3) TRAP_ENTRY_INTERRUPT(4)
  308. TRAP_ENTRY_INTERRUPT(5) TRAP_ENTRY_INTERRUPT(6)
  309. TRAP_ENTRY_INTERRUPT(7) TRAP_ENTRY_INTERRUPT(8)
  310. TRAP_ENTRY_INTERRUPT(9) TRAP_ENTRY_INTERRUPT(10)
  311. TRAP_ENTRY_INTERRUPT(11) TRAP_ENTRY_INTERRUPT(12)
  312. TRAP_ENTRY_INTERRUPT(13) TRAP_ENTRY_INTERRUPT(14)
  313. TRAP_ENTRY(0x1f, linux_trap_ipi15_sun4m)
  314. TRAP_ENTRY(0x20, do_reg_access) BAD_TRAP(0x21) BAD_TRAP(0x22)
  315. BAD_TRAP(0x23) TRAP_ENTRY(0x24, do_cp_disabled) SKIP_TRAP(0x25, unimp_flush)
  316. BAD_TRAP(0x26) BAD_TRAP(0x27) TRAP_ENTRY(0x28, do_cp_exception)
  317. SRMMU_DFAULT TRAP_ENTRY(0x2a, do_hw_divzero) BAD_TRAP(0x2b) BAD_TRAP(0x2c)
  318. BAD_TRAP(0x2d) BAD_TRAP(0x2e) BAD_TRAP(0x2f) BAD_TRAP(0x30) BAD_TRAP(0x31)
  319. BAD_TRAP(0x32) BAD_TRAP(0x33) BAD_TRAP(0x34) BAD_TRAP(0x35) BAD_TRAP(0x36)
  320. BAD_TRAP(0x37) BAD_TRAP(0x38) BAD_TRAP(0x39) BAD_TRAP(0x3a) BAD_TRAP(0x3b)
  321. BAD_TRAP(0x3c) BAD_TRAP(0x3d) BAD_TRAP(0x3e) BAD_TRAP(0x3f) BAD_TRAP(0x40)
  322. BAD_TRAP(0x41) BAD_TRAP(0x42) BAD_TRAP(0x43) BAD_TRAP(0x44) BAD_TRAP(0x45)
  323. BAD_TRAP(0x46) BAD_TRAP(0x47) BAD_TRAP(0x48) BAD_TRAP(0x49) BAD_TRAP(0x4a)
  324. BAD_TRAP(0x4b) BAD_TRAP(0x4c) BAD_TRAP(0x4d) BAD_TRAP(0x4e) BAD_TRAP(0x4f)
  325. BAD_TRAP(0x50)
  326. BAD_TRAP(0x51) BAD_TRAP(0x52) BAD_TRAP(0x53) BAD_TRAP(0x54) BAD_TRAP(0x55)
  327. BAD_TRAP(0x56) BAD_TRAP(0x57) BAD_TRAP(0x58) BAD_TRAP(0x59) BAD_TRAP(0x5a)
  328. BAD_TRAP(0x5b) BAD_TRAP(0x5c) BAD_TRAP(0x5d) BAD_TRAP(0x5e) BAD_TRAP(0x5f)
  329. BAD_TRAP(0x60) BAD_TRAP(0x61) BAD_TRAP(0x62) BAD_TRAP(0x63) BAD_TRAP(0x64)
  330. BAD_TRAP(0x65) BAD_TRAP(0x66) BAD_TRAP(0x67) BAD_TRAP(0x68) BAD_TRAP(0x69)
  331. BAD_TRAP(0x6a) BAD_TRAP(0x6b) BAD_TRAP(0x6c) BAD_TRAP(0x6d) BAD_TRAP(0x6e)
  332. BAD_TRAP(0x6f) BAD_TRAP(0x70) BAD_TRAP(0x71) BAD_TRAP(0x72) BAD_TRAP(0x73)
  333. BAD_TRAP(0x74) BAD_TRAP(0x75) BAD_TRAP(0x76) BAD_TRAP(0x77) BAD_TRAP(0x78)
  334. BAD_TRAP(0x79) BAD_TRAP(0x7a) BAD_TRAP(0x7b) BAD_TRAP(0x7c) BAD_TRAP(0x7d)
  335. BAD_TRAP(0x7e) BAD_TRAP(0x7f)
  336. BAD_TRAP(0x80)
  337. BREAKPOINT_TRAP
  338. TRAP_ENTRY(0x82, do_hw_divzero)
  339. TRAP_ENTRY(0x83, do_flush_windows) BAD_TRAP(0x84) BAD_TRAP(0x85)
  340. BAD_TRAP(0x86) BAD_TRAP(0x87) BAD_TRAP(0x88)
  341. BAD_TRAP(0x89) BAD_TRAP(0x8a) BAD_TRAP(0x8b) BAD_TRAP(0x8c)
  342. BAD_TRAP(0x8d) BAD_TRAP(0x8e) BAD_TRAP(0x8f)
  343. LINUX_SYSCALL_TRAP BAD_TRAP(0x91) BAD_TRAP(0x92) BAD_TRAP(0x93) BAD_TRAP(0x94)
  344. BAD_TRAP(0x95) BAD_TRAP(0x96) BAD_TRAP(0x97) BAD_TRAP(0x98) BAD_TRAP(0x99)
  345. BAD_TRAP(0x9a) BAD_TRAP(0x9b) BAD_TRAP(0x9c) BAD_TRAP(0x9d) BAD_TRAP(0x9e)
  346. BAD_TRAP(0x9f) GETCC_TRAP SETCC_TRAP GETPSR_TRAP
  347. BAD_TRAP(0xa3) BAD_TRAP(0xa4) BAD_TRAP(0xa5) BAD_TRAP(0xa6)
  348. BAD_TRAP(0xa7) BAD_TRAP(0xa8) BAD_TRAP(0xa9) BAD_TRAP(0xaa) BAD_TRAP(0xab)
  349. BAD_TRAP(0xac) BAD_TRAP(0xad) BAD_TRAP(0xae) BAD_TRAP(0xaf) BAD_TRAP(0xb0)
  350. BAD_TRAP(0xb1) BAD_TRAP(0xb2) BAD_TRAP(0xb3) BAD_TRAP(0xb4) BAD_TRAP(0xb5)
  351. BAD_TRAP(0xb6) BAD_TRAP(0xb7) BAD_TRAP(0xb8) BAD_TRAP(0xb9) BAD_TRAP(0xba)
  352. BAD_TRAP(0xbb) BAD_TRAP(0xbc) BAD_TRAP(0xbd) BAD_TRAP(0xbe) BAD_TRAP(0xbf)
  353. BAD_TRAP(0xc0) BAD_TRAP(0xc1) BAD_TRAP(0xc2) BAD_TRAP(0xc3) BAD_TRAP(0xc4)
  354. BAD_TRAP(0xc5) BAD_TRAP(0xc6) BAD_TRAP(0xc7) BAD_TRAP(0xc8) BAD_TRAP(0xc9)
  355. BAD_TRAP(0xca) BAD_TRAP(0xcb) BAD_TRAP(0xcc) BAD_TRAP(0xcd) BAD_TRAP(0xce)
  356. BAD_TRAP(0xcf) BAD_TRAP(0xd0) BAD_TRAP(0xd1) BAD_TRAP(0xd2) BAD_TRAP(0xd3)
  357. BAD_TRAP(0xd4) BAD_TRAP(0xd5) BAD_TRAP(0xd6) BAD_TRAP(0xd7) BAD_TRAP(0xd8)
  358. BAD_TRAP(0xd9) BAD_TRAP(0xda) BAD_TRAP(0xdb) BAD_TRAP(0xdc) BAD_TRAP(0xdd)
  359. BAD_TRAP(0xde) BAD_TRAP(0xdf) BAD_TRAP(0xe0) BAD_TRAP(0xe1) BAD_TRAP(0xe2)
  360. BAD_TRAP(0xe3) BAD_TRAP(0xe4) BAD_TRAP(0xe5) BAD_TRAP(0xe6) BAD_TRAP(0xe7)
  361. BAD_TRAP(0xe8) BAD_TRAP(0xe9) BAD_TRAP(0xea) BAD_TRAP(0xeb) BAD_TRAP(0xec)
  362. BAD_TRAP(0xed) BAD_TRAP(0xee) BAD_TRAP(0xef) BAD_TRAP(0xf0) BAD_TRAP(0xf1)
  363. BAD_TRAP(0xf2) BAD_TRAP(0xf3) BAD_TRAP(0xf4) BAD_TRAP(0xf5) BAD_TRAP(0xf6)
  364. BAD_TRAP(0xf7) BAD_TRAP(0xf8) BAD_TRAP(0xf9) BAD_TRAP(0xfa) BAD_TRAP(0xfb)
  365. BAD_TRAP(0xfc) KGDB_TRAP(0xfd) BAD_TRAP(0xfe) BAD_TRAP(0xff)
  366. #endif
  367. .align PAGE_SIZE
  368. /* This was the only reasonable way I could think of to properly align
  369. * these page-table data structures.
  370. */
  371. .globl swapper_pg_dir
  372. swapper_pg_dir: .skip PAGE_SIZE
  373. .globl empty_zero_page
  374. empty_zero_page: .skip PAGE_SIZE
  375. .global root_flags
  376. .global ram_flags
  377. .global root_dev
  378. .global sparc_ramdisk_image
  379. .global sparc_ramdisk_size
  380. /* This stuff has to be in sync with SILO and other potential boot loaders
  381. * Fields should be kept upward compatible and whenever any change is made,
  382. * HdrS version should be incremented.
  383. */
  384. .ascii "HdrS"
  385. .word LINUX_VERSION_CODE
  386. .half 0x0203 /* HdrS version */
  387. root_flags:
  388. .half 1
  389. root_dev:
  390. .half 0
  391. ram_flags:
  392. .half 0
  393. sparc_ramdisk_image:
  394. .word 0
  395. sparc_ramdisk_size:
  396. .word 0
  397. .word reboot_command
  398. .word 0, 0, 0
  399. .word _end
  400. /* Cool, here we go. Pick up the romvec pointer in %o0 and stash it in
  401. * %g7 and at prom_vector_p. And also quickly check whether we are on
  402. * a v0, v2, or v3 prom.
  403. */
  404. gokernel:
  405. /* Ok, it's nice to know, as early as possible, if we
  406. * are already mapped where we expect to be in virtual
  407. * memory. The Solaris /boot elf format bootloader
  408. * will peek into our elf header and load us where
  409. * we want to be, otherwise we have to re-map.
  410. *
  411. * Some boot loaders don't place the jmp'rs address
  412. * in %o7, so we do a pc-relative call to a local
  413. * label, then see what %o7 has.
  414. */
  415. mov %o7, %g4 ! Save %o7
  416. /* Jump to it, and pray... */
  417. current_pc:
  418. call 1f
  419. nop
  420. 1:
  421. mov %o7, %g3
  422. tst %o0
  423. be no_sun4u_here
  424. mov %g4, %o7 /* Previous %o7. */
  425. mov %o0, %l0 ! stash away romvec
  426. mov %o0, %g7 ! put it here too
  427. mov %o1, %l1 ! stash away debug_vec too
  428. /* Ok, let's check out our run time program counter. */
  429. set current_pc, %g5
  430. cmp %g3, %g5
  431. be already_mapped
  432. nop
  433. /* %l6 will hold the offset we have to subtract
  434. * from absolute symbols in order to access areas
  435. * in our own image. If already mapped this is
  436. * just plain zero, else it is KERNBASE.
  437. */
  438. set KERNBASE, %l6
  439. b copy_prom_lvl14
  440. nop
  441. already_mapped:
  442. mov 0, %l6
  443. /* Copy over the Prom's level 14 clock handler. */
  444. copy_prom_lvl14:
  445. #if 1
  446. /* DJHR
  447. * preserve our linked/calculated instructions
  448. */
  449. set lvl14_save, %g1
  450. set t_irq14, %g3
  451. sub %g1, %l6, %g1 ! translate to physical
  452. sub %g3, %l6, %g3 ! translate to physical
  453. ldd [%g3], %g4
  454. std %g4, [%g1]
  455. ldd [%g3+8], %g4
  456. std %g4, [%g1+8]
  457. #endif
  458. rd %tbr, %g1
  459. andn %g1, 0xfff, %g1 ! proms trap table base
  460. or %g0, (0x1e<<4), %g2 ! offset to lvl14 intr
  461. or %g1, %g2, %g2
  462. set t_irq14, %g3
  463. sub %g3, %l6, %g3
  464. ldd [%g2], %g4
  465. std %g4, [%g3]
  466. ldd [%g2 + 0x8], %g4
  467. std %g4, [%g3 + 0x8] ! Copy proms handler
  468. /* DON'T TOUCH %l0 thru %l5 in these remapping routines,
  469. * we need their values afterwards!
  470. */
  471. /* Now check whether we are already mapped, if we
  472. * are we can skip all this garbage coming up.
  473. */
  474. copy_prom_done:
  475. cmp %l6, 0
  476. be go_to_highmem ! this will be a nop then
  477. nop
  478. /* Validate that we are in fact running on an
  479. * SRMMU based cpu.
  480. */
  481. set 0x4000, %g6
  482. cmp %g7, %g6
  483. bne not_a_sun4
  484. nop
  485. halt_sun4_or_sun4c:
  486. ld [%g7 + 0x68], %o1
  487. set sun4c_notsup, %o0
  488. sub %o0, %l6, %o0
  489. call %o1
  490. nop
  491. ba halt_me
  492. nop
  493. not_a_sun4:
  494. lda [%g0] ASI_M_MMUREGS, %g1
  495. andcc %g1, 1, %g0
  496. be halt_sun4_or_sun4c
  497. nop
  498. srmmu_remap:
  499. /* First, check for a viking (TI) module. */
  500. set 0x40000000, %g2
  501. rd %psr, %g3
  502. and %g2, %g3, %g3
  503. subcc %g3, 0x0, %g0
  504. bz srmmu_nviking
  505. nop
  506. /* Figure out what kind of viking we are on.
  507. * We need to know if we have to play with the
  508. * AC bit and disable traps or not.
  509. */
  510. /* I've only seen MicroSparc's on SparcClassics with this
  511. * bit set.
  512. */
  513. set 0x800, %g2
  514. lda [%g0] ASI_M_MMUREGS, %g3 ! peek in the control reg
  515. and %g2, %g3, %g3
  516. subcc %g3, 0x0, %g0
  517. bnz srmmu_nviking ! is in mbus mode
  518. nop
  519. rd %psr, %g3 ! DO NOT TOUCH %g3
  520. andn %g3, PSR_ET, %g2
  521. wr %g2, 0x0, %psr
  522. WRITE_PAUSE
  523. /* Get context table pointer, then convert to
  524. * a physical address, which is 36 bits.
  525. */
  526. set AC_M_CTPR, %g4
  527. lda [%g4] ASI_M_MMUREGS, %g4
  528. sll %g4, 0x4, %g4 ! We use this below
  529. ! DO NOT TOUCH %g4
  530. /* Set the AC bit in the Viking's MMU control reg. */
  531. lda [%g0] ASI_M_MMUREGS, %g5 ! DO NOT TOUCH %g5
  532. set 0x8000, %g6 ! AC bit mask
  533. or %g5, %g6, %g6 ! Or it in...
  534. sta %g6, [%g0] ASI_M_MMUREGS ! Close your eyes...
  535. /* Grrr, why does it seem like every other load/store
  536. * on the sun4m is in some ASI space...
  537. * Fine with me, let's get the pointer to the level 1
  538. * page table directory and fetch its entry.
  539. */
  540. lda [%g4] ASI_M_BYPASS, %o1 ! This is a level 1 ptr
  541. srl %o1, 0x4, %o1 ! Clear low 4 bits
  542. sll %o1, 0x8, %o1 ! Make physical
  543. /* Ok, pull in the PTD. */
  544. lda [%o1] ASI_M_BYPASS, %o2 ! This is the 0x0 16MB pgd
  545. /* Calculate to KERNBASE entry. */
  546. add %o1, KERNBASE >> (SRMMU_PGDIR_SHIFT - 2), %o3
  547. /* Poke the entry into the calculated address. */
  548. sta %o2, [%o3] ASI_M_BYPASS
  549. /* I don't get it Sun, if you engineered all these
  550. * boot loaders and the PROM (thank you for the debugging
  551. * features btw) why did you not have them load kernel
  552. * images up in high address space, since this is necessary
  553. * for ABI compliance anyways? Does this low-mapping provide
  554. * enhanced interoperability?
  555. *
  556. * "The PROM is the computer."
  557. */
  558. /* Ok, restore the MMU control register we saved in %g5 */
  559. sta %g5, [%g0] ASI_M_MMUREGS ! POW... ouch
  560. /* Turn traps back on. We saved it in %g3 earlier. */
  561. wr %g3, 0x0, %psr ! tick tock, tick tock
  562. /* Now we burn precious CPU cycles due to bad engineering. */
  563. WRITE_PAUSE
  564. /* Wow, all that just to move a 32-bit value from one
  565. * place to another... Jump to high memory.
  566. */
  567. b go_to_highmem
  568. nop
  569. /* This works on viking's in Mbus mode and all
  570. * other MBUS modules. It is virtually the same as
  571. * the above madness sans turning traps off and flipping
  572. * the AC bit.
  573. */
  574. srmmu_nviking:
  575. set AC_M_CTPR, %g1
  576. lda [%g1] ASI_M_MMUREGS, %g1 ! get ctx table ptr
  577. sll %g1, 0x4, %g1 ! make physical addr
  578. lda [%g1] ASI_M_BYPASS, %g1 ! ptr to level 1 pg_table
  579. srl %g1, 0x4, %g1
  580. sll %g1, 0x8, %g1 ! make phys addr for l1 tbl
  581. lda [%g1] ASI_M_BYPASS, %g2 ! get level1 entry for 0x0
  582. add %g1, KERNBASE >> (SRMMU_PGDIR_SHIFT - 2), %g3
  583. sta %g2, [%g3] ASI_M_BYPASS ! place at KERNBASE entry
  584. b go_to_highmem
  585. nop ! wheee....
  586. /* Now do a non-relative jump so that PC is in high-memory */
  587. go_to_highmem:
  588. set execute_in_high_mem, %g1
  589. jmpl %g1, %g0
  590. nop
  591. /* The code above should be at beginning and we have to take care about
  592. * short jumps, as branching to .init.text section from .text is usually
  593. * impossible */
  594. __INIT
  595. /* Acquire boot time privileged register values, this will help debugging.
  596. * I figure out and store nwindows and nwindowsm1 later on.
  597. */
  598. execute_in_high_mem:
  599. mov %l0, %o0 ! put back romvec
  600. mov %l1, %o1 ! and debug_vec
  601. sethi %hi(prom_vector_p), %g1
  602. st %o0, [%g1 + %lo(prom_vector_p)]
  603. sethi %hi(linux_dbvec), %g1
  604. st %o1, [%g1 + %lo(linux_dbvec)]
  605. /* Get the machine type via the mysterious romvec node operations. */
  606. add %g7, 0x1c, %l1
  607. ld [%l1], %l0
  608. ld [%l0], %l0
  609. call %l0
  610. or %g0, %g0, %o0 ! next_node(0) = first_node
  611. or %o0, %g0, %g6
  612. sethi %hi(cputypvar), %o1 ! First node has cpu-arch
  613. or %o1, %lo(cputypvar), %o1
  614. sethi %hi(cputypval), %o2 ! information, the string
  615. or %o2, %lo(cputypval), %o2
  616. ld [%l1], %l0 ! 'compatible' tells
  617. ld [%l0 + 0xc], %l0 ! that we want 'sun4x' where
  618. call %l0 ! x is one of 'm', 'd' or 'e'.
  619. nop ! %o2 holds pointer
  620. ! to a buf where above string
  621. ! will get stored by the prom.
  622. #ifdef CONFIG_SPARC_LEON
  623. /* no cpu-type check is needed, it is a SPARC-LEON */
  624. sethi %hi(boot_cpu_id), %g2 ! boot-cpu index
  625. #ifdef CONFIG_SMP
  626. ldub [%g2 + %lo(boot_cpu_id)], %g1
  627. cmp %g1, 0xff ! unset means first CPU
  628. bne leon_smp_cpu_startup ! continue only with master
  629. nop
  630. #endif
  631. /* Get CPU-ID from most significant 4-bit of ASR17 */
  632. rd %asr17, %g1
  633. srl %g1, 28, %g1
  634. /* Update boot_cpu_id only on boot cpu */
  635. stub %g1, [%g2 + %lo(boot_cpu_id)]
  636. ba continue_boot
  637. nop
  638. #endif
  639. /* Check to cputype. We may be booted on a sun4u (64 bit box),
  640. * and sun4d needs special treatment.
  641. */
  642. set cputypval, %o2
  643. ldub [%o2 + 0x4], %l1
  644. cmp %l1, 'm'
  645. be sun4m_init
  646. cmp %l1, 's'
  647. be sun4m_init
  648. cmp %l1, 'd'
  649. be sun4d_init
  650. cmp %l1, 'e'
  651. be no_sun4e_here ! Could be a sun4e.
  652. nop
  653. b no_sun4u_here ! AIEEE, a V9 sun4u... Get our BIG BROTHER kernel :))
  654. nop
  655. /* CPUID in bootbus can be found at PA 0xff0140000 */
  656. #define SUN4D_BOOTBUS_CPUID 0xf0140000
  657. sun4d_init:
  658. /* Need to patch call to handler_irq */
  659. set patch_handler_irq, %g4
  660. set sun4d_handler_irq, %g5
  661. sethi %hi(0x40000000), %g3 ! call
  662. sub %g5, %g4, %g5
  663. srl %g5, 2, %g5
  664. or %g5, %g3, %g5
  665. st %g5, [%g4]
  666. #ifdef CONFIG_SMP
  667. /* Get our CPU id out of bootbus */
  668. set SUN4D_BOOTBUS_CPUID, %g3
  669. lduba [%g3] ASI_M_CTL, %g3
  670. and %g3, 0xf8, %g3
  671. srl %g3, 3, %g4
  672. sta %g4, [%g0] ASI_M_VIKING_TMP1
  673. sethi %hi(boot_cpu_id), %g5
  674. stb %g4, [%g5 + %lo(boot_cpu_id)]
  675. #endif
  676. /* Fall through to sun4m_init */
  677. sun4m_init:
  678. #define PATCH_IT(dst, src) \
  679. set (dst), %g5; \
  680. set (src), %g4; \
  681. ld [%g4], %g3; \
  682. st %g3, [%g5]; \
  683. ld [%g4+0x4], %g3; \
  684. st %g3, [%g5+0x4];
  685. /* Signed multiply. */
  686. PATCH_IT(.mul, .mul_patch)
  687. PATCH_IT(.mul+0x08, .mul_patch+0x08)
  688. /* Signed remainder. */
  689. PATCH_IT(.rem, .rem_patch)
  690. PATCH_IT(.rem+0x08, .rem_patch+0x08)
  691. PATCH_IT(.rem+0x10, .rem_patch+0x10)
  692. PATCH_IT(.rem+0x18, .rem_patch+0x18)
  693. PATCH_IT(.rem+0x20, .rem_patch+0x20)
  694. PATCH_IT(.rem+0x28, .rem_patch+0x28)
  695. /* Signed division. */
  696. PATCH_IT(.div, .div_patch)
  697. PATCH_IT(.div+0x08, .div_patch+0x08)
  698. PATCH_IT(.div+0x10, .div_patch+0x10)
  699. PATCH_IT(.div+0x18, .div_patch+0x18)
  700. PATCH_IT(.div+0x20, .div_patch+0x20)
  701. /* Unsigned multiply. */
  702. PATCH_IT(.umul, .umul_patch)
  703. PATCH_IT(.umul+0x08, .umul_patch+0x08)
  704. /* Unsigned remainder. */
  705. PATCH_IT(.urem, .urem_patch)
  706. PATCH_IT(.urem+0x08, .urem_patch+0x08)
  707. PATCH_IT(.urem+0x10, .urem_patch+0x10)
  708. PATCH_IT(.urem+0x18, .urem_patch+0x18)
  709. /* Unsigned division. */
  710. PATCH_IT(.udiv, .udiv_patch)
  711. PATCH_IT(.udiv+0x08, .udiv_patch+0x08)
  712. PATCH_IT(.udiv+0x10, .udiv_patch+0x10)
  713. #undef PATCH_IT
  714. /* Ok, the PROM could have done funny things and apple cider could still
  715. * be sitting in the fault status/address registers. Read them all to
  716. * clear them so we don't get magic faults later on.
  717. */
  718. /* This sucks, apparently this makes Vikings call prom panic, will fix later */
  719. 2:
  720. rd %psr, %o1
  721. srl %o1, 28, %o1 ! Get a type of the CPU
  722. subcc %o1, 4, %g0 ! TI: Viking or MicroSPARC
  723. be continue_boot
  724. nop
  725. set AC_M_SFSR, %o0
  726. lda [%o0] ASI_M_MMUREGS, %g0
  727. set AC_M_SFAR, %o0
  728. lda [%o0] ASI_M_MMUREGS, %g0
  729. /* Fujitsu MicroSPARC-II has no asynchronous flavors of FARs */
  730. subcc %o1, 0, %g0
  731. be continue_boot
  732. nop
  733. set AC_M_AFSR, %o0
  734. lda [%o0] ASI_M_MMUREGS, %g0
  735. set AC_M_AFAR, %o0
  736. lda [%o0] ASI_M_MMUREGS, %g0
  737. nop
  738. continue_boot:
  739. /* Aieee, now set PC and nPC, enable traps, give ourselves a stack and it's
  740. * show-time!
  741. */
  742. sethi %hi(cputyp), %o0
  743. st %g4, [%o0 + %lo(cputyp)]
  744. /* Turn on Supervisor, EnableFloating, and all the PIL bits.
  745. * Also puts us in register window zero with traps off.
  746. */
  747. set (PSR_PS | PSR_S | PSR_PIL | PSR_EF), %g2
  748. wr %g2, 0x0, %psr
  749. WRITE_PAUSE
  750. /* I want a kernel stack NOW! */
  751. set init_thread_union, %g1
  752. set (THREAD_SIZE - STACKFRAME_SZ), %g2
  753. add %g1, %g2, %sp
  754. mov 0, %fp /* And for good luck */
  755. /* Zero out our BSS section. */
  756. set __bss_start , %o0 ! First address of BSS
  757. set _end , %o1 ! Last address of BSS
  758. add %o0, 0x1, %o0
  759. 1:
  760. stb %g0, [%o0]
  761. subcc %o0, %o1, %g0
  762. bl 1b
  763. add %o0, 0x1, %o0
  764. /* If boot_cpu_id has not been setup by machine specific
  765. * init-code above we default it to zero.
  766. */
  767. sethi %hi(boot_cpu_id), %g2
  768. ldub [%g2 + %lo(boot_cpu_id)], %g3
  769. cmp %g3, 0xff
  770. bne 1f
  771. nop
  772. mov %g0, %g3
  773. stub %g3, [%g2 + %lo(boot_cpu_id)]
  774. 1: /* boot_cpu_id set. calculate boot_cpu_id4 = boot_cpu_id*4 */
  775. sll %g3, 2, %g3
  776. sethi %hi(boot_cpu_id4), %g2
  777. stub %g3, [%g2 + %lo(boot_cpu_id4)]
  778. /* Initialize the uwinmask value for init task just in case.
  779. * But first make current_set[boot_cpu_id] point to something useful.
  780. */
  781. set init_thread_union, %g6
  782. set current_set, %g2
  783. #ifdef CONFIG_SMP
  784. st %g6, [%g2]
  785. add %g2, %g3, %g2
  786. #endif
  787. st %g6, [%g2]
  788. st %g0, [%g6 + TI_UWINMASK]
  789. /* Compute NWINDOWS and stash it away. Now uses %wim trick explained
  790. * in the V8 manual. Ok, this method seems to work, Sparc is cool...
  791. * No, it doesn't work, have to play the save/readCWP/restore trick.
  792. */
  793. wr %g0, 0x0, %wim ! so we do not get a trap
  794. WRITE_PAUSE
  795. save
  796. rd %psr, %g3
  797. restore
  798. and %g3, 0x1f, %g3
  799. add %g3, 0x1, %g3
  800. mov 2, %g1
  801. wr %g1, 0x0, %wim ! make window 1 invalid
  802. WRITE_PAUSE
  803. cmp %g3, 0x7
  804. bne 2f
  805. nop
  806. /* Adjust our window handling routines to
  807. * do things correctly on 7 window Sparcs.
  808. */
  809. #define PATCH_INSN(src, dest) \
  810. set src, %g5; \
  811. set dest, %g2; \
  812. ld [%g5], %g4; \
  813. st %g4, [%g2];
  814. /* Patch for window spills... */
  815. PATCH_INSN(spnwin_patch1_7win, spnwin_patch1)
  816. PATCH_INSN(spnwin_patch2_7win, spnwin_patch2)
  817. PATCH_INSN(spnwin_patch3_7win, spnwin_patch3)
  818. /* Patch for window fills... */
  819. PATCH_INSN(fnwin_patch1_7win, fnwin_patch1)
  820. PATCH_INSN(fnwin_patch2_7win, fnwin_patch2)
  821. /* Patch for trap entry setup... */
  822. PATCH_INSN(tsetup_7win_patch1, tsetup_patch1)
  823. PATCH_INSN(tsetup_7win_patch2, tsetup_patch2)
  824. PATCH_INSN(tsetup_7win_patch3, tsetup_patch3)
  825. PATCH_INSN(tsetup_7win_patch4, tsetup_patch4)
  826. PATCH_INSN(tsetup_7win_patch5, tsetup_patch5)
  827. PATCH_INSN(tsetup_7win_patch6, tsetup_patch6)
  828. /* Patch for returning from traps... */
  829. PATCH_INSN(rtrap_7win_patch1, rtrap_patch1)
  830. PATCH_INSN(rtrap_7win_patch2, rtrap_patch2)
  831. PATCH_INSN(rtrap_7win_patch3, rtrap_patch3)
  832. PATCH_INSN(rtrap_7win_patch4, rtrap_patch4)
  833. PATCH_INSN(rtrap_7win_patch5, rtrap_patch5)
  834. /* Patch for killing user windows from the register file. */
  835. PATCH_INSN(kuw_patch1_7win, kuw_patch1)
  836. /* Now patch the kernel window flush sequences.
  837. * This saves 2 traps on every switch and fork.
  838. */
  839. set 0x01000000, %g4
  840. set flush_patch_one, %g5
  841. st %g4, [%g5 + 0x18]
  842. st %g4, [%g5 + 0x1c]
  843. set flush_patch_two, %g5
  844. st %g4, [%g5 + 0x18]
  845. st %g4, [%g5 + 0x1c]
  846. set flush_patch_three, %g5
  847. st %g4, [%g5 + 0x18]
  848. st %g4, [%g5 + 0x1c]
  849. set flush_patch_four, %g5
  850. st %g4, [%g5 + 0x18]
  851. st %g4, [%g5 + 0x1c]
  852. set flush_patch_exception, %g5
  853. st %g4, [%g5 + 0x18]
  854. st %g4, [%g5 + 0x1c]
  855. set flush_patch_switch, %g5
  856. st %g4, [%g5 + 0x18]
  857. st %g4, [%g5 + 0x1c]
  858. 2:
  859. sethi %hi(nwindows), %g4
  860. st %g3, [%g4 + %lo(nwindows)] ! store final value
  861. sub %g3, 0x1, %g3
  862. sethi %hi(nwindowsm1), %g4
  863. st %g3, [%g4 + %lo(nwindowsm1)]
  864. /* Here we go, start using Linux's trap table... */
  865. set trapbase, %g3
  866. wr %g3, 0x0, %tbr
  867. WRITE_PAUSE
  868. /* Finally, turn on traps so that we can call c-code. */
  869. rd %psr, %g3
  870. wr %g3, 0x0, %psr
  871. WRITE_PAUSE
  872. wr %g3, PSR_ET, %psr
  873. WRITE_PAUSE
  874. /* First we call prom_init() to set up PROMLIB, then
  875. * off to start_kernel().
  876. */
  877. sethi %hi(prom_vector_p), %g5
  878. ld [%g5 + %lo(prom_vector_p)], %o0
  879. call prom_init
  880. nop
  881. call start_kernel
  882. nop
  883. /* We should not get here. */
  884. call halt_me
  885. nop
  886. no_sun4e_here:
  887. ld [%g7 + 0x68], %o1
  888. set sun4e_notsup, %o0
  889. call %o1
  890. nop
  891. b halt_me
  892. nop
  893. __INITDATA
  894. sun4u_1:
  895. .asciz "finddevice"
  896. .align 4
  897. sun4u_2:
  898. .asciz "/chosen"
  899. .align 4
  900. sun4u_3:
  901. .asciz "getprop"
  902. .align 4
  903. sun4u_4:
  904. .asciz "stdout"
  905. .align 4
  906. sun4u_5:
  907. .asciz "write"
  908. .align 4
  909. sun4u_6:
  910. .asciz "\n\rOn sun4u you have to use UltraLinux (64bit) kernel\n\rand not a 32bit sun4[cdem] version\n\r\n\r"
  911. sun4u_6e:
  912. .align 4
  913. sun4u_7:
  914. .asciz "exit"
  915. .align 8
  916. sun4u_a1:
  917. .word 0, sun4u_1, 0, 1, 0, 1, 0, sun4u_2, 0
  918. sun4u_r1:
  919. .word 0
  920. sun4u_a2:
  921. .word 0, sun4u_3, 0, 4, 0, 1, 0
  922. sun4u_i2:
  923. .word 0, 0, sun4u_4, 0, sun4u_1, 0, 8, 0
  924. sun4u_r2:
  925. .word 0
  926. sun4u_a3:
  927. .word 0, sun4u_5, 0, 3, 0, 1, 0
  928. sun4u_i3:
  929. .word 0, 0, sun4u_6, 0, sun4u_6e - sun4u_6 - 1, 0
  930. sun4u_r3:
  931. .word 0
  932. sun4u_a4:
  933. .word 0, sun4u_7, 0, 0, 0, 0
  934. sun4u_r4:
  935. __INIT
  936. no_sun4u_here:
  937. set sun4u_a1, %o0
  938. set current_pc, %l2
  939. cmp %l2, %g3
  940. be 1f
  941. mov %o4, %l0
  942. sub %g3, %l2, %l6
  943. add %o0, %l6, %o0
  944. mov %o0, %l4
  945. mov sun4u_r4 - sun4u_a1, %l3
  946. ld [%l4], %l5
  947. 2:
  948. add %l4, 4, %l4
  949. cmp %l5, %l2
  950. add %l5, %l6, %l5
  951. bgeu,a 3f
  952. st %l5, [%l4 - 4]
  953. 3:
  954. subcc %l3, 4, %l3
  955. bne 2b
  956. ld [%l4], %l5
  957. 1:
  958. call %l0
  959. mov %o0, %l1
  960. ld [%l1 + (sun4u_r1 - sun4u_a1)], %o1
  961. add %l1, (sun4u_a2 - sun4u_a1), %o0
  962. call %l0
  963. st %o1, [%o0 + (sun4u_i2 - sun4u_a2)]
  964. ld [%l1 + (sun4u_1 - sun4u_a1)], %o1
  965. add %l1, (sun4u_a3 - sun4u_a1), %o0
  966. call %l0
  967. st %o1, [%o0 + (sun4u_i3 - sun4u_a3)]
  968. call %l0
  969. add %l1, (sun4u_a4 - sun4u_a1), %o0
  970. /* Not reached */
  971. halt_me:
  972. ld [%g7 + 0x74], %o0
  973. call %o0 ! Get us out of here...
  974. nop ! Apparently Solaris is better.
  975. /* Ok, now we continue in the .data/.text sections */
  976. .data
  977. .align 4
  978. /*
  979. * Fill up the prom vector, note in particular the kind first element,
  980. * no joke. I don't need all of them in here as the entire prom vector
  981. * gets initialized in c-code so all routines can use it.
  982. */
  983. prom_vector_p:
  984. .word 0
  985. /* We calculate the following at boot time, window fills/spills and trap entry
  986. * code uses these to keep track of the register windows.
  987. */
  988. .align 4
  989. .globl nwindows
  990. .globl nwindowsm1
  991. nwindows:
  992. .word 8
  993. nwindowsm1:
  994. .word 7
  995. /* Boot time debugger vector value. We need this later on. */
  996. .align 4
  997. .globl linux_dbvec
  998. linux_dbvec:
  999. .word 0
  1000. .word 0
  1001. .align 8
  1002. .globl lvl14_save
  1003. lvl14_save:
  1004. .word 0
  1005. .word 0
  1006. .word 0
  1007. .word 0
  1008. .word t_irq14
  1009. .section ".fixup",#alloc,#execinstr
  1010. .globl __ret_efault
  1011. __ret_efault:
  1012. ret
  1013. restore %g0, -EFAULT, %o0