mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
panic: halt other cpus
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
#include <panic.h>
|
#include <panic.h>
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
|
#include <arch/smp.h>
|
||||||
#include <printf.h>
|
#include <printf.h>
|
||||||
#include <kernel/interrupt.h>
|
#include <kernel/interrupt.h>
|
||||||
|
|
||||||
__attribute__((noreturn)) void _panic(char *msg, context_t *ctx) {
|
__attribute__((noreturn)) void _panic(char *msg, context_t *ctx) {
|
||||||
|
interrupt_set(false);
|
||||||
printf("cpu%lu: Oops.\n", current_cpu_id());
|
printf("cpu%lu: Oops.\n", current_cpu_id());
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
@@ -12,6 +14,6 @@ __attribute__((noreturn)) void _panic(char *msg, context_t *ctx) {
|
|||||||
if (ctx)
|
if (ctx)
|
||||||
PRINT_CTX(ctx);
|
PRINT_CTX(ctx);
|
||||||
|
|
||||||
interrupt_set(false);
|
arch_smp_haltallothers();
|
||||||
for (;;);
|
for (;;);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user