mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
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>
This commit is contained in:
parent
205dd5afe5
commit
bd8b74551b
1 changed files with 6 additions and 1 deletions
|
@ -174,7 +174,12 @@ void *os_malloc(size_t length)
|
||||||
struct os_mem_hdr *hdr;
|
struct os_mem_hdr *hdr;
|
||||||
int page_size = getpagesize();
|
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,
|
PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||||
if (hdr == MAP_FAILED)
|
if (hdr == MAP_FAILED)
|
||||||
|
|
Loading…
Add table
Reference in a new issue