-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hw: add kernel panic function to x86_64
Add a kernel panic function to x86_64 that mirrors the functionality available for ARM. Issue #5128
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* \brief x86 kernel panic | ||
* \author Benjamin Lamowski | ||
* \date 2024-02-28 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2024 Genode Labs GmbH | ||
* | ||
* This file is part of the Genode OS framework, which is distributed | ||
* under the terms of the GNU Affero General Public License version 3. | ||
*/ | ||
|
||
#ifndef _CORE__SPEC__X86_64__KERNEL__PANIC_H_ | ||
#define _CORE__SPEC__X86_64__KERNEL__PANIC_H_ | ||
|
||
/* base includes */ | ||
#include <base/log.h> | ||
|
||
namespace Kernel { | ||
template <typename... ARGS> | ||
inline void panic(ARGS &&... args) | ||
{ | ||
Genode::error("Kernel panic: ", args...); | ||
/* This is CPU local, but should be sufficient for now. */ | ||
asm volatile( | ||
"cli;" | ||
"hlt;" | ||
: : : | ||
); | ||
} | ||
} | ||
|
||
#endif /* _CORE__SPEC__X86_64__KERNEL__PANIC_H_ */ |