aboutsummaryrefslogtreecommitdiff
path: root/hw/omap1.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-09-18 05:53:14 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-09-18 05:53:14 +0000
commit45416789e8ccced568a4984af61974adfbfa0f62 (patch)
tree1d1a9df1f1f6170945b889b9fc6528d41b65bbf7 /hw/omap1.c
parentbf1b00712375bea65f2254dea8281fa646eebbd5 (diff)
downloadqemu-45416789e8ccced568a4984af61974adfbfa0f62.zip
qemu-45416789e8ccced568a4984af61974adfbfa0f62.tar.gz
qemu-45416789e8ccced568a4984af61974adfbfa0f62.tar.bz2
Use range_covers_byte
Use range_covers_byte() instead of comparisons. This avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/omap1.c')
-rw-r--r--hw/omap1.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/omap1.c b/hw/omap1.c
index 1ee5514..f4966f7 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -26,6 +26,7 @@
/* We use pc-style serial ports. */
#include "pc.h"
#include "blockdev.h"
+#include "range.h"
/* Should signal the TCMI/GPMC */
uint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr)
@@ -3669,37 +3670,38 @@ static const struct dma_irq_map omap1_dma_irq_map[] = {
static int omap_validate_emiff_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
- return addr >= OMAP_EMIFF_BASE && addr < OMAP_EMIFF_BASE + s->sdram_size;
+ return range_covers_byte(OMAP_EMIFF_BASE, s->sdram_size, addr);
}
static int omap_validate_emifs_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
- return addr >= OMAP_EMIFS_BASE && addr < OMAP_EMIFF_BASE;
+ return range_covers_byte(OMAP_EMIFS_BASE, OMAP_EMIFF_BASE - OMAP_EMIFS_BASE,
+ addr);
}
static int omap_validate_imif_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
- return addr >= OMAP_IMIF_BASE && addr < OMAP_IMIF_BASE + s->sram_size;
+ return range_covers_byte(OMAP_IMIF_BASE, s->sram_size, addr);
}
static int omap_validate_tipb_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
- return addr >= 0xfffb0000 && addr < 0xffff0000;
+ return range_covers_byte(0xfffb0000, 0xffff0000 - 0xfffb0000, addr);
}
static int omap_validate_local_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
- return addr >= OMAP_LOCALBUS_BASE && addr < OMAP_LOCALBUS_BASE + 0x1000000;
+ return range_covers_byte(OMAP_LOCALBUS_BASE, 0x1000000, addr);
}
static int omap_validate_tipb_mpui_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
- return addr >= 0xe1010000 && addr < 0xe1020004;
+ return range_covers_byte(0xe1010000, 0xe1020004 - 0xe1010000, addr);
}
struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,