aboutsummaryrefslogtreecommitdiff
path: root/mirai/crimson/panic/halt.zig
blob: 55d7966c1d0c2de671e4fb22349fd4709b0ca64a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! Halt All CPUs

const asm_cpu = @import("../../asm/cpu/cpu.zig");

pub fn halt_all() noreturn {
    asm_cpu.disable_interrupts();
    asm_cpu.halt_loop();
}

pub fn halt_current() noreturn {
    asm_cpu.disable_interrupts();
    asm_cpu.halt_loop();
}

pub fn send_halt_ipi() void {
    // TODO: Send IPI to all other cores to halt them
}

pub fn wait_for_other_cpus() void {
    // TODO: Wait for all other CPUs to acknowledge halt
}