Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm26 Add two functions, int_off_save() and int_res...



details:   https://anonhg.NetBSD.org/src/rev/64e66d68daba
branches:  trunk
changeset: 509276:64e66d68daba
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Mon Apr 30 19:57:10 2001 +0000

description:
Add two functions, int_off_save() and int_restore(), for mcount to use to
disable interrupts without getting into a loop or screwing up irq_handler().
Also use them.

diffstat:

 sys/arch/arm26/arm26/locore.S    |  12 ++++++++++--
 sys/arch/arm26/include/profile.h |  13 ++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r 4792d62b22f1 -r 64e66d68daba sys/arch/arm26/arm26/locore.S
--- a/sys/arch/arm26/arm26/locore.S     Mon Apr 30 19:54:04 2001 +0000
+++ b/sys/arch/arm26/arm26/locore.S     Mon Apr 30 19:57:10 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.13 2001/03/08 21:30:35 bjh21 Exp $ */
+/* $NetBSD: locore.S,v 1.14 2001/04/30 19:57:10 bjh21 Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2000 Ben Harris
  * Copyright (C) 1994-1997 Mark Brinicombe
@@ -377,6 +377,14 @@
        bics    r15, r14, #(R15_IRQ_DISABLE | R15_FIQ_DISABLE)
 ENTRY(int_off)
        orrs    r15, r14, #(R15_IRQ_DISABLE)
+       /* These are used by mcount */
+ENTRY_NP(int_off_save)
+       mov     r0, r15
+       orrs    r15, r14, #(R15_IRQ_DISABLE)
+ENTRY_NP(int_restore)
+       tst     r0, #(R15_IRQ_DISABLE)  /* Were IRQs already disabled? */
+       biceqs  r15, r14, #(R15_IRQ_DISABLE)    /* No, enable again */
+       movs    r15, r14                        /* Yes, just return */
 
        /*
         * Low-level context-switch operation.  cpu_switch() is in C -- this
@@ -450,4 +458,4 @@
        .global _C_LABEL(eintrcnt)
 _C_LABEL(eintrcnt):
 
-RCSID("$NetBSD: locore.S,v 1.13 2001/03/08 21:30:35 bjh21 Exp $")
+RCSID("$NetBSD: locore.S,v 1.14 2001/04/30 19:57:10 bjh21 Exp $")
diff -r 4792d62b22f1 -r 64e66d68daba sys/arch/arm26/include/profile.h
--- a/sys/arch/arm26/include/profile.h  Mon Apr 30 19:54:04 2001 +0000
+++ b/sys/arch/arm26/include/profile.h  Mon Apr 30 19:57:10 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: profile.h,v 1.3 2001/04/26 22:09:57 bjh21 Exp $ */
+/* $NetBSD: profile.h,v 1.4 2001/04/30 19:57:11 bjh21 Exp $ */
 
 /*
  * Copyright (c) 1995-1996 Mark Brinicombe
@@ -75,10 +75,9 @@
        __asm__("ldmfd  sp!, {r0-r3, lr, pc}");
 
 #ifdef _KERNEL
-/*
- * Note that we assume splhigh() and splx() cannot call mcount()
- * recursively.
- */
-#define        MCOUNT_ENTER    s = splhigh()
-#define        MCOUNT_EXIT     splx(s)
+extern int int_off_save(void);
+extern void int_restore(int);
+#define        MCOUNT_ENTER    (s = int_off_save())
+#define        MCOUNT_EXIT     int_restore(s)
+               
 #endif /* _KERNEL */



Home | Main Index | Thread Index | Old Index