mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
kboot: Hack for running on FreeBSD host
When we're running on a FreeBSD host, we can't open /proc/iomem. So, for now, just assume that we have 32GB of ram starting at 4GB. Sponsored by: Netflix
This commit is contained in:
parent
de1a17db89
commit
6c47abb63b
|
@ -86,6 +86,11 @@ memory_limits(void)
|
|||
committed_as <<= 10; /* Units are kB */
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Otherwise, on FreeBSD host, for testing 32GB host: */
|
||||
mem_avail = 31ul << 30; /* 31GB free */
|
||||
commit_limit = mem_avail * 9 / 10; /* 90% comittable */
|
||||
committed_as = 20ul << 20; /* 20MB used */
|
||||
}
|
||||
printf("Commit limit: %lld Committed bytes %lld Available %lld\n",
|
||||
(long long)commit_limit, (long long)committed_as,
|
||||
|
|
|
@ -286,6 +286,9 @@ populate_avail_from_iomem(void)
|
|||
fd = open("host:/proc/iomem", O_RDONLY);
|
||||
if (fd == -1) {
|
||||
printf("Can't get memory map\n");
|
||||
init_avail();
|
||||
// Hack: 32G of RAM starting at 4G
|
||||
add_avail(4ull << 30, 36ull << 30, system_ram);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue