]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ia64: 2/2 fix in machvec.h
authorSuresh B. Siddha <suresh.b.siddha@intel.com>
Tue, 4 Mar 2003 06:55:41 +0000 (22:55 -0800)
committerDavid Mosberger <davidm@tiger.hpl.hp.com>
Tue, 4 Mar 2003 06:55:41 +0000 (22:55 -0800)
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.

include/asm-ia64/machvec.h

index c9ce02715fdd36d195d6409a7ec4b07bbc1b86cb..cd5e9cbc8b4f61056aa367da385a5174dc6127bf 100644 (file)
@@ -113,6 +113,11 @@ extern void machvec_noop (void);
 #  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 @@ struct ia64_machine_vector {
        ia64_mv_outw_t *outw;
        ia64_mv_outl_t *outl;
        ia64_mv_mmiob_t *mmiob;
-};
+} __attribute__((__aligned__(16)));
 
 #define MACHVEC_INIT(name)                     \
 {                                              \