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

Function map_physical

util/intelmetool/src/mmap.c:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void *map_physical(off_t phys_addr, size_t len)
30{
31 void *virt_addr;
32 int err;
33
34 virt_addr = mmap(NULL, len, PROT_WRITE | PROT_READ, MAP_SHARED, fd_mem, phys_addr);
35
36 if (virt_addr == MAP_FAILED) {
37 err = errno;
38 printf("Error mapping physical memory 0x%016jx [0x%zx] ERRNO=%d %s\n",
39 (uintmax_t)phys_addr, len, err, strerror(err));
40 return NULL;
41 }
42
43 return virt_addr;
44}
45
46void unmap_physical(void *virt_addr, size_t len)
47{

Callers 3

write_rcba32Function · 0.70
read_rcba32Function · 0.70
intel_mei_setupFunction · 0.70

Calls 2

printfFunction · 0.85
strerrorFunction · 0.85

Tested by

no test coverage detected