« Previous | Next » 

Revision 38bee5dc

ID38bee5dc94ee355640b030d28f311b03ee2f13d1

Added by Stefano Stabellini almost 13 years ago

exec.c: refactor cpu_physical_memory_map

Introduce qemu_ram_ptr_length that takes an address and a size as
parameters rather than just an address.

Refactor cpu_physical_memory_map so that we call qemu_ram_ptr_length only
once rather than calling qemu_get_ram_ptr one time per page.
This is not only more efficient but also tries to simplify the logic of
the function.
Currently we are relying on the fact that all the pages are mapped
contiguously in qemu's address space: we have a check to make sure that
the virtual address returned by qemu_get_ram_ptr from the second call on
is consecutive. Now we are making this more explicit replacing all the
calls to qemu_get_ram_ptr with a single call to qemu_ram_ptr_length
passing a size argument.

Signed-off-by: Stefano Stabellini <>
CC:
CC:
Signed-off-by: Alexander Graf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences