diff options
author | Laszlo Ersek | 2014-05-20 13:39:43 +0200 |
---|---|---|
committer | Luiz Capitulino | 2014-06-11 16:10:28 +0200 |
commit | 22227f121bddb038a0335cf83a3c24f451e2e836 (patch) | |
tree | f4e17b92e8ac0b629e89c4bba3cd42bf88c22a04 /include | |
parent | dump: simplify write_start_flat_header() (diff) | |
download | qemu-22227f121bddb038a0335cf83a3c24f451e2e836.tar.gz qemu-22227f121bddb038a0335cf83a3c24f451e2e836.tar.xz qemu-22227f121bddb038a0335cf83a3c24f451e2e836.zip |
dump: eliminate DumpState.page_shift ("guest's page shift")
Just use TARGET_PAGE_BITS.
"DumpState.page_shift" used to have type "uint32_t", while the replacement
TARGET_PAGE_BITS has type "int". Since "DumpState.page_shift" was only
used as bit shift counts in the paddr_to_pfn() and pfn_to_paddr() macros,
this is safe.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/dump.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index efab7a32f3..12af557b55 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -22,10 +22,10 @@ #define ARCH_PFN_OFFSET (0) -#define paddr_to_pfn(X, page_shift) \ - (((unsigned long long)(X) >> (page_shift)) - ARCH_PFN_OFFSET) -#define pfn_to_paddr(X, page_shift) \ - (((unsigned long long)(X) + ARCH_PFN_OFFSET) << (page_shift)) +#define paddr_to_pfn(X) \ + (((unsigned long long)(X) >> TARGET_PAGE_BITS) - ARCH_PFN_OFFSET) +#define pfn_to_paddr(X) \ + (((unsigned long long)(X) + ARCH_PFN_OFFSET) << TARGET_PAGE_BITS) /* * flag for compressed format |