
1 Nov
2011
1 Nov
'11
4:28 p.m.
On Tuesday 01 November 2011 10:07:31 Matthias Weisser wrote:
--- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c
+void *os_mmap(void *addr, size_t length, int prot, int flags, int fd,
off_t offset)
+{
- return mmap((void *)addr, length, PROT_READ | PROT_WRITE,
void cast here is unnecessary
--- a/arch/sandbox/lib/board.c +++ b/arch/sandbox/lib/board.c
+static gd_t gd_mem;
i don't think this indirection is necessary. probably can replace the static gd_mem with: gd_t gd;
+#define CONFIG_SYS_SDRAM_BASE 0x20000000 ...
- mem = malloc(size);
- mem = os_mmap((void *)CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_SDRAM_SIZE,
0, 0, -1, 0);
mmap() makes no guarantee that the requested address is what you'll get back. so there's no point in having this SDRAM_BASE define. punt it and pass in NULL instead.
also, with Simon's other patch to md to use the remap func, the address of our memory backing store doesn't matter. -mike