summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorAvi Kivity2012-10-04 12:36:04 +0200
committerAnthony Liguori2012-10-05 02:46:18 +0200
commit4be403c8158e1b6be743f0fef004310cea4e3975 (patch)
tree3f5282792a3da1214dfb4eb29aaa3004627604a6 /hw
parentfpu/softfloat.c: Return correctly signed values from uint64_to_float32 (diff)
downloadqemu-4be403c8158e1b6be743f0fef004310cea4e3975.tar.gz
qemu-4be403c8158e1b6be743f0fef004310cea4e3975.tar.xz
qemu-4be403c8158e1b6be743f0fef004310cea4e3975.zip
Make target_phys_addr_t 64 bits unconditionally
The hassle and compile time overhead of maintaining both 32-bit and 64-bit capable source isn't worth the tiny performance advantage which is seen on a minority of configurations. Switch to compiling libhw only once, with target_phys_addr_t unconditionally typedefed to uint64_t. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/hw.h2
-rw-r--r--hw/intel-hda.c8
-rw-r--r--hw/rtl8139.c6
3 files changed, 3 insertions, 13 deletions
diff --git a/hw/hw.h b/hw/hw.h
index e5cb9bf94d..16101de3ce 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -4,7 +4,7 @@
#include "qemu-common.h"
-#if defined(TARGET_PHYS_ADDR_BITS) && !defined(NEED_CPU_H)
+#if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
#include "cpu-common.h"
#endif
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 127e81888b..d8e1b23a60 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -210,13 +210,7 @@ static target_phys_addr_t intel_hda_addr(uint32_t lbase, uint32_t ubase)
{
target_phys_addr_t addr;
-#if TARGET_PHYS_ADDR_BITS == 32
- addr = lbase;
-#else
- addr = ubase;
- addr <<= 32;
- addr |= lbase;
-#endif
+ addr = ((uint64_t)ubase << 32) | lbase;
return addr;
}
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index 844f1b8c3f..b7c82ee027 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -774,11 +774,7 @@ static void rtl8139_write_buffer(RTL8139State *s, const void *buf, int size)
#define MIN_BUF_SIZE 60
static inline dma_addr_t rtl8139_addr64(uint32_t low, uint32_t high)
{
-#if TARGET_PHYS_ADDR_BITS > 32
- return low | ((target_phys_addr_t)high << 32);
-#else
- return low;
-#endif
+ return low | ((uint64_t)high << 32);
}
/* Workaround for buggy guest driver such as linux who allocates rx