sun4m_iommu: avoid structure holes spotted by pahole
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 7 Aug 2011 19:09:50 +0000 (19:09 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 21 Aug 2011 19:52:32 +0000 (19:52 +0000)
commit149e1ea154efebf0b3a7aae20538ce7673d78b77
tree97ec753688ca8128d11b7b0ecb5e97058178ae50
parent07dd0035d83727ed2b1922a85cd5aea5b010025b
sun4m_iommu: avoid structure holes spotted by pahole

Report from pahole on amd64 host:
struct IOMMUState {
SysBusDevice               busdev;               /*     0  5648 */
/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
uint32_t                   regs[4096];           /*  5648 16384 */
/* --- cacheline 344 boundary (22016 bytes) was 16 bytes ago --- */
target_phys_addr_t         iostart;              /* 22032     8 */
uint32_t                   version;              /* 22040     4 */

/* XXX 4 bytes hole, try to pack */

qemu_irq                   irq;                  /* 22048     8 */

/* size: 22056, cachelines: 345 */
/* sum members: 22052, holes: 1, sum holes: 4 */
/* last cacheline: 40 bytes */
}; /* definitions: 1 */

Fix by rearranging the structure to avoid padding.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/sun4m_iommu.c