summaryrefslogtreecommitdiff
path: root/system/alpha/console/dbmentry.s
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2004-09-01 00:23:00 -0400
committerAli Saidi <saidi@eecs.umich.edu>2004-09-01 00:23:00 -0400
commit1940fcdd2915697a7d213043dcd45260bf5b2eda (patch)
treefd2b7cd98c1e1114161f481ed8e2da1e6d7a8f2a /system/alpha/console/dbmentry.s
parent29c5218e4faf2b059a00b0864e6763ee18143d56 (diff)
downloadgem5-1940fcdd2915697a7d213043dcd45260bf5b2eda.tar.xz
changes to make smp work in linux
console/console.c: Remove Printed SimOS references and replace with M5 Rework the SMP stuff, so we don't trash any stacks, or what we thought were stacks, but are actually other ppls memory. console/dbmentry.s: add a carefully crafted piece of assembly that doesn't use the stack, so we don't clobber anthing in the time between when we are spinning and when the OS tells us to go. palcode/platform_m5.s: add/fix code for IPI, multiprocessor interrupts (DIR), and initial bootstrapping of the cpu
Diffstat (limited to 'system/alpha/console/dbmentry.s')
-rw-r--r--system/alpha/console/dbmentry.s31
1 files changed, 30 insertions, 1 deletions
diff --git a/system/alpha/console/dbmentry.s b/system/alpha/console/dbmentry.s
index d8741e658..7a718928b 100644
--- a/system/alpha/console/dbmentry.s
+++ b/system/alpha/console/dbmentry.s
@@ -209,5 +209,34 @@ SpinLock:
2:
br zero,1b
.end SpinLock
+
+ .globl loadContext
+ .ent loadContext 2
+loadContext:
+ .option O1
+ .frame sp, 0, ra
+ call_pal PAL_SWPCTX_ENTRY
+ ret zero, (ra)
+ .end loadContext
+
-
+ .globl SlaveSpin # Very carefully spin wait
+ .ent SlaveSpin 2 # and swap context without
+SlaveSpin: # using any stack space
+ .option O1
+ .frame sp, 0, ra
+ mov a0, t0 # cpu number
+ mov a1, t1 # cpu rpb pointer (virtual)
+ mov a2, t2 # what to spin on
+
+test: ldl t3, 0(t2)
+ beq t3, test
+ zapnot t1,0x1f,a0 # make rpb physical
+ call_pal PAL_SWPCTX_ENTRY # switch to pcb
+ mov t0, a0 # setup args for SlaveCmd
+ mov t1, a1
+ jsr SlaveCmd # call SlaveCmd
+ ret zero, (ra) # Should never be reached
+ .end SlaveSpin
+
+