]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/kern/ia32/kernel_thread-ia32.cpp
update
[l4.git] / kernel / fiasco / src / kern / ia32 / kernel_thread-ia32.cpp
index f17b89d57ef83bf470555f34ad660b0afda9a7b3..fe6fcf6a4981e96291be6cb078ac54ca269701ee 100644 (file)
@@ -2,11 +2,11 @@
 IMPLEMENTATION[ia32,amd64]:
 
 #include "apic.h"
-#include "cmdline.h"
 #include "config.h"
 #include "cpu.h"
 #include "io_apic.h"
 #include "irq_chip.h"
+#include "koptions.h"
 #include "mem_layout.h"
 #include "pic.h"
 #include "profile.h"
@@ -37,14 +37,14 @@ Kernel_thread::bootstrap_arch()
   //
   // initialize interrupts
   //
-  if (!Io_apic::apic())
+  if (!Io_apic::active())
     {
       Irq_chip::hw_chip->reserve(2);           // reserve cascade irq
       Pic::enable_locked(2);                   // allow cascaded irqs
     }
 
   // initialize the profiling timer
-  bool user_irq0 = strstr (Cmdline::cmdline(), "irq0");
+  bool user_irq0 = Koptions::o()->opt(Koptions::F_irq0);
 
   if (Config::scheduler_mode == Config::SCHED_PIT && user_irq0)
     panic("option -irq0 not possible since irq 0 is used for scheduling");
@@ -52,19 +52,19 @@ Kernel_thread::bootstrap_arch()
   if (Config::profiling)
     {
       if (user_irq0)
-       panic("options -profile and -irq0 don't mix");
+       panic("options -profile and -irq0 don't mix");
       if (Config::scheduler_mode == Config::SCHED_PIT)
        panic("option -profile' not available since PIT is used as "
               "source for timer tick");
 
       Irq_chip::hw_chip->reserve(0); // reserve IRQ 0
       Profile::init();
-      if (strstr (Cmdline::cmdline(), " -profstart"))
+      if (Koptions::o()->opt(Koptions::F_profstart))
         Profile::start();
     }
   else
     {
-      if (!Io_apic::apic() && !user_irq0
+      if (!Io_apic::active() && !user_irq0
           && !Config::scheduler_mode == Config::SCHED_PIT)
        Irq_chip::hw_chip->reserve(0); // reserve irq0 even though
     }
@@ -111,6 +111,11 @@ IMPLEMENTATION [mp]:
 static void
 Kernel_thread::boot_app_cpus()
 {
+  // sending (INIT-)IPIs on non-MP systems might not work
+  if (   Cpu::boot_cpu()->vendor() == Cpu::Vendor_amd
+      && Cpu::amd_cpuid_mnc() < 2)
+    return;
+
   // where to start the APs for detection of the APIC-IDs
   extern char _tramp_mp_entry[];
 
@@ -144,5 +149,4 @@ Kernel_thread::boot_app_cpus()
 
   // Send IPI-Sequency to startup the APs
   Apic::mp_startup(Cpu::boot_cpu(), Apic::APIC_IPI_OTHERS, tramp_page);
-
 }