From mboxrd@z Thu Jan 1 00:00:00 1970 From: mcgrof@kernel.org Subject: [PATCH v1 2/7] tools: add a basic tools printk.h Date: Fri, 19 Aug 2016 14:41:10 -0700 Message-ID: <1471642875-5957-3-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> Return-path: In-Reply-To: <1471642875-5957-1-git-send-email-mcgrof@kernel.org> Sender: platform-driver-x86-owner@vger.kernel.org To: acme@redhat.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, jpoimboe@redhat.com, bp@alien8.de, linux@arm.linux.org.uk, mhiramat@kernel.org, masami.hiramatsu.pt@hitachi.com, jbaron@akamai.com, heiko.carstens@de.ibm.com, ananth@linux.vnet.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, realmz6@gmail.com Cc: x86@kernel.org, luto@amacapital.net, keescook@chromium.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, rusty@rustcorp.com.au, gnomes@lxorguk.ukuu.org.uk, alan@linux.intel.com, dwmw2@infradead.org, arnd@arndb.de, ming.lei@canonical.com, linux-arch@vger.kernel.org, benh@kernel.crashing.org, ananth@in.ibm.com, pebolle@tiscali.nl, fontana@sharpeleven.org, david.vrabel@citrix.com, konrad.wilk@oracle.com, mcb30@ipxe.org, jgross@suse.com, andrew.cooper3@citrix.com, andriy.shevchenko@linux.intel.com, paul.gortmaker@windriver.com, xen-devel@lists.xensource.com, ak@linux.intel.com, pali.rohar@gmail.com, dvhart@infradead.org, platform-driver-x86@vger.kernel.org, mmarek@suse.com, linux@rasmusvillemoes.dk, jkosina@suse.cz, korea.drzix@gmail.com, linux-kbuild@vger.kernel.org, ton List-Id: linux-arch.vger.kernel.org From: "Luis R. Rodriguez" 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 --- 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 #include +#include #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 + +#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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.136]:43306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755486AbcHSVla (ORCPT ); Fri, 19 Aug 2016 17:41:30 -0400 From: mcgrof@kernel.org Subject: [PATCH v1 2/7] tools: add a basic tools printk.h Date: Fri, 19 Aug 2016 14:41:10 -0700 Message-ID: <1471642875-5957-3-git-send-email-mcgrof@kernel.org> 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> Sender: linux-arch-owner@vger.kernel.org List-ID: To: acme@redhat.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, jpoimboe@redhat.com, bp@alien8.de, linux@arm.linux.org.uk, mhiramat@kernel.org, masami.hiramatsu.pt@hitachi.com, jbaron@akamai.com, heiko.carstens@de.ibm.com, ananth@linux.vnet.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, realmz6@gmail.com Cc: x86@kernel.org, luto@amacapital.net, keescook@chromium.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, rusty@rustcorp.com.au, gnomes@lxorguk.ukuu.org.uk, alan@linux.intel.com, dwmw2@infradead.org, arnd@arndb.de, ming.lei@canonical.com, linux-arch@vger.kernel.org, benh@kernel.crashing.org, ananth@in.ibm.com, pebolle@tiscali.nl, fontana@sharpeleven.org, david.vrabel@citrix.com, konrad.wilk@oracle.com, mcb30@ipxe.org, jgross@suse.com, andrew.cooper3@citrix.com, andriy.shevchenko@linux.intel.com, paul.gortmaker@windriver.com, xen-devel@lists.xensource.com, ak@linux.intel.com, pali.rohar@gmail.com, dvhart@infradead.org, platform-driver-x86@vger.kernel.org, mmarek@suse.com, linux@rasmusvillemoes.dk, jkosina@suse.cz, korea.drzix@gmail.com, linux-kbuild@vger.kernel.org, tony.luck@intel.com, akpm@linux-foundation.org, linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, rostedt@goodmis.org, jani.nikula@intel.com, mchehab@osg.samsung.com, markus.heiser@darmarit.de, jolsa@kernel.org, msalter@redhat.com, chris@zankel.net, jcmvbkbc@gmail.com, linux-xtensa@linux-xtensa.org, paulus@samba.org, mpe@ellerman.id.au, James.Bottomley@HansenPartnership.com, "Luis R. Rodriguez" Message-ID: <20160819214110.dOT7hE6otJyc8u5xwCNP0dCrbRL3leiVaO3UwNqsE_c@z> From: "Luis R. Rodriguez" 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 --- 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 #include +#include #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 + +#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