Re: [patch-2.4.0-test2]Re: Linux-2.4.0-test2

From: Russell King (rmk@arm.linux.org.uk)
Date: Mon Jun 26 2000 - 14:10:30 EST


Rusty Russell writes:
> But we don't assume:
> union {
> TYPE t1;
> TYPE t2;
> TYPE t3;
> } union_TYPE;
>
> sizeof(union_TYPE) == sizeof(TYPE) because the ARM breaks this...
>
> So these `sane alignment' rules should be documented somewhere,

Same rules apply on ARM - the union is padded to the next 32-bit word
natural boundary, no matter what sizeof(TYPE) is. ie:

        sizeof(TYPE) sizeof(union_TYPE)
        1 4
        2 4
        4 4
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:09 EST