mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
kboot: Use is_linux_error to check mmap return error
Rather than checking against the (incorrect) -511, use the is_linux_error() function to check to see if host_mmap failed. Sponsored by: Netflix
This commit is contained in:
parent
a9cd3b675e
commit
d75524b3fe
|
@ -232,7 +232,7 @@ caddr_t ptov(uintptr_t pa)
|
||||||
* the raw system call we have to do that ourselves.
|
* the raw system call we have to do that ourselves.
|
||||||
*/
|
*/
|
||||||
va = host_mmap(0, PAGE, HOST_PROT_READ, HOST_MAP_SHARED, smbios_fd, pa2);
|
va = host_mmap(0, PAGE, HOST_PROT_READ, HOST_MAP_SHARED, smbios_fd, pa2);
|
||||||
if ((intptr_t)va < 0 && (intptr_t)va >= -511)
|
if (is_linux_error((long)va))
|
||||||
panic("smbios mmap offset %#jx failed", (uintmax_t)pa2);
|
panic("smbios mmap offset %#jx failed", (uintmax_t)pa2);
|
||||||
m = &map[nmap++];
|
m = &map[nmap++];
|
||||||
m->pa = pa2;
|
m->pa = pa2;
|
||||||
|
|
Loading…
Reference in a new issue