Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Add a special trap handler for EXC_ALI that saves d...



details:   https://anonhg.NetBSD.org/src/rev/da5f81ec11db
branches:  trunk
changeset: 480746:da5f81ec11db
user:      danw <danw%NetBSD.org@localhost>
date:      Wed Jan 19 03:28:21 2000 +0000

description:
Add a special trap handler for EXC_ALI that saves dsisr and dar

diffstat:

 sys/arch/bebox/bebox/locore.s    |  29 ++++++++++++++++++++++++++---
 sys/arch/bebox/bebox/machdep.c   |   6 +++++-
 sys/arch/macppc/macppc/locore.S  |  29 ++++++++++++++++++++++++++---
 sys/arch/macppc/macppc/machdep.c |   6 +++++-
 sys/arch/ofppc/ofppc/locore.S    |  29 ++++++++++++++++++++++++++---
 sys/arch/ofppc/ofppc/machdep.c   |   6 +++++-
 6 files changed, 93 insertions(+), 12 deletions(-)

diffs (231 lines):

diff -r 15f570ea81a4 -r da5f81ec11db sys/arch/bebox/bebox/locore.s
--- a/sys/arch/bebox/bebox/locore.s     Wed Jan 19 03:05:06 2000 +0000
+++ b/sys/arch/bebox/bebox/locore.s     Wed Jan 19 03:28:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.12 1999/12/07 16:11:48 danw Exp $ */
+/*     $NetBSD: locore.s,v 1.13 2000/01/19 03:28:23 danw Exp $ */
 /*     $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $       */
 
 /*
@@ -381,8 +381,8 @@
 
 /*
  * This code gets copied to all the trap vectors
- * (except ISI/DSI, the interrupts, and possibly the debugging traps when
- * using IPKDB).
+ * (except ISI/DSI, ALI, the interrupts, and possibly the debugging 
+ * traps when using IPKDB).
  */
        .text
        .globl  _C_LABEL(trapcode),_C_LABEL(trapsize)
@@ -403,6 +403,29 @@
 _C_LABEL(trapsize) = .-_C_LABEL(trapcode)
 
 /*
+ * For ALI: has to save DSISR and DAR
+ */
+       .globl  _C_LABEL(alitrap),_C_LABEL(alisize)
+_C_LABEL(alitrap):
+       mtsprg  1,1                     /* save SP */
+       stmw    28,tempsave(0)          /* free r28-r31 */
+       mfdar   30
+       mfdsisr 31
+       stmw    30,tempsave+16(0)
+       mflr    28                      /* save LR */
+       mfcr    29                      /* save CR */
+/* Test whether we already had PR set */
+       mfsrr1  31
+       mtcr    31
+       bc      4,17,1f                 /* branch if PSL_PR is clear */
+       lis     1,_C_LABEL(curpcb)@ha
+       lwz     1,_C_LABEL(curpcb)@l(1)
+       addi    1,1,USPACE              /* stack is top of user struct */
+1:
+       bla     s_trap
+_C_LABEL(alisize) = .-_C_LABEL(alitrap)
+
+/*
  * Similar to the above for DSI
  * Has to handle BAT spills
  * and standard pagetable spills
diff -r 15f570ea81a4 -r da5f81ec11db sys/arch/bebox/bebox/machdep.c
--- a/sys/arch/bebox/bebox/machdep.c    Wed Jan 19 03:05:06 2000 +0000
+++ b/sys/arch/bebox/bebox/machdep.c    Wed Jan 19 03:28:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.46 1999/12/18 01:37:00 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.47 2000/01/19 03:28:24 danw Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -145,6 +145,7 @@
        void *btinfo;
 {
        extern trapcode, trapsize;
+       extern alitrap, alisize;
        extern dsitrap, dsisize;
        extern isitrap, isisize;
        extern decrint, decrsize;
@@ -284,6 +285,9 @@
                         * This one is (potentially) installed during autoconf
                         */
                        break;
+               case EXC_ALI:
+                       bcopy(&alitrap, (void *)EXC_ALI, (size_t)&alisize);
+                       break;
                case EXC_DSI:
                        bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
                        break;
diff -r 15f570ea81a4 -r da5f81ec11db sys/arch/macppc/macppc/locore.S
--- a/sys/arch/macppc/macppc/locore.S   Wed Jan 19 03:05:06 2000 +0000
+++ b/sys/arch/macppc/macppc/locore.S   Wed Jan 19 03:28:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.18 1999/12/07 16:11:49 danw Exp $ */
+/*     $NetBSD: locore.S,v 1.19 2000/01/19 03:28:21 danw Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -520,8 +520,8 @@
 
 /*
  * This code gets copied to all the trap vectors
- * (except ISI/DSI, the interrupts, and possibly the debugging traps when
- * using IPKDB).
+ * (except ISI/DSI, ALI, the interrupts, and possibly the debugging 
+ * traps when using IPKDB).
  */
        .text
        .globl  _C_LABEL(trapcode),_C_LABEL(trapsize)
@@ -542,6 +542,29 @@
 _C_LABEL(trapsize) = .-_C_LABEL(trapcode)
 
 /*
+ * For ALI: has to save DSISR and DAR
+ */
+       .globl  _C_LABEL(alitrap),_C_LABEL(alisize)
+_C_LABEL(alitrap):
+       mtsprg  1,1                     /* save SP */
+       stmw    28,tempsave(0)          /* free r28-r31 */
+       mfdar   30
+       mfdsisr 31
+       stmw    30,tempsave+16(0)
+       mflr    28                      /* save LR */
+       mfcr    29                      /* save CR */
+/* Test whether we already had PR set */
+       mfsrr1  31
+       mtcr    31
+       bc      4,17,1f                 /* branch if PSL_PR is clear */
+       lis     1,_C_LABEL(curpcb)@ha
+       lwz     1,_C_LABEL(curpcb)@l(1)
+       addi    1,1,USPACE              /* stack is top of user struct */
+1:
+       bla     s_trap
+_C_LABEL(alisize) = .-_C_LABEL(alitrap)
+
+/*
  * Similar to the above for DSI
  * Has to handle BAT spills
  * and standard pagetable spills
diff -r 15f570ea81a4 -r da5f81ec11db sys/arch/macppc/macppc/machdep.c
--- a/sys/arch/macppc/macppc/machdep.c  Wed Jan 19 03:05:06 2000 +0000
+++ b/sys/arch/macppc/macppc/machdep.c  Wed Jan 19 03:28:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.63 1999/12/18 01:37:00 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.64 2000/01/19 03:28:21 danw Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -134,6 +134,7 @@
        char *args;
 {
        extern trapcode, trapsize;
+       extern alitrap, alisize;
        extern dsitrap, dsisize;
        extern isitrap, isisize;
        extern decrint, decrsize;
@@ -232,6 +233,9 @@
                         * This one is (potentially) installed during autoconf
                         */
                        break;
+               case EXC_ALI:
+                       bcopy(&alitrap, (void *)EXC_ALI, (size_t)&alisize);
+                       break;
                case EXC_DSI:
                        bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
                        break;
diff -r 15f570ea81a4 -r da5f81ec11db sys/arch/ofppc/ofppc/locore.S
--- a/sys/arch/ofppc/ofppc/locore.S     Wed Jan 19 03:05:06 2000 +0000
+++ b/sys/arch/ofppc/ofppc/locore.S     Wed Jan 19 03:28:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.13 1999/12/07 16:11:49 danw Exp $ */
+/*     $NetBSD: locore.S,v 1.14 2000/01/19 03:28:23 danw Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -443,8 +443,8 @@
 
 /*
  * This code gets copied to all the trap vectors
- * (except ISI/DSI, the interrupts, and possibly the debugging traps when
- * using IPKDB).
+ * (except ISI/DSI, ALI, the interrupts, and possibly the debugging 
+ * traps when using IPKDB).
  */
        .text
        .globl  _C_LABEL(trapcode),_C_LABEL(trapsize)
@@ -465,6 +465,29 @@
 _C_LABEL(trapsize) = .-_C_LABEL(trapcode)
 
 /*
+ * For ALI: has to save DSISR and DAR
+ */
+       .globl  _C_LABEL(alitrap),_C_LABEL(alisize)
+_C_LABEL(alitrap):
+       mtsprg  1,1                     /* save SP */
+       stmw    28,tempsave(0)          /* free r28-r31 */
+       mfdar   30
+       mfdsisr 31
+       stmw    30,tempsave+16(0)
+       mflr    28                      /* save LR */
+       mfcr    29                      /* save CR */
+/* Test whether we already had PR set */
+       mfsrr1  31
+       mtcr    31
+       bc      4,17,1f                 /* branch if PSL_PR is clear */
+       lis     1,_C_LABEL(curpcb)@ha
+       lwz     1,_C_LABEL(curpcb)@l(1)
+       addi    1,1,USPACE              /* stack is top of user struct */
+1:
+       bla     s_trap
+_C_LABEL(alisize) = .-_C_LABEL(alitrap)
+
+/*
  * Similar to the above for DSI
  * Has to handle BAT spills
  * and standard pagetable spills
diff -r 15f570ea81a4 -r da5f81ec11db sys/arch/ofppc/ofppc/machdep.c
--- a/sys/arch/ofppc/ofppc/machdep.c    Wed Jan 19 03:05:06 2000 +0000
+++ b/sys/arch/ofppc/ofppc/machdep.c    Wed Jan 19 03:28:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.49 1999/12/18 01:37:00 thorpej Exp $     */
+/*     $NetBSD: machdep.c,v 1.50 2000/01/19 03:28:23 danw Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -123,6 +123,7 @@
        char name[32];
        struct machvec *mp;
        extern trapcode, trapsize;
+       extern alitrap, alisize;
        extern dsitrap, dsisize;
        extern isitrap, isisize;
        extern decrint, decrsize;
@@ -202,6 +203,9 @@
                         * This one is (potentially) installed during autoconf
                         */
                        break;
+               case EXC_ALI:
+                       bcopy(&alitrap, (void *)EXC_ALI, (size_t)&alisize);
+                       break;
                case EXC_DSI:
                        bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize);
                        break;



Home | Main Index | Thread Index | Old Index