Add Klog.fatal_error()
This commit is contained in:
parent
e8978c73f2
commit
3412d9ece9
@ -120,7 +120,7 @@ struct Acpi
|
|||||||
const(XSDT) * xsdt = cast(const(XSDT) *)acpi_xsdt_phys;
|
const(XSDT) * xsdt = cast(const(XSDT) *)acpi_xsdt_phys;
|
||||||
if (xsdt.header.signature != XSDT_SIGNATURE)
|
if (xsdt.header.signature != XSDT_SIGNATURE)
|
||||||
{
|
{
|
||||||
Klog.writef("XSDT signature invalid\n");
|
Klog.fatal_error("XSDT signature invalid");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Map the entire XSDT. */
|
/* Map the entire XSDT. */
|
||||||
|
@ -6,6 +6,7 @@ module hulk.klog;
|
|||||||
import core.stdc.stdarg;
|
import core.stdc.stdarg;
|
||||||
import hulk.console;
|
import hulk.console;
|
||||||
static import hulk.writef;
|
static import hulk.writef;
|
||||||
|
import hulk.cpu;
|
||||||
|
|
||||||
struct Klog
|
struct Klog
|
||||||
{
|
{
|
||||||
@ -70,4 +71,17 @@ struct Klog
|
|||||||
writef("\n", args);
|
writef("\n", args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a fatal kernel error and loop forever.
|
||||||
|
*/
|
||||||
|
public static void fatal_error(T...)(T args)
|
||||||
|
{
|
||||||
|
writef("FATAL ERROR: ");
|
||||||
|
writefln(args);
|
||||||
|
cli();
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user