diff options
-rw-r--r-- | arch/x86/machine/cpu.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index 1bbdc419..a5a62499 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.c @@ -25,7 +25,6 @@ #include <kern/stdint.h> #include <kern/string.h> #include <machine/acpimp.h> -#include <machine/atomic.h> #include <machine/biosmem.h> #include <machine/boot.h> #include <machine/cpu.h> @@ -90,8 +89,6 @@ static struct cpu_gate_desc cpu_idt[CPU_IDT_SIZE] __aligned(8); static unsigned long cpu_double_fault_handler; static char cpu_double_fault_stack[STACK_SIZE] __aligned(DATA_ALIGN); -static volatile unsigned long cpu_nr_halts; - static void cpu_seg_set_null(char *table, unsigned int selector) { @@ -575,7 +572,6 @@ cpu_ap_sync(void) void cpu_halt_broadcast(void) { - unsigned long nr_halts; unsigned int nr_cpus; assert(!cpu_intr_enabled()); @@ -585,18 +581,7 @@ cpu_halt_broadcast(void) if (nr_cpus == 1) return; - nr_halts = atomic_cas(&cpu_nr_halts, 0, nr_cpus - 1); - - /* Another CPU has started a halt, emulate the IPI handler */ - if (nr_halts != 0) { - atomic_add(&cpu_nr_halts, -1); - cpu_halt(); - } - lapic_ipi_broadcast(TRAP_CPU_HALT); - - while (cpu_nr_halts != 0) - cpu_pause(); } void @@ -606,6 +591,5 @@ cpu_halt_intr(struct trap_frame *frame) lapic_eoi(); - atomic_add(&cpu_nr_halts, -1); cpu_halt(); } |