-/* $OpenBSD: locore.s,v 1.9 1997/02/03 15:54:43 deraadt Exp $ */
-/* $NetBSD: locore.s,v 1.62 1996/11/06 20:19:30 cgd Exp $ */
+/* $OpenBSD: locore.s,v 1.10 1997/02/05 17:30:23 downsj Exp $ */
+/* $NetBSD: locore.s,v 1.63 1997/02/02 07:55:52 thorpej Exp $ */
/*
* Copyright (c) 1997 Theo de Raadt
jbsr _longjmp | longjmp(nofault)
Lberr:
#if defined(M68040)
+#if defined(M68020) || defined(M68030)
cmpl #MMU_68040,_mmutype | 68040?
jne _addrerr | no, skip
+#endif
clrl sp@- | stack adjust count
moveml #0xFFFF,sp@- | save user registers
movl usp,a0 | save the user SP
movl a0,sp@(FR_SP) | in the savearea
lea sp@(FR_HW),a1 | grab base of HW berr frame
#if defined(M68040)
+#if defined(M68020) || defined(M68030)
cmpl #MMU_68040,_mmutype | 68040?
jne Lbenot040 | no, skip
+#endif
movl a1@(8),sp@- | yes, push fault address
clrl sp@- | no SSW for address fault
jra Lisaerr | go deal with it
cmpw #12,d0 | address error vector?
jeq Lisaerr | yes, go to it
#if defined(M68K_MMU_MOTOROLA)
+#if defined(M68K_MMU_HP)
tstl _mmutype | HP MMU?
jeq Lbehpmmu | yes, skip
+#endif
movl d1,a0 | fault address
movl sp@,d0 | function code from ssw
btst #8,d0 | data fault?
/*
* FP exceptions.
*/
-_fpfline:
+_fpfline: /* XXXthorpej - candidate for vector patch */
#if defined(M68040)
cmpw #0x202c,sp@(6) | format type 2?
jne _illinst | no, not an FP emulation
jra _illinst
#endif
-_fpunsupp:
+_fpunsupp: /* XXXthorpej - candidate for vector patch */
#if defined(M68040)
cmpl #MMU_68040,_mmutype | 68040?
jne _illinst | no, treat as illinst
lea tmpstk,sp | now goto a tmp stack for NMI
#if defined(M68040)
+#if defined(M68020) || defined(M68030)
cmpl #MMU_68040,_mmutype | 68040?
jne Lres1a | no, skip
+#endif
.word 0xf518 | yes, pflusha
movl a1@(PCB_USTP),d0 | get USTP
moveq #PGSHIFT,d1
movl #CACHE_CLR,d0
movc d0,cacr | invalidate cache(s)
#if defined(M68K_MMU_MOTOROLA)
+#if defined(M68K_MMU_HP)
tstl _mmutype | HP MMU?
jeq Lhpmmu4 | yes, skip
+#endif
pflusha | flush entire TLB
movl a1@(PCB_USTP),d0 | get USTP
moveq #PGSHIFT,d1
tstb a0@ | null state frame?
jeq Lresfprest | yes, easy
#if defined(M68040)
+#if defined(M68020) || defined(M68030)
cmpl #MMU_68040,_mmutype | 68040?
jne Lresnot040 | no, skip
+#endif
clrl sp@- | yes...
frestore sp@+ | ...magic!
Lresnot040: