]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/pc/mp.c
kernel: cleanup makefile for $CONF.$O target
[plan9front.git] / sys / src / 9 / pc / mp.c
index 63fe687fa81897138955b17902d299158d30744c..382e247f7a1b592c62a82e22a0ea2c712b7643eb 100644 (file)
@@ -7,7 +7,7 @@
 #include "ureg.h"
 
 #include "mp.h"
-#include "apbootstrap.h"
+#include "apbootstrap.i"
 
 /* filled in by pcmpinit or acpiinit */
 Bus* mpbus;
@@ -198,6 +198,8 @@ mpinit(void)
        for(i=0; i<nelem(mpapic); i++){
                if((apic = mpapic[i]) == nil)
                        continue;
+               if(apic->machno >= MAXMACH)
+                       continue;
                if(ncpu <= 1)
                        break;
                if((apic->flags & (PcmpBP|PcmpEN)) == PcmpEN){
@@ -214,7 +216,7 @@ mpinit(void)
         *  set conf.copymode here if nmach > 1.
         *  Should look for an ExtINT line and enable it.
         */
-       if(X86FAMILY(m->cpuidax) == 3 || conf.nmach > 1)
+       if(m->cpuidfamily == 3 || conf.nmach > 1)
                conf.copymode = 1;
 }
 
@@ -562,7 +564,6 @@ mpintrenable(Vctl* v)
        return -1;
 }
 
-
 void
 mpshutdown(void)
 {
@@ -572,10 +573,8 @@ mpshutdown(void)
        if(m->machno != 0){
                splhi();
                arch->introff();
-               idle();
+               for(;;) idle();
        }
-
-       print("mpshutdown: active = %#8.8ux\n", active.machs);
        delay(1000);
        splhi();
 
@@ -585,24 +584,4 @@ mpshutdown(void)
        lapicicrw(0, 0x000C0000|ApicINIT);
 
        pcireset();
-       acpireset();
-       i8042reset();
-
-       /*
-        * Often the BIOS hangs during restart if a conventional 8042
-        * warm-boot sequence is tried. The following is Intel specific and
-        * seems to perform a cold-boot, but at least it comes back.
-        * And sometimes there is no keyboard...
-        *
-        * The reset register (0xcf9) is usually in one of the bridge
-        * chips. The actual location and sequence could be extracted from
-        * ACPI but why bother, this is the end of the line anyway.
-        */
-       print("no kbd; trying bios warm boot...");
-       *(ushort*)KADDR(0x472) = 0x1234;        /* BIOS warm-boot flag */
-       outb(0xCF9, 0x02);
-       outb(0xCF9, 0x06);
-
-       print("can't reset\n");
-       idle();
 }