diff mbox

[v4,3/6] tools: add __used and enable to override

Message ID 20170115211215.17216-4-mcgrof@kernel.org
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Luis Chamberlain Jan. 15, 2017, 9:12 p.m. UTC
This adds __used, to be used later in the userspace linker-tables
sandbox. If any userspace applicaiton wants to override they can
add their own definition and then use include_next.

This definition should probably suffice for most uses cases though.

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
 tools/include/linux/compiler.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Greg KH Jan. 19, 2017, 11:02 a.m. UTC | #1
On Sun, Jan 15, 2017 at 01:12:12PM -0800, Luis R. Rodriguez wrote:
> This adds __used, to be used later in the userspace linker-tables
> sandbox. If any userspace applicaiton wants to override they can
> add their own definition and then use include_next.

I think you need a spell checker :(

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index e33fc1df3935..556c991de212 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -5,6 +5,12 @@ 
 /* The "volatile" is due to gcc bugs */
 #define barrier() __asm__ __volatile__("": : :"memory")
 
+
+/* You can override as you see fit on your userspace tool */
+#ifndef __used
+#define __used          __attribute__((__used__))
+#endif
+
 #ifndef __always_inline
 # define __always_inline	inline __attribute__((always_inline))
 #endif