summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-09 00:51:30 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-09 00:51:30 +0000
commite2f165c088328fd17dde9026b4927851c8465640 (patch)
tree15496088f4d3794d36ade8ec92c12185c9f5c0a3
parent3b0fca3c6cc9f6faf1c8460e41d6c48b320bbdb7 (diff)
downloadrockbox-e2f165c088328fd17dde9026b4927851c8465640.zip
rockbox-e2f165c088328fd17dde9026b4927851c8465640.tar.gz
rockbox-e2f165c088328fd17dde9026b4927851c8465640.tar.bz2
rockbox-e2f165c088328fd17dde9026b4927851c8465640.tar.xz
Sansa AMS: make the UNCACHED_ADDR macro work for any type of pointer, and only use pointers with it, not arrays
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21230 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c2
-rw-r--r--firmware/target/arm/as3525/system-target.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 91d6523..488988d 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -619,7 +619,7 @@ static int sd_select_bank(signed char bank)
#define UNALIGNED_NUM_SECTORS 10
static unsigned char aligned_buffer[UNALIGNED_NUM_SECTORS* SECTOR_SIZE] __attribute__((aligned(32))); /* align on cache line size */
-static unsigned char *uncached_buffer = UNCACHED_ADDR(aligned_buffer);
+static unsigned char *uncached_buffer = UNCACHED_ADDR(&aligned_buffer[0]);
static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
int count, void* buf, const bool write)
diff --git a/firmware/target/arm/as3525/system-target.h b/firmware/target/arm/as3525/system-target.h
index daea180..eb59709 100644
--- a/firmware/target/arm/as3525/system-target.h
+++ b/firmware/target/arm/as3525/system-target.h
@@ -28,7 +28,7 @@
#ifdef BOOTLOADER
#define UNCACHED_ADDR(a) (a)
#else
-#define UNCACHED_ADDR(a) (a + 0x10000000)
+#define UNCACHED_ADDR(a) ((typeof(a)) ((uintptr_t)(a) + 0x10000000))
#endif
#endif /* SYSTEM_TARGET_H */