Source-Changes-HG archive

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

[src/bjh21-hydra]: src/sys/arch/arm/arm32 Switch to the idle PCB in the idle ...



details:   https://anonhg.NetBSD.org/src/rev/da441e31ee17
branches:  bjh21-hydra
changeset: 538363:da441e31ee17
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Sat Oct 19 15:13:23 2002 +0000

description:
Switch to the idle PCB in the idle loop.

diffstat:

 sys/arch/arm/arm32/cpuswitch.S |  21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diffs (42 lines):

diff -r 81e58dc5d69e -r da441e31ee17 sys/arch/arm/arm32/cpuswitch.S
--- a/sys/arch/arm/arm32/cpuswitch.S    Sat Oct 19 15:12:52 2002 +0000
+++ b/sys/arch/arm/arm32/cpuswitch.S    Sat Oct 19 15:13:23 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpuswitch.S,v 1.28.2.5 2002/10/19 13:30:43 bjh21 Exp $ */
+/*     $NetBSD: cpuswitch.S,v 1.28.2.6 2002/10/19 15:13:23 bjh21 Exp $ */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -125,6 +125,23 @@
  */
 /* LINTSTUB: Ignore */
 ASENTRY_NP(idle)
+#ifdef MULTIPROCESSOR
+       /* Switch to the idle PCB unless we're already running on it. */
+       cmp     r8, #0                  /* old process was exiting? */
+       beq     1f
+
+       /* Get the user structure for the old process. */
+       ldr     r0, [r8, #(P_ADDR)]
+
+       /* Save the remaining registers in the old process's pcb */
+       add     r0, r0, #(PCB_R11)
+       stmia   r0, {r11-r13}
+1:
+       ldr     r0, [r9, #(CI_IDLEPCB)]
+       add     r0, r0, #(PCB_R11)
+       ldmia   r0, {r11-r13}
+       mov     r8, #0                  /* old process is irrelevant now */
+#endif
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
        bl      _C_LABEL(sched_unlock_idle)
 #endif
@@ -387,6 +404,8 @@
         * process that called it was exiting. This means that we do
         * not need to save the current context. Instead we can jump
         * straight to restoring the context for the new process.
+        *
+        * We also take this path if we're switching from the idle PCB.
         */
        teq     r8, #0x00000000
        beq     .Lswitch_exited



Home | Main Index | Thread Index | Old Index