From: Mike Frysinger Date: Tue, 1 Nov 2011 11:28:55 -0400 Subject: [U-Boot] [PATCH] sandbox: Add improved RAM simulation In-Reply-To: <1320156451-8961-1-git-send-email-weisserm@arcor.de> References: <1320156451-8961-1-git-send-email-weisserm@arcor.de> Message-ID: <201111011128.56191.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20111101/4c9c0588/attachment.pgp