aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/init.h
diff options
context:
space:
mode:
authorTim Deegan <tim@xen.org>2012-04-11 13:10:33 +0100
committerTim Deegan <tim@xen.org>2012-04-11 13:10:33 +0100
commit2b7aac76417d57e336f41b6f6d5b0cb301d512f8 (patch)
tree91b0a6128dd8cf4e4f673cb91321032371641109 /xen/include/xen/init.h
parent899b4c43f687dd577d90b0a875676868b8eaa835 (diff)
downloadxen-2b7aac76417d57e336f41b6f6d5b0cb301d512f8.tar.gz
xen-2b7aac76417d57e336f41b6f6d5b0cb301d512f8.tar.bz2
xen-2b7aac76417d57e336f41b6f6d5b0cb301d512f8.zip
xen: define __section() and friends and use them for section annotations.
By itself this is just code-tidying, but it's also useful for the following patch, which will adjust __section() for clang compiles. Signed-off-by: Tim Deegan <tim@xen.org> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/include/xen/init.h')
-rw-r--r--xen/include/xen/init.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/xen/include/xen/init.h b/xen/include/xen/init.h
index f7a7dc4d9d..995bbac445 100644
--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -7,20 +7,13 @@
* Mark functions and data as being only used at initialization
* or exit time.
*/
-#define __init \
- __attribute__ ((__section__ (".init.text")))
-#define __exit \
- __attribute_used__ __attribute__ ((__section__(".exit.text")))
-#define __initdata \
- __attribute__ ((__section__ (".init.data")))
-#define __exitdata \
- __attribute_used__ __attribute__ ((__section__ (".exit.data")))
-#define __initsetup \
- __attribute_used__ __attribute__ ((__section__ (".init.setup")))
-#define __init_call(lvl) \
- __attribute_used__ __attribute__ ((__section__ (".initcall" lvl ".init")))
-#define __exit_call \
- __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
+#define __init __text_section(".init.text")
+#define __exit __text_section(".exit.text")
+#define __initdata __section(".init.data")
+#define __exitdata __used_section(".exit.data")
+#define __initsetup __used_section(".init.setup")
+#define __init_call(lvl) __used_section(".initcall" lvl ".init")
+#define __exit_call __used_section(".exitcall.exit")
/* These macros are used to mark some functions or
* initialized data (doesn't apply to uninitialized data)
@@ -95,7 +88,7 @@ struct kernel_param {
extern struct kernel_param __setup_start, __setup_end;
#define __setup_str static __initdata __attribute__((__aligned__(1))) char
-#define __kparam static __attribute_used__ __initsetup struct kernel_param
+#define __kparam static __initsetup struct kernel_param
#define custom_param(_name, _var) \
__setup_str __setup_str_##_var[] = _name; \