diff options
Diffstat (limited to 'sys/arch/amd64/amd64/machdep.c')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 809eb27..f73d773 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -43,6 +43,7 @@ #include <machine/cpu.h> #include <machine/uart.h> #include <machine/cpuid.h> +#include <machine/sysvec.h> #include <dev/pci/pci.h> #include <vm/vm.h> #include <vm/dynalloc.h> @@ -62,6 +63,13 @@ __KERNEL_META("$Hyra$: machdep.c, Ian Marco Moffett, " void syscall_isr(void); +__attr(interrupt) +static void +halt_isr(void *sf) +{ + processor_halt(); +} + static inline void init_tss(struct cpu_info *cur_cpu) { @@ -88,6 +96,7 @@ interrupts_init(void) idt_set_desc(0xD, IDT_TRAP_GATE_FLAGS, ISR(general_prot), 0); idt_set_desc(0xE, IDT_TRAP_GATE_FLAGS, ISR(page_fault), 0); idt_set_desc(0x80, IDT_INT_GATE_USER, ISR(syscall_isr), 0); + idt_set_desc(SYSVEC_HLT, IDT_INT_GATE_FLAGS, ISR(halt_isr), 0); idt_load(); } @@ -209,6 +218,12 @@ backtrace(void) } } +void +cpu_halt_others(void) +{ + lapic_send_ipi(0, IPI_SHORTHAND_OTHERS, SYSVEC_HLT); +} + int processor_init_pcb(struct proc *proc) { |