WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] boot parameter definition adjustments

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] boot parameter definition adjustments
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 27 Oct 2009 13:07:22 +0000
Delivery-date: Tue, 27 Oct 2009 06:09:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] boot parameter definition adjustments, Jan Beulich <=