[PATCH v1 2/7] tools: add a basic tools printk.h
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: acme@xxxxxxxxxx, hpa@xxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, jpoimboe@xxxxxxxxxx, bp@xxxxxxxxx, linux@xxxxxxxxxxxxxxxx, mhiramat@xxxxxxxxxx, masami.hiramatsu.pt@xxxxxxxxxxx, jbaron@xxxxxxxxxx, heiko.carstens@xxxxxxxxxx, ananth@xxxxxxxxxxxxxxxxxx, anil.s.keshavamurthy@xxxxxxxxx, davem@xxxxxxxxxxxxx, realmz6@xxxxxxxxx
- Subject: [PATCH v1 2/7] tools: add a basic tools printk.h
- From: mcgrof@xxxxxxxxxx
- Date: Fri, 19 Aug 2016 14:41:10 -0700
- Cc: x86@xxxxxxxxxx, luto@xxxxxxxxxxxxxx, keescook@xxxxxxxxxxxx, torvalds@xxxxxxxxxxxxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, rusty@xxxxxxxxxxxxxxx, gnomes@xxxxxxxxxxxxxxxxxxx, alan@xxxxxxxxxxxxxxx, dwmw2@xxxxxxxxxxxxx, arnd@xxxxxxxx, ming.lei@xxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, ananth@xxxxxxxxxx, pebolle@xxxxxxxxxx, fontana@xxxxxxxxxxxxxxx, david.vrabel@xxxxxxxxxx, konrad.wilk@xxxxxxxxxx, mcb30@xxxxxxxx, jgross@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, andriy.shevchenko@xxxxxxxxxxxxxxx, paul.gortmaker@xxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, ak@xxxxxxxxxxxxxxx, pali.rohar@xxxxxxxxx, dvhart@xxxxxxxxxxxxx, platform-driver-x86@xxxxxxxxxxxxxxx, mmarek@xxxxxxxx, linux@xxxxxxxxxxxxxxxxxx, jkosina@xxxxxxx, korea.drzix@xxxxxxxxx, linux-kbuild@xxxxxxxxxxxxxxx, tony.luck@xxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, catalin.marinas@xxxxxxx, will.deacon@xxxxxxx, rostedt@xxxxxxxxxxx, jani.nikula@xxxxxxxxx, mchehab@xxxxxxxxxxxxxxx, markus.heiser@xxxxxxxxxxx, jolsa@xxxxxxxxxx, msalter@xxxxxxxxxx, chris@xxxxxxxxxx, jcmvbkbc@xxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, mpe@xxxxxxxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx>
- In-reply-to: <1471642875-5957-1-git-send-email-mcgrof@kernel.org>
- References: <1471642454-5679-1-git-send-email-mcgrof@kernel.org> <1471642875-5957-1-git-send-email-mcgrof@kernel.org>
From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxx>
This will be used later by the userspace linker-tables sandbox.
Since upstream kernel.h includes printk.h mimic this so we can
match and replicate C code as-is on userspace sandbox tools.
Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxx>
---
tools/include/linux/kernel.h | 1 +
tools/include/linux/printk.h | 14 ++++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 tools/include/linux/printk.h
diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h
index 3d385a6d4fc1..afdf760bf35c 100644
--- a/tools/include/linux/kernel.h
+++ b/tools/include/linux/kernel.h
@@ -6,6 +6,7 @@
#include <assert.h>
#include <linux/bug.h>
+#include <linux/printk.h>
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
diff --git a/tools/include/linux/printk.h b/tools/include/linux/printk.h
new file mode 100644
index 000000000000..7e34e9c817e8
--- /dev/null
+++ b/tools/include/linux/printk.h
@@ -0,0 +1,14 @@
+#ifndef __TOOLS_KERNEL_PRINTK__
+#define __TOOLS_KERNEL_PRINTK__
+
+#include <stdio.h>
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_info(fmt, ...) printf(pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_err(fmt, ...) printf(pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_debug(fmt, ...) printf(pr_fmt(fmt), ##__VA_ARGS__)
+
+#endif /* __TOOLS_KERNEL_PRINTK__ */
--
2.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]