summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2007-10-23 00:52:25 +0000
committergrehan <grehan@FreeBSD.org>2007-10-23 00:52:25 +0000
commit7c82e0520d2cccaccea9795bc42790dc6f4c4bdc (patch)
treeecb72ee842c84e96ad01124da67b63938338698f /sys/powerpc
parentfc684e3b3fc38f0651bdb2ae161d54f26bbdf445 (diff)
downloadFreeBSD-src-7c82e0520d2cccaccea9795bc42790dc6f4c4bdc.zip
FreeBSD-src-7c82e0520d2cccaccea9795bc42790dc6f4c4bdc.tar.gz
Cut over to ULE on PowerPC
kern/sched_ule.c - Add __powerpc__ to the list of supported architectures powerpc/conf/GENERIC - Swap SCHED_4BSD with SCHED_ULE powerpc/powerpc/genassym.c - Export TD_LOCK field of thread struct powerpc/powerpc/swtch.S - Handle new 3rd parameter to cpu_switch() by updating the old thread's lock. Note: uniprocessor-only, will require modification for MP support. powerpc/powerpc/vm_machdep.c - Set 3rd param of cpu_switch to mutex of old thread's lock, making the call a no-op. Reviewed by: marcel, jeffr (slightly older version)
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/swtch.S8
-rw-r--r--sys/powerpc/aim/vm_machdep.c2
-rw-r--r--sys/powerpc/conf/GENERIC2
-rw-r--r--sys/powerpc/powerpc/genassym.c1
-rw-r--r--sys/powerpc/powerpc/swtch.S8
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c2
6 files changed, 16 insertions, 7 deletions
diff --git a/sys/powerpc/aim/swtch.S b/sys/powerpc/aim/swtch.S
index 038e788..1a09d87 100644
--- a/sys/powerpc/aim/swtch.S
+++ b/sys/powerpc/aim/swtch.S
@@ -67,13 +67,17 @@
#include <machine/asm.h>
/*
- * void cpu_switch(struct thread *old, struct thread *new)
+ * void cpu_switch(struct thread *old,
+ * struct thread *new,
+ * struct mutex *mtx);
*
* Switch to a new thread saving the current state in the old thread.
*/
ENTRY(cpu_switch)
- lwz %r5,TD_PCB(%r3) /* Get the old thread's PCB ptr */
+ stw %r5,TD_LOCK(%r3) /* ULE: update old thread's lock */
+ /* XXX needs to change for MP */
+ lwz %r5,TD_PCB(%r3) /* Get the old thread's PCB ptr */
mr %r12,%r2
stmw %r12,PCB_CONTEXT(%r5) /* Save the non-volatile GP regs.
These can now be used for scratch */
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index 1b58c1e..1492a07 100644
--- a/sys/powerpc/aim/vm_machdep.c
+++ b/sys/powerpc/aim/vm_machdep.c
@@ -197,7 +197,7 @@ void
cpu_throw(struct thread *old, struct thread *new)
{
- cpu_switch(old, new, NULL);
+ cpu_switch(old, new, old->td_lock);
panic("cpu_throw() didn't");
}
diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC
index f99af0b..ef31949 100644
--- a/sys/powerpc/conf/GENERIC
+++ b/sys/powerpc/conf/GENERIC
@@ -30,7 +30,7 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
options POWERMAC #NewWorld Apple PowerMacs
options PSIM #GDB PSIM ppc simulator
-options SCHED_4BSD #4BSD scheduler
+options SCHED_ULE #ULE scheduler
options INET #InterNETworking
options INET6 #IPv6 communications protocols
options SCTP #Stream Control Transmission Protocol
diff --git a/sys/powerpc/powerpc/genassym.c b/sys/powerpc/powerpc/genassym.c
index 63719cc..5c276b1 100644
--- a/sys/powerpc/powerpc/genassym.c
+++ b/sys/powerpc/powerpc/genassym.c
@@ -137,6 +137,7 @@ ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
ASSYM(PCB_FPU, PCB_FPU);
+ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
ASSYM(TD_PROC, offsetof(struct thread, td_proc));
ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
diff --git a/sys/powerpc/powerpc/swtch.S b/sys/powerpc/powerpc/swtch.S
index 038e788..1a09d87 100644
--- a/sys/powerpc/powerpc/swtch.S
+++ b/sys/powerpc/powerpc/swtch.S
@@ -67,13 +67,17 @@
#include <machine/asm.h>
/*
- * void cpu_switch(struct thread *old, struct thread *new)
+ * void cpu_switch(struct thread *old,
+ * struct thread *new,
+ * struct mutex *mtx);
*
* Switch to a new thread saving the current state in the old thread.
*/
ENTRY(cpu_switch)
- lwz %r5,TD_PCB(%r3) /* Get the old thread's PCB ptr */
+ stw %r5,TD_LOCK(%r3) /* ULE: update old thread's lock */
+ /* XXX needs to change for MP */
+ lwz %r5,TD_PCB(%r3) /* Get the old thread's PCB ptr */
mr %r12,%r2
stmw %r12,PCB_CONTEXT(%r5) /* Save the non-volatile GP regs.
These can now be used for scratch */
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index 1b58c1e..1492a07 100644
--- a/sys/powerpc/powerpc/vm_machdep.c
+++ b/sys/powerpc/powerpc/vm_machdep.c
@@ -197,7 +197,7 @@ void
cpu_throw(struct thread *old, struct thread *new)
{
- cpu_switch(old, new, NULL);
+ cpu_switch(old, new, old->td_lock);
panic("cpu_throw() didn't");
}
OpenPOWER on IntegriCloud