fskeleton.S 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. |MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
  3. |M68000 Hi-Performance Microprocessor Division
  4. |M68060 Software Package
  5. |Production Release P1.00 -- October 10, 1994
  6. |
  7. |M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved.
  8. |
  9. |THE SOFTWARE is provided on an "AS IS" basis and without warranty.
  10. |To the maximum extent permitted by applicable law,
  11. |MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
  12. |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  13. |and any warranty against infringement with regard to the SOFTWARE
  14. |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
  15. |
  16. |To the maximum extent permitted by applicable law,
  17. |IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
  18. |(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
  19. |BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
  20. |ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
  21. |Motorola assumes no responsibility for the maintenance and support of the SOFTWARE.
  22. |
  23. |You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
  24. |so long as this entire notice is retained without alteration in any modified and/or
  25. |redistributed versions, and that such modified versions are clearly identified as such.
  26. |No licenses are granted by implication, estoppel or otherwise under any patents
  27. |or trademarks of Motorola, Inc.
  28. |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  29. | fskeleton.s
  30. |
  31. | This file contains:
  32. | (1) example "Call-out"s
  33. | (2) example package entry code
  34. | (3) example "Call-out" table
  35. |
  36. #include <linux/linkage.h>
  37. |################################
  38. | (1) EXAMPLE CALL-OUTS #
  39. | #
  40. | _060_fpsp_done() #
  41. | _060_real_ovfl() #
  42. | _060_real_unfl() #
  43. | _060_real_operr() #
  44. | _060_real_snan() #
  45. | _060_real_dz() #
  46. | _060_real_inex() #
  47. | _060_real_bsun() #
  48. | _060_real_fline() #
  49. | _060_real_fpu_disabled() #
  50. | _060_real_trap() #
  51. |################################
  52. |
  53. | _060_fpsp_done():
  54. |
  55. | This is the main exit point for the 68060 Floating-Point
  56. | Software Package. For a normal exit, all 060FPSP routines call this
  57. | routine. The operating system can do system dependent clean-up or
  58. | simply execute an "rte" as with the sample code below.
  59. |
  60. .global _060_fpsp_done
  61. _060_fpsp_done:
  62. bral _060_isp_done | do the same as isp_done
  63. |
  64. | _060_real_ovfl():
  65. |
  66. | This is the exit point for the 060FPSP when an enabled overflow exception
  67. | is present. The routine below should point to the operating system handler
  68. | for enabled overflow conditions. The exception stack frame is an overflow
  69. | stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
  70. |
  71. | The sample routine below simply clears the exception status bit and
  72. | does an "rte".
  73. |
  74. .global _060_real_ovfl
  75. _060_real_ovfl:
  76. fsave -(%sp)
  77. move.w #0x6000,0x2(%sp)
  78. frestore (%sp)+
  79. bral trap | jump to trap handler
  80. |
  81. | _060_real_unfl():
  82. |
  83. | This is the exit point for the 060FPSP when an enabled underflow exception
  84. | is present. The routine below should point to the operating system handler
  85. | for enabled underflow conditions. The exception stack frame is an underflow
  86. | stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
  87. |
  88. | The sample routine below simply clears the exception status bit and
  89. | does an "rte".
  90. |
  91. .global _060_real_unfl
  92. _060_real_unfl:
  93. fsave -(%sp)
  94. move.w #0x6000,0x2(%sp)
  95. frestore (%sp)+
  96. bral trap | jump to trap handler
  97. |
  98. | _060_real_operr():
  99. |
  100. | This is the exit point for the 060FPSP when an enabled operand error exception
  101. | is present. The routine below should point to the operating system handler
  102. | for enabled operand error exceptions. The exception stack frame is an operand error
  103. | stack frame. The FP state frame holds the source operand of the faulting
  104. | instruction.
  105. |
  106. | The sample routine below simply clears the exception status bit and
  107. | does an "rte".
  108. |
  109. .global _060_real_operr
  110. _060_real_operr:
  111. fsave -(%sp)
  112. move.w #0x6000,0x2(%sp)
  113. frestore (%sp)+
  114. bral trap | jump to trap handler
  115. |
  116. | _060_real_snan():
  117. |
  118. | This is the exit point for the 060FPSP when an enabled signalling NaN exception
  119. | is present. The routine below should point to the operating system handler
  120. | for enabled signalling NaN exceptions. The exception stack frame is a signalling NaN
  121. | stack frame. The FP state frame holds the source operand of the faulting
  122. | instruction.
  123. |
  124. | The sample routine below simply clears the exception status bit and
  125. | does an "rte".
  126. |
  127. .global _060_real_snan
  128. _060_real_snan:
  129. fsave -(%sp)
  130. move.w #0x6000,0x2(%sp)
  131. frestore (%sp)+
  132. bral trap | jump to trap handler
  133. |
  134. | _060_real_dz():
  135. |
  136. | This is the exit point for the 060FPSP when an enabled divide-by-zero exception
  137. | is present. The routine below should point to the operating system handler
  138. | for enabled divide-by-zero exceptions. The exception stack frame is a divide-by-zero
  139. | stack frame. The FP state frame holds the source operand of the faulting
  140. | instruction.
  141. |
  142. | The sample routine below simply clears the exception status bit and
  143. | does an "rte".
  144. |
  145. .global _060_real_dz
  146. _060_real_dz:
  147. fsave -(%sp)
  148. move.w #0x6000,0x2(%sp)
  149. frestore (%sp)+
  150. bral trap | jump to trap handler
  151. |
  152. | _060_real_inex():
  153. |
  154. | This is the exit point for the 060FPSP when an enabled inexact exception
  155. | is present. The routine below should point to the operating system handler
  156. | for enabled inexact exceptions. The exception stack frame is an inexact
  157. | stack frame. The FP state frame holds the source operand of the faulting
  158. | instruction.
  159. |
  160. | The sample routine below simply clears the exception status bit and
  161. | does an "rte".
  162. |
  163. .global _060_real_inex
  164. _060_real_inex:
  165. fsave -(%sp)
  166. move.w #0x6000,0x2(%sp)
  167. frestore (%sp)+
  168. bral trap | jump to trap handler
  169. |
  170. | _060_real_bsun():
  171. |
  172. | This is the exit point for the 060FPSP when an enabled bsun exception
  173. | is present. The routine below should point to the operating system handler
  174. | for enabled bsun exceptions. The exception stack frame is a bsun
  175. | stack frame.
  176. |
  177. | The sample routine below clears the exception status bit, clears the NaN
  178. | bit in the FPSR, and does an "rte". The instruction that caused the
  179. | bsun will now be re-executed but with the NaN FPSR bit cleared.
  180. |
  181. .global _060_real_bsun
  182. _060_real_bsun:
  183. | fsave -(%sp)
  184. fmove.l %fpsr,-(%sp)
  185. andi.b #0xfe,(%sp)
  186. fmove.l (%sp)+,%fpsr
  187. bral trap | jump to trap handler
  188. |
  189. | _060_real_fline():
  190. |
  191. | This is the exit point for the 060FPSP when an F-Line Illegal exception is
  192. | encountered. Three different types of exceptions can enter the F-Line exception
  193. | vector number 11: FP Unimplemented Instructions, FP implemented instructions when
  194. | the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
  195. | _fpsp_fline() distinguishes between the three and acts appropriately. F-Line
  196. | Illegals branch here.
  197. |
  198. .global _060_real_fline
  199. _060_real_fline:
  200. bral trap | jump to trap handler
  201. |
  202. | _060_real_fpu_disabled():
  203. |
  204. | This is the exit point for the 060FPSP when an FPU disabled exception is
  205. | encountered. Three different types of exceptions can enter the F-Line exception
  206. | vector number 11: FP Unimplemented Instructions, FP implemented instructions when
  207. | the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
  208. | _fpsp_fline() distinguishes between the three and acts appropriately. FPU disabled
  209. | exceptions branch here.
  210. |
  211. | The sample code below enables the FPU, sets the PC field in the exception stack
  212. | frame to the PC of the instruction causing the exception, and does an "rte".
  213. | The execution of the instruction then proceeds with an enabled floating-point
  214. | unit.
  215. |
  216. .global _060_real_fpu_disabled
  217. _060_real_fpu_disabled:
  218. move.l %d0,-(%sp) | enabled the fpu
  219. .long 0x4E7A0808 |movec pcr,%d0
  220. bclr #0x1,%d0
  221. .long 0x4E7B0808 |movec %d0,pcr
  222. move.l (%sp)+,%d0
  223. move.l 0xc(%sp),0x2(%sp) | set "Current PC"
  224. rte
  225. |
  226. | _060_real_trap():
  227. |
  228. | This is the exit point for the 060FPSP when an emulated "ftrapcc" instruction
  229. | discovers that the trap condition is true and it should branch to the operating
  230. | system handler for the trap exception vector number 7.
  231. |
  232. | The sample code below simply executes an "rte".
  233. |
  234. .global _060_real_trap
  235. _060_real_trap:
  236. bral trap | jump to trap handler
  237. |############################################################################
  238. |#################################
  239. | (2) EXAMPLE PACKAGE ENTRY CODE #
  240. |#################################
  241. .global _060_fpsp_snan
  242. _060_fpsp_snan:
  243. bra.l _FP_CALL_TOP+0x80+0x00
  244. .global _060_fpsp_operr
  245. _060_fpsp_operr:
  246. bra.l _FP_CALL_TOP+0x80+0x08
  247. .global _060_fpsp_ovfl
  248. _060_fpsp_ovfl:
  249. bra.l _FP_CALL_TOP+0x80+0x10
  250. .global _060_fpsp_unfl
  251. _060_fpsp_unfl:
  252. bra.l _FP_CALL_TOP+0x80+0x18
  253. .global _060_fpsp_dz
  254. _060_fpsp_dz:
  255. bra.l _FP_CALL_TOP+0x80+0x20
  256. .global _060_fpsp_inex
  257. _060_fpsp_inex:
  258. bra.l _FP_CALL_TOP+0x80+0x28
  259. .global _060_fpsp_fline
  260. _060_fpsp_fline:
  261. bra.l _FP_CALL_TOP+0x80+0x30
  262. .global _060_fpsp_unsupp
  263. _060_fpsp_unsupp:
  264. bra.l _FP_CALL_TOP+0x80+0x38
  265. .global _060_fpsp_effadd
  266. _060_fpsp_effadd:
  267. bra.l _FP_CALL_TOP+0x80+0x40
  268. |############################################################################
  269. |###############################
  270. | (3) EXAMPLE CALL-OUT SECTION #
  271. |###############################
  272. | The size of this section MUST be 128 bytes!!!
  273. _FP_CALL_TOP:
  274. .long _060_real_bsun - _FP_CALL_TOP
  275. .long _060_real_snan - _FP_CALL_TOP
  276. .long _060_real_operr - _FP_CALL_TOP
  277. .long _060_real_ovfl - _FP_CALL_TOP
  278. .long _060_real_unfl - _FP_CALL_TOP
  279. .long _060_real_dz - _FP_CALL_TOP
  280. .long _060_real_inex - _FP_CALL_TOP
  281. .long _060_real_fline - _FP_CALL_TOP
  282. .long _060_real_fpu_disabled - _FP_CALL_TOP
  283. .long _060_real_trap - _FP_CALL_TOP
  284. .long _060_real_trace - _FP_CALL_TOP
  285. .long _060_real_access - _FP_CALL_TOP
  286. .long _060_fpsp_done - _FP_CALL_TOP
  287. .long 0x00000000, 0x00000000, 0x00000000
  288. .long _060_imem_read - _FP_CALL_TOP
  289. .long _060_dmem_read - _FP_CALL_TOP
  290. .long _060_dmem_write - _FP_CALL_TOP
  291. .long _060_imem_read_word - _FP_CALL_TOP
  292. .long _060_imem_read_long - _FP_CALL_TOP
  293. .long _060_dmem_read_byte - _FP_CALL_TOP
  294. .long _060_dmem_read_word - _FP_CALL_TOP
  295. .long _060_dmem_read_long - _FP_CALL_TOP
  296. .long _060_dmem_write_byte - _FP_CALL_TOP
  297. .long _060_dmem_write_word - _FP_CALL_TOP
  298. .long _060_dmem_write_long - _FP_CALL_TOP
  299. .long 0x00000000
  300. .long 0x00000000, 0x00000000, 0x00000000, 0x00000000
  301. |############################################################################
  302. | 060 FPSP KERNEL PACKAGE NEEDS TO GO HERE!!!
  303. #include "fpsp.sa"