Kernel: better handle kernel errors
This commit is contained in:
parent
8032824054
commit
250789aa20
|
@ -48,6 +48,11 @@ namespace BAN
|
||||||
{
|
{
|
||||||
return (Kernel::ErrorCode)(m_error_code & ~kernel_error_mask);
|
return (Kernel::ErrorCode)(m_error_code & ~kernel_error_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_kernel_error() const
|
||||||
|
{
|
||||||
|
return m_error_code & kernel_error_mask;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t get_error_code() const { return m_error_code; }
|
uint64_t get_error_code() const { return m_error_code; }
|
||||||
|
|
|
@ -186,6 +186,9 @@ namespace Kernel
|
||||||
|
|
||||||
asm volatile("cli");
|
asm volatile("cli");
|
||||||
|
|
||||||
|
if (ret.is_error() && ret.error().is_kernel_error())
|
||||||
|
Kernel::panic("Kernel error while returning to userspace {}", ret.error());
|
||||||
|
|
||||||
ASSERT(Kernel::Thread::current().state() == Kernel::Thread::State::Executing);
|
ASSERT(Kernel::Thread::current().state() == Kernel::Thread::State::Executing);
|
||||||
Thread::current().load_sse();
|
Thread::current().load_sse();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue