mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 16:14:13 +00:00
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
This commit is contained in:
parent
5049f03f5b
commit
dbd070b815
34
repos/base-hw/src/core/spec/x86_64/kernel/panic.h
Normal file
34
repos/base-hw/src/core/spec/x86_64/kernel/panic.h
Normal file
@ -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_ */
|
Loading…
x
Reference in New Issue
Block a user