aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-06-17 08:57:43 -0600
committerSimon Glass <sjg@chromium.org>2018-11-14 09:16:27 -0800
commitbd8b74551b64e740ca27510406d26bd82ae74c38 (patch)
treeb82a0800a5d638aa2f6a31f8c171e23ec3304a68
parent205dd5afe59db2a471b756fa04c30232fa29e5c6 (diff)
downloadu-boot-bd8b74551b64e740ca27510406d26bd82ae74c38.zip
u-boot-bd8b74551b64e740ca27510406d26bd82ae74c38.tar.gz
u-boot-bd8b74551b64e740ca27510406d26bd82ae74c38.tar.bz2
sandbox: Try to start the RAM buffer at a particular address
Use a starting address of 256MB which should be available. This helps to make sandbox RAM buffers pointers more recognisable. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/sandbox/cpu/os.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 07e4647..325ded5 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -174,7 +174,12 @@ void *os_malloc(size_t length)
struct os_mem_hdr *hdr;
int page_size = getpagesize();
- hdr = mmap(NULL, length + page_size,
+ /*
+ * Use an address that is hopefully available to us so that pointers
+ * to this memory are fairly obvious. If we end up with a different
+ * address, that's fine too.
+ */
+ hdr = mmap((void *)0x10000000, length + page_size,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (hdr == MAP_FAILED)