]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
slavio_misc: avoid structure holes spotted by pahole
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 7 Aug 2011 19:03:18 +0000 (19:03 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 21 Aug 2011 19:52:29 +0000 (19:52 +0000)
commit97bbb109b1349051390f6b2ad77b1bfb44e3d760
treed967018271fc224d84988d2e603741555e91e72e
parentf90074f49309de9dd65b978a95d10f089017960a
slavio_misc: avoid structure holes spotted by pahole

Report from pahole on amd64 host:
struct MiscState {
SysBusDevice               busdev;               /*     0  5648 */
/* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */
qemu_irq                   irq;                  /*  5648     8 */
uint32_t                   dummy;                /*  5656     4 */
uint8_t                    config;               /*  5660     1 */
uint8_t                    aux1;                 /*  5661     1 */
uint8_t                    aux2;                 /*  5662     1 */
uint8_t                    diag;                 /*  5663     1 */
uint8_t                    mctrl;                /*  5664     1 */
uint8_t                    sysctrl;              /*  5665     1 */
uint16_t                   leds;                 /*  5666     2 */

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

qemu_irq                   fdc_tc;               /*  5672     8 */

/* size: 5680, cachelines: 89 */
/* sum members: 5676, holes: 1, sum holes: 4 */
/* last cacheline: 48 bytes */
}; /* definitions: 1 */

Fix by rearranging the structure to avoid padding.

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