2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
14 #include <jailhouse/printk.h>
15 #include <jailhouse/processor.h>
16 #include <jailhouse/string.h>
17 #include <asm/spinlock.h>
19 volatile unsigned long panic_in_progress;
20 unsigned int panic_cpu = -1;
22 static DEFINE_SPINLOCK(printk_lock);
24 #define console_write(msg) arch_dbg_write(msg)
25 #include "printk-core.c"
27 void printk(const char *fmt, ...)
33 spin_lock(&printk_lock);
35 spin_unlock(&printk_lock);
40 void panic_printk(const char *fmt, ...)
42 unsigned int cpu_id = phys_processor_id();
45 if (test_and_set_bit(0, &panic_in_progress) && panic_cpu != cpu_id)