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/bitops.h>
18 #include <asm/spinlock.h>
20 volatile unsigned long panic_in_progress;
21 unsigned long panic_cpu = -1;
23 static DEFINE_SPINLOCK(printk_lock);
25 #define console_write(msg) arch_dbg_write(msg)
26 #include "printk-core.c"
28 void printk(const char *fmt, ...)
34 spin_lock(&printk_lock);
36 spin_unlock(&printk_lock);
41 void panic_printk(const char *fmt, ...)
43 unsigned long cpu_id = phys_processor_id();
46 if (test_and_set_bit(0, &panic_in_progress) && panic_cpu != cpu_id)