Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Make sure to save the user thread point i...



details:   https://anonhg.NetBSD.org/src/rev/831b14ad698d
branches:  trunk
changeset: 336840:831b14ad698d
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Mar 22 23:17:57 2015 +0000

description:
Make sure to save the user thread point in softint_switch in case it was
set just before we got an interrupt.  Otherwise if the softint blocks, the
old value would be restored and change lost.

diffstat:

 sys/arch/arm/arm32/cpuswitch.S |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r c96478ff923a -r 831b14ad698d sys/arch/arm/arm32/cpuswitch.S
--- a/sys/arch/arm/arm32/cpuswitch.S    Sun Mar 22 22:47:43 2015 +0000
+++ b/sys/arch/arm/arm32/cpuswitch.S    Sun Mar 22 23:17:57 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpuswitch.S,v 1.85 2014/10/18 08:33:24 snj Exp $       */
+/*     $NetBSD: cpuswitch.S,v 1.86 2015/03/22 23:17:57 matt Exp $      */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -87,7 +87,7 @@
 #include <arm/asm.h>
 #include <arm/locore.h>
 
-       RCSID("$NetBSD: cpuswitch.S,v 1.85 2014/10/18 08:33:24 snj Exp $")
+       RCSID("$NetBSD: cpuswitch.S,v 1.86 2015/03/22 23:17:57 matt Exp $")
 
 /* LINTSTUB: include <sys/param.h> */
        
@@ -397,6 +397,15 @@
        stmia   r3, {r8-r13}
 #endif
 
+#ifdef _ARM_ARCH_6
+       /*
+        * Save user read/write thread/process id register in cause it was
+        * set in userland.
+        */
+       mrc     p15, 0, r0, c13, c0, 2
+       str     r0, [r5, #(PCB_USER_PID_RW)]
+#endif
+
        /* this is an invariant so load before disabling intrs */
        ldr     r2, [r5, #(L_PCB)]      /* get new lwp's pcb */
 



Home | Main Index | Thread Index | Old Index