Lines Matching +full:memory +full:- +full:mapped
8 * http://www.apache.org/licenses/LICENSE-2.0
29 #include <memory>
50 mappedFd = sys->open(devmem, O_RDWR | O_SYNC); in open()
51 if (mappedFd == -1) in open()
56 mapped = reinterpret_cast<uint8_t*>(sys->mmap( in open()
58 if (mapped == MAP_FAILED) in open()
60 sys->close(mappedFd); in open()
61 mappedFd = -1; in open()
62 mapped = nullptr; in open()
69 output.mapped = mapped; in open()
76 if (mapped) in close()
78 sys->munmap(mapped, memoryRegionSize); in close()
79 mapped = nullptr; in close()
82 if (mappedFd != -1) in close()
84 sys->close(mappedFd); in close()
85 mappedFd = -1; in close()
91 * SuperIO. On BMC side the max memory can be mapped is 4kB with the caveat that
93 * shared memory.
96 * (4096 - 4). Otherwise, mapper returns either
97 * - WindowOffset = 4 and WindowSize = len - 4 if (addr & 0x7) == 0
98 * - WindowSize = 0 means that the region cannot be mapped otherwise
105 /* We reserve the first 4 bytes from the mapped region; the first byte in mapWindow()
109 const uint32_t bmcMapMaxSizeBytes = 4 * 1024 - bmcMapReserveBytes; in mapWindow()
158 if ((fd = sys->open("/dev/mem", O_RDWR | O_SYNC)) == -1) in mapWindow()
161 sys->close(fd); in mapWindow()
173 int pageSize = sys->getpagesize(); in mapWindow()
176 sys->mmap(nullptr, pageSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, in mapWindow()
186 sys->munmap(mapBasePtr, pageSize); in mapWindow()
187 sys->close(fd); in mapWindow()