mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 10:40:39 +09:00
Kernel: Reset on panic in self-test mode
This makes a kernel panic immediately fail the on-target CI job. Otherwise the failed job looks like a test timeout unless one digs into the details of the job.
This commit is contained in:
parent
466e2a2fb7
commit
6b606771b5
Notes:
sideshowbarker
2024-07-18 08:21:06 +09:00
Author: https://github.com/alimpfard
Commit: 6b606771b5
Pull-request: https://github.com/SerenityOS/serenity/pull/9007
1 changed files with 15 additions and 2 deletions
|
@ -6,16 +6,29 @@
|
||||||
|
|
||||||
#include <AK/Format.h>
|
#include <AK/Format.h>
|
||||||
#include <Kernel/Arch/x86/Processor.h>
|
#include <Kernel/Arch/x86/Processor.h>
|
||||||
|
#include <Kernel/CommandLine.h>
|
||||||
#include <Kernel/KSyms.h>
|
#include <Kernel/KSyms.h>
|
||||||
#include <Kernel/Panic.h>
|
#include <Kernel/Panic.h>
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
[[noreturn]] static void __reset()
|
||||||
|
{
|
||||||
|
// FIXME: This works for i686/x86_64, but needs to be ported to any other arch when needed.
|
||||||
|
asm(
|
||||||
|
"lidt 0\n"
|
||||||
|
"movl $0, 0\n");
|
||||||
|
|
||||||
|
__builtin_unreachable();
|
||||||
|
}
|
||||||
|
|
||||||
void __panic(const char* file, unsigned int line, const char* function)
|
void __panic(const char* file, unsigned int line, const char* function)
|
||||||
{
|
{
|
||||||
critical_dmesgln("at {}:{} in {}", file, line, function);
|
critical_dmesgln("at {}:{} in {}", file, line, function);
|
||||||
dump_backtrace();
|
dump_backtrace();
|
||||||
Processor::halt();
|
if (kernel_command_line().boot_mode() == BootMode::SelfTest)
|
||||||
|
__reset();
|
||||||
|
else
|
||||||
|
Processor::halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue