33 |
|
XDEF _Execute68kTrap |
34 |
|
XDEF _TrapHandlerAsm |
35 |
|
XDEF _ExceptionHandlerAsm |
36 |
– |
XDEF _Scod060Patch1 |
37 |
– |
XDEF _Scod060Patch2 |
38 |
– |
XDEF _ThInitFPUPatch |
36 |
|
XDEF _AsmTriggerNMI |
37 |
|
|
38 |
|
XREF _OldTrapHandler |
241 |
|
rts |
242 |
|
|
243 |
|
* |
247 |
– |
* Process Manager 68060 FPU patches |
248 |
– |
* |
249 |
– |
|
250 |
– |
_Scod060Patch1 fsave -(sp) ;Save FPU state |
251 |
– |
tst.b 2(sp) ;Null? |
252 |
– |
beq.s 1$ |
253 |
– |
fmovem.x fp0-fp7,-(sp) ;No, save FPU registers |
254 |
– |
fmove.l fpiar,-(sp) |
255 |
– |
fmove.l fpsr,-(sp) |
256 |
– |
fmove.l fpcr,-(sp) |
257 |
– |
pea -1 ;Push "FPU state saved" flag |
258 |
– |
1$ move.l d1,-(sp) |
259 |
– |
move.l d0,-(sp) |
260 |
– |
bsr.s 3$ ;Switch integer registers and stack |
261 |
– |
addq.l #8,sp |
262 |
– |
tst.b 2(sp) ;New FPU state null or "FPU state saved" flag set? |
263 |
– |
beq.s 2$ |
264 |
– |
addq.l #4,sp ;Flag set, skip it |
265 |
– |
fmove.l (sp)+,fpcr ;Restore FPU registers and state |
266 |
– |
fmove.l (sp)+,fpsr |
267 |
– |
fmove.l (sp)+,fpiar |
268 |
– |
fmovem.x (sp)+,fp0-fp7 |
269 |
– |
2$ frestore (sp)+ |
270 |
– |
movem.l (sp)+,d0-d1 |
271 |
– |
rts |
272 |
– |
|
273 |
– |
3$ move.l 4(sp),a0 ;Switch integer registers and stack |
274 |
– |
move sr,-(sp) |
275 |
– |
movem.l d2-d7/a2-a6,-(sp) |
276 |
– |
cmp.w #0,a0 |
277 |
– |
beq.s 4$ |
278 |
– |
move.l sp,(a0) |
279 |
– |
4$ move.l $36(sp),a0 |
280 |
– |
movem.l (a0)+,d2-d7/a2-a6 |
281 |
– |
move (a0)+,sr |
282 |
– |
move.l a0,sp |
283 |
– |
rts |
284 |
– |
|
285 |
– |
_Scod060Patch2 move.l d0,-(sp) ;Create 68060 null frame on stack |
286 |
– |
move.l d0,-(sp) |
287 |
– |
move.l d0,-(sp) |
288 |
– |
frestore (sp)+ ;and load it |
289 |
– |
rts |
290 |
– |
|
291 |
– |
* |
292 |
– |
* Thread Manager 68060 FPU patches |
293 |
– |
* |
294 |
– |
|
295 |
– |
_ThInitFPUPatch tst.b $40(a4) |
296 |
– |
bne.s 1$ |
297 |
– |
moveq #0,d0 ;Create 68060 null frame on stack |
298 |
– |
move.l d0,-(a3) |
299 |
– |
move.l d0,-(a3) |
300 |
– |
move.l d0,-(a3) |
301 |
– |
1$ rts |
302 |
– |
|
303 |
– |
* |
244 |
|
* Trap handler of main task |
245 |
|
* |
246 |
|
|
635 |
|
fsavepush move.l (sp),d0 ;Restore d0 |
636 |
|
move.l a0,(sp) ;Save a0 |
637 |
|
move.l usp,a0 ;Get user stack pointer |
638 |
< |
fsave -(a0) ;Push FP state |
638 |
> |
move.l #$41000000,-(a0) ;Push idle frame |
639 |
|
move.l a0,usp ;Update USP |
640 |
|
move.l (sp)+,a0 ;Restore a0 |
641 |
|
addq.l #2,2(sp) ;Skip instruction |
642 |
|
rte |
643 |
|
|
644 |
+ |
; fsave xxx(a5) |
645 |
+ |
fsavea5 move.l (sp),d0 ;Restore d0 |
646 |
+ |
move.l a0,(sp) ;Save a0 |
647 |
+ |
move.l a5,a0 ;Get base register |
648 |
+ |
add.w ([6,sp],2),a0 ;Add offset to base register |
649 |
+ |
move.l #$41000000,(a0) ;Push idle frame |
650 |
+ |
move.l (sp)+,a0 ;Restore a0 |
651 |
+ |
addq.l #4,2(sp) ;Skip instruction |
652 |
+ |
rte |
653 |
+ |
|
654 |
|
; frestore (sp)+ |
655 |
|
frestorepop move.l (sp),d0 ;Restore d0 |
656 |
|
move.l a0,(sp) ;Save a0 |
657 |
|
move.l usp,a0 ;Get user stack pointer |
658 |
< |
frestore (a0)+ ;Restore FP state |
658 |
> |
addq.l #4,a0 ;Nothing to do... |
659 |
|
move.l a0,usp ;Update USP |
660 |
|
move.l (sp)+,a0 ;Restore a0 |
661 |
|
addq.l #2,2(sp) ;Skip instruction |
662 |
|
rte |
663 |
|
|
664 |
< |
; frestore xxx(a5) +jl+ |
664 |
> |
; frestore xxx(a5) |
665 |
|
frestorea5 move.l (sp),d0 ;Restore d0 |
666 |
|
move.l a0,(sp) ;Save a0 |
717 |
– |
move.l a5,a0 ;Get base register |
718 |
– |
add.w ([6,sp],2),a0 ;Add offset to base register |
719 |
– |
frestore (a0) ;Restore FP state from (a0) |
720 |
– |
move.l (sp)+,a0 ;Restore a0 |
721 |
– |
addq.l #4,2(sp) ;Skip instruction |
722 |
– |
rte |
723 |
– |
|
724 |
– |
; fsave xxx(a5) +jl+ |
725 |
– |
fsavea5 move.l (sp),d0 ;Restore d0 |
726 |
– |
move.l a0,(sp) ;Save a0 |
727 |
– |
move.l a5,a0 ;Get base register |
728 |
– |
add.w ([6,sp],2),a0 ;Add offset to base register |
729 |
– |
fsave (a0) ;Push FP state to (a0) |
667 |
|
move.l (sp)+,a0 ;Restore a0 |
668 |
|
addq.l #4,2(sp) ;Skip instruction |
669 |
|
rte |