[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Boot parameter definition adjustments



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1256727317 0
# Node ID ae942a3117bb776a7822d1d0a5c55d6c8a3aa2a7
# Parent  5a224e101cb314592e1c63cb5287ad2ab970b7ab
Boot parameter definition adjustments

Consolidate the various attributes into macros, and tell the compiler
not to needlessly waste spec for aligning strings used at most once.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/include/xen/init.h |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff -r 5a224e101cb3 -r ae942a3117bb xen/include/xen/init.h
--- a/xen/include/xen/init.h    Wed Oct 28 10:54:50 2009 +0000
+++ b/xen/include/xen/init.h    Wed Oct 28 10:55:17 2009 +0000
@@ -92,30 +92,32 @@ 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 custom_param(_name, _var) \
-    static char __setup_str_##_var[] __initdata = _name; \
-    static struct kernel_param __setup_##_var __attribute_used__ \
-        __initsetup = { __setup_str_##_var, OPT_CUSTOM, &_var, 0 }
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, _var, 0 }
 #define boolean_param(_name, _var) \
-    static char __setup_str_##_var[] __initdata = _name; \
-    static struct kernel_param __setup_##_var __attribute_used__ \
-        __initsetup = { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) }
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+        { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) }
 #define invbool_param(_name, _var) \
-    static char __setup_str_##_var[] __initdata = _name; \
-    static struct kernel_param __setup_##_var __attribute_used__ \
-        __initsetup = { __setup_str_##_var, OPT_INVBOOL, &_var, sizeof(_var) }
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+        { __setup_str_##_var, OPT_INVBOOL, &_var, sizeof(_var) }
 #define integer_param(_name, _var) \
-    static char __setup_str_##_var[] __initdata = _name; \
-    static struct kernel_param __setup_##_var __attribute_used__ \
-        __initsetup = { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+        { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
 #define size_param(_name, _var) \
-    static char __setup_str_##_var[] __initdata = _name; \
-    static struct kernel_param __setup_##_var __attribute_used__ \
-        __initsetup = { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) }
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+        { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) }
 #define string_param(_name, _var) \
-    static char __setup_str_##_var[] __initdata = _name; \
-    static struct kernel_param __setup_##_var __attribute_used__ \
-        __initsetup = { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
+    __setup_str __setup_str_##_var[] = _name; \
+    __kparam __setup_##_var = \
+        { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
 
 /* Make sure obsolete cmdline params don't break the build. */
 #define __setup(_name, _fn) static void * __attribute_used__ _dummy_##_fn = _fn

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.