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
This commit is contained in:
Rafaël Carré 2009-06-09 00:51:30 +00:00
parent 3b0fca3c6c
commit e2f165c088
2 changed files with 2 additions and 2 deletions

View file

@ -619,7 +619,7 @@ static int sd_select_bank(signed char bank)
#define UNALIGNED_NUM_SECTORS 10 #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 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, static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
int count, void* buf, const bool write) int count, void* buf, const bool write)

View file

@ -28,7 +28,7 @@
#ifdef BOOTLOADER #ifdef BOOTLOADER
#define UNCACHED_ADDR(a) (a) #define UNCACHED_ADDR(a) (a)
#else #else
#define UNCACHED_ADDR(a) (a + 0x10000000) #define UNCACHED_ADDR(a) ((typeof(a)) ((uintptr_t)(a) + 0x10000000))
#endif #endif
#endif /* SYSTEM_TARGET_H */ #endif /* SYSTEM_TARGET_H */