Unify panic handling in a single location.

Change-Id: Ia5b0dd7c04b87ba87b190dfdc288fcaf92110091
diff --git a/src/main.c b/src/main.c
index a537304..02fc0a8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,7 +16,6 @@
 
 #include <stdalign.h>
 #include <stddef.h>
-#include <stdnoreturn.h>
 
 #include "hf/arch/init.h"
 #include "hf/arch/std.h"
@@ -29,6 +28,7 @@
 #include "hf/load.h"
 #include "hf/mm.h"
 #include "hf/mpool.h"
+#include "hf/panic.h"
 #include "hf/vm.h"
 
 #include "vmapi/hf/call.h"
@@ -38,29 +38,6 @@
 					       HEAP_PAGES];
 
 /**
- * Blocks the hypervisor.
- *
- * TODO: Determine if we want to omit strings on non-debug builds.
- */
-noreturn void panic(const char *fmt, ...)
-{
-	va_list args;
-
-	/* TODO: Block all CPUs. */
-
-	dlog("Panic: ");
-
-	va_start(args, fmt);
-	vdlog(fmt, args);
-	va_end(args);
-
-	dlog("\n");
-
-	for (;;) {
-	}
-}
-
-/**
  * Performs one-time initialisation of the hypervisor.
  */
 static void one_time_init(void)