aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2014-05-20 13:39:43 +0200
committerLuiz Capitulino <lcapitulino@redhat.com>2014-06-11 10:10:28 -0400
commit22227f121bddb038a0335cf83a3c24f451e2e836 (patch)
treef4e17b92e8ac0b629e89c4bba3cd42bf88c22a04 /include
parent92ba1401e0f81ea170803045c1ae366bf5d9d87e (diff)
downloadqemu-22227f121bddb038a0335cf83a3c24f451e2e836.zip
qemu-22227f121bddb038a0335cf83a3c24f451e2e836.tar.gz
qemu-22227f121bddb038a0335cf83a3c24f451e2e836.tar.bz2
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.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
index efab7a3..12af557 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