changeset 36c59449dc93 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=36c59449dc93
description:
        change from bootStrap* to using the cpuStack array for setting up
        other processor stacks

diffstat:

 system/alpha/console/console.c  |   5 +----
 system/alpha/console/dbmentry.S |  23 +++++++++++++++++++----
 2 files changed, 20 insertions(+), 8 deletions(-)

diffs (70 lines):

diff -r 15bece33379b -r 36c59449dc93 system/alpha/console/console.c
--- a/system/alpha/console/console.c    Thu Aug 18 13:34:03 2005 -0400
+++ b/system/alpha/console/console.c    Thu Feb 23 15:00:04 2006 -0500
@@ -187,8 +187,6 @@
     m5Conf.diskOperation = m5AlphaAccess->diskOperation;
     m5Conf.outputChar = m5AlphaAccess->outputChar;
     m5Conf.inputChar = m5AlphaAccess->inputChar;
-    m5Conf.bootStrapImpure = m5AlphaAccess->bootStrapImpure;
-    m5Conf.bootStrapCPU = m5AlphaAccess->bootStrapCPU;
 
     if (m5Conf.version != ALPHA_ACCESS_VERSION)  {
         panic("Console version mismatch. Console expects %d. has %d \n",
@@ -743,8 +741,7 @@
     for (i = 1; i < m5Conf.numCPUs; i++) {
         ulong stack = (ulong)unix_boot_alloc(1);
         printf_lock("Bootstraping CPU %d with sp=0x%x\n", i, stack);
-        m5AlphaAccess->bootStrapImpure = stack;
-        m5AlphaAccess->bootStrapCPU = i;
+        m5AlphaAccess->cpuStack[i] = stack;
     }
 
     /*
diff -r 15bece33379b -r 36c59449dc93 system/alpha/console/dbmentry.S
--- a/system/alpha/console/dbmentry.S   Thu Aug 18 13:34:03 2005 -0400
+++ b/system/alpha/console/dbmentry.S   Thu Feb 23 15:00:04 2006 -0500
@@ -56,6 +56,7 @@
  */
 #include "fromHudsonOsf.h"
 
+        .extern myAlphaAccess
         .text
 
 /* return address and padding to octaword align */
@@ -68,11 +69,24 @@
         br      t0, 2f                 # get the current PC
 2:     ldgp    gp, 0(t0)               # init gp
 
-        /*
-         * SimOS. Stack pointer is start of a valid phys or KSEG page
-         */
+/* Processor 0 start stack frame is begining of physical memory (0)
+   Other processors spin here waiting to get their stacks from
+   Processor 0, then they can progress as normal.
+*/
+        call_pal PAL_WHAMI_ENTRY
+        beq v0, cpuz
+        ldq  t3, m5AlphaAccess
+        addq t3,0x70,t3 # *** If offset in console alpha access struct changes
+                        # This must be changed as well!
+        bis  zero,8,t4
+        mulq t4,v0,t4
+        addq t3,t4,t3
+cpuwait:   ldq  t4, 0(t3)
+        beq  t4, cpuwait
+        bis  t4,t4,sp
 
-        bis    sp,sp,s0 /* save sp */
+
+cpuz:  bis     sp,sp,s0 /* save sp */
 
 slave: lda     v0,(8*1024)(sp) /* end of page  */
 
@@ -96,6 +110,7 @@
  *     Every good C program has a main()
  */
 
+/* If stack pointer was 0, then this is CPU0*/
         beq    s0,master
 
         call_pal PAL_WHAMI_ENTRY
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to