Port-sparc archive

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

re: partially working SMP again




oops, forgot the boot change.


.mrg.


Index: stand/boot/boot.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/boot/boot.c,v
retrieving revision 1.24
diff -p -r1.24 boot.c
*** stand/boot/boot.c   4 Mar 2007 06:00:47 -0000       1.24
--- stand/boot/boot.c   30 May 2009 02:51:46 -0000
*************** getphysmem(u_long size)
*** 163,168 ****
--- 163,188 ----
        return ((paddr_t)-1);
  }
  
+ /*
+  * Cut down version from sparc/autoconf.c.  Only has sun4/sun4c/sun4m support.
+  */
+ int
+ find_cpus(void)
+ {
+       int n;
+       int node;
+ 
+       n = 0;
+       node = findroot();
+       for (node = firstchild(node); node; node = nextsibling(node)) {
+               if (strcmp(prom_getpropstring(node, "device_type"), "cpu") != 0)
+                       continue;
+               if (n++ == 0)
+                       cpu_arch = prom_getpropint(node, "sparc-version", 7);
+       }
+       return (n);
+ }
+ 
  static int
  loadk(char *kernel, u_long *marks)
  {
*************** loadk(char *kernel, u_long *marks)
*** 170,175 ****
--- 190,196 ----
        vaddr_t va;
        paddr_t pa;
        u_long size;
+       int numcpus = find_cpus();
  
        if ((fd = open(kernel, 0)) < 0)
                return (errno ? errno : ENOENT);
*************** loadk(char *kernel, u_long *marks)
*** 193,198 ****
--- 214,221 ----
        size += BOOTINFO_SIZE;
        if (!compatmode)
                size += 512 * 1024;
+       if (numcpus > 1)
+               size += (numcpus - 1) * 512 * 1024;
  
        /* Get a physical load address */
        pa = getphysmem(size);
Index: stand/boot/version
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/boot/version,v
retrieving revision 1.19
diff -p -r1.19 version
*** stand/boot/version  11 Dec 2005 12:19:08 -0000      1.19
--- stand/boot/version  30 May 2009 02:51:46 -0000
*************** is taken as the current.
*** 18,20 ****
--- 18,21 ----
  1.13: add additional match function pointer and prom patch Cycle 5 IP
  1.14: search for physical memory segment and map to kernel's link address
  1.15: add prom patch for Krups to make sound work ( create missing node on 
buggy OF )
+ 1.16: add extra space for mapping multiprocessor cpu_info structures


Home | Main Index | Thread Index | Old Index