Port plat_m(un)map from the VFIO branch
This commit is contained in:
@@ -728,7 +728,7 @@ plat_get_basename(const char *path)
|
||||
|
||||
while (c > 0) {
|
||||
if (path[c] == '/' || path[c] == '\\')
|
||||
return((char *)&path[c]);
|
||||
return((char *)&path[c + 1]);
|
||||
c--;
|
||||
}
|
||||
|
||||
@@ -858,6 +858,20 @@ plat_dir_create(char *path)
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
plat_mmap(size_t size, uint8_t executable)
|
||||
{
|
||||
return VirtualAlloc(NULL, size, MEM_COMMIT, executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
plat_munmap(void *ptr, size_t size)
|
||||
{
|
||||
VirtualFree(ptr, 0, MEM_RELEASE);
|
||||
}
|
||||
|
||||
|
||||
uint64_t
|
||||
plat_timer_read(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user