* [Qemu-devel] dummy field in CPUTLBEntry?
@ 2010-04-16 9:00 Jun Koi
2010-04-19 22:43 ` Paul Brook
0 siblings, 1 reply; 2+ messages in thread
From: Jun Koi @ 2010-04-16 9:00 UTC (permalink / raw)
To: qemu-devel
Hi,
I find the way we calculate the dummy field in CPUTLBEntry funny. What
is the point of having:
((-sizeof(target_ulong) * 3) & (sizeof(unsigned long) - 1))
in its size? Why shouldnt it be more simple, like below?
uint8_t dummy[(1 << CPU_TLB_ENTRY_BITS) - (sizeof(target_ulong) *
3 + sizeof(unsigned long))];
Thanks,
J
typedef struct CPUTLBEntry {
/* bit TARGET_LONG_BITS to TARGET_PAGE_BITS : virtual address
bit TARGET_PAGE_BITS-1..4 : Nonzero for accesses that should not
go directly to ram.
bit 3 : indicates that the entry is invalid
bit 2..0 : zero
*/
target_ulong addr_read;
target_ulong addr_write;
target_ulong addr_code;
/* Addend to virtual address to get host address. IO accesses
use the corresponding iotlb value. */
unsigned long addend;
/* padding to get a power of two size */
uint8_t dummy[(1 << CPU_TLB_ENTRY_BITS) -
(sizeof(target_ulong) * 3 +
((-sizeof(target_ulong) * 3) & (sizeof(unsigned
long) - 1)) +
sizeof(unsigned long))];
} CPUTLBEntry;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-19 22:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16 9:00 [Qemu-devel] dummy field in CPUTLBEntry? Jun Koi
2010-04-19 22:43 ` Paul Brook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).