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"
//
// 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");
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
}
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[];
// Send IPI-Sequency to startup the APs
Apic::mp_startup(Cpu::boot_cpu(), Apic::APIC_IPI_OTHERS, tramp_page);
-
}