[Linux-ia64] [Patch] 2/2 fix in machvec.h

From: Siddha, Suresh B <suresh.b.siddha_at_intel.com>
Date: 2003-02-25 05:21:14
IA64 ABI specifies that globals > 8 bytes need to be aligned to 16 bytes. gcc doesn't follow this convention. Current kernel code will fail to work with a compiler which follows the ABI.

size of structure ia64_machine_vector is > 8 bytes and not multiple of 16 bytes. When we have CONFIG_IA64_GENERIC, each machine specific vector from different object files gets linked into a user defined section(forming array of structures). 

Now with a compiler conforming to ABI, there will be holes in this array resulting in the code failure when it goes through this array of structures.

Following patch will make the size of the structure to be multiple of 16 bytes, making both ABI confirming/non-conforming compilers happy.

thanks,
suresh

--- linux/include/asm-ia64/machvec.h~	Thu Feb 20 13:51:48 2003
+++ linux/include/asm-ia64/machvec.h	Thu Feb 20 13:59:35 2003
@@ -113,6 +113,11 @@
 #  define platofrm_mmiob        ia64_mv.mmiob
 # endif
 
+/* __attribute__((__aligned__(16))) is required to make size of the
+ * structure multiple of 16 bytes.
+ * This will fillup the holes created because of section 3.3.1 in 
+ * Software Conventions guide.
+ */
 struct ia64_machine_vector {
 	const char *name;
 	ia64_mv_setup_t *setup;
@@ -145,7 +150,7 @@
 	ia64_mv_outw_t *outw;
 	ia64_mv_outl_t *outl;
 	ia64_mv_mmiob_t *mmiob;
-};
+} __attribute__((__aligned__(16)));
 
 #define MACHVEC_INIT(name)			\
 {						\



Received on Mon Feb 24 10:21:17 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:12 EST