[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] dummy field in CPUTLBEntry?
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] dummy field in CPUTLBEntry? |
Date: |
Mon, 19 Apr 2010 23:43:26 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.33-2-amd64; KDE/4.3.4; x86_64; ; ) |
> 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))];
>
No, because of alignment.
Consider the case of 32-bit target_ulong and 64-bit unsigned long).
Paul