MCPcopy Create free account
hub / github.com/coreboot/coreboot / map_physical_exact

Function map_physical_exact

util/intelmetool/src/mmap.c:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9int fd_mem;
10
11void *map_physical_exact(off_t phys_addr, void *mapto, size_t len)
12{
13 void *virt_addr;
14 int err;
15
16 virt_addr = mmap(mapto, len, PROT_WRITE | PROT_READ,
17 MAP_SHARED | MAP_FIXED, fd_mem, phys_addr);
18
19 if (virt_addr == MAP_FAILED) {
20 err = errno;
21 printf("Error mapping physical memory 0x%016jx [0x%zx] ERRNO=%d %s\n",
22 (uintmax_t)phys_addr, len, err, strerror(err));
23 return NULL;
24 }
25
26 return virt_addr;
27}
28
29void *map_physical(off_t phys_addr, size_t len)
30{

Callers 1

dump_me_memoryFunction · 0.85

Calls 2

printfFunction · 0.85
strerrorFunction · 0.85

Tested by

no test coverage detected