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

[Xen-devel] [PATCH] common: re-arrange struct kernel_param fields



Even if placed in .init.* there's no reason to needlessly bloat the
binary due to padding fields the compiler needs to insert on 64-bit
architectures.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -81,34 +81,35 @@ struct kernel_param {
         OPT_SIZE,
         OPT_CUSTOM
     } type;
-    void *var;
     unsigned int len;
+    void *var;
 };
 
 extern struct kernel_param __setup_start, __setup_end;
 
 #define __setup_str static __initdata __attribute__((__aligned__(1))) char
-#define __kparam static __initsetup struct kernel_param
+#define __kparam static __initsetup \
+    __attribute__((__aligned__(sizeof(void *)))) struct kernel_param
 
 #define custom_param(_name, _var) \
     __setup_str __setup_str_##_var[] = _name; \
-    __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, _var, 0 }
+    __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, 0, _var }
 #define boolean_param(_name, _var) \
     __setup_str __setup_str_##_var[] = _name; \
     __kparam __setup_##_var = \
-        { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) }
+        { __setup_str_##_var, OPT_BOOL, sizeof(_var), &_var }
 #define integer_param(_name, _var) \
     __setup_str __setup_str_##_var[] = _name; \
     __kparam __setup_##_var = \
-        { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
+        { __setup_str_##_var, OPT_UINT, sizeof(_var), &_var }
 #define size_param(_name, _var) \
     __setup_str __setup_str_##_var[] = _name; \
     __kparam __setup_##_var = \
-        { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) }
+        { __setup_str_##_var, OPT_SIZE, sizeof(_var), &_var }
 #define string_param(_name, _var) \
     __setup_str __setup_str_##_var[] = _name; \
     __kparam __setup_##_var = \
-        { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) }
+        { __setup_str_##_var, OPT_STR, sizeof(_var), &_var }
 
 #endif /* __ASSEMBLY__ */
 



Attachment: setup-data-rearrange.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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