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

[Xen-devel] [PATCH] 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>

--- 2009-09-21.orig/xen/include/xen/init.h      2009-08-31 15:09:04.000000000 
+0200
+++ 2009-09-21/xen/include/xen/init.h   2009-09-22 15:06:06.000000000 +0200
@@ -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



Attachment: xen-setup-strings-align-1.patch
Description: Text document

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

 


Rackspace

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