Commit aa02c546 authored by Suresh B. Siddha's avatar Suresh B. Siddha Committed by David Mosberger

[PATCH] ia64: 2/2 fix in machvec.h

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.
parent 5e2ccf6d
...@@ -113,6 +113,11 @@ extern void machvec_noop (void); ...@@ -113,6 +113,11 @@ extern void machvec_noop (void);
# define platofrm_mmiob ia64_mv.mmiob # define platofrm_mmiob ia64_mv.mmiob
# endif # 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 { struct ia64_machine_vector {
const char *name; const char *name;
ia64_mv_setup_t *setup; ia64_mv_setup_t *setup;
...@@ -145,7 +150,7 @@ struct ia64_machine_vector { ...@@ -145,7 +150,7 @@ struct ia64_machine_vector {
ia64_mv_outw_t *outw; ia64_mv_outw_t *outw;
ia64_mv_outl_t *outl; ia64_mv_outl_t *outl;
ia64_mv_mmiob_t *mmiob; ia64_mv_mmiob_t *mmiob;
}; } __attribute__((__aligned__(16)));
#define MACHVEC_INIT(name) \ #define MACHVEC_INIT(name) \
{ \ { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment