qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] TARGET_PAGE_BITS


From: Peter Maydell
Subject: Re: [Qemu-devel] TARGET_PAGE_BITS
Date: Fri, 23 Jun 2017 16:06:48 +0100

On 23 June 2017 at 16:02, ali saeedi <address@hidden> wrote:
> thank you for answer
> So. why do we have right shift in qemu by "TARGET_PAGE_BITS" ? for exampe
> in below code, what does it mean?
>
> static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
>                                                        ram_addr_t length)
> {
>     unsigned long end, page;
>
>     end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
>     page = start >> TARGET_PAGE_BITS;
> ...
> }

If you take an address, and you shift it right by the number
of bits in a page, you get a page number...

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]