blob: f15c9ac9e97397c041acf9d7707cfd215b85bd47 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include "vmmem.h"
//#include "paging_struct.h"
EFI_STATUS EFIAPI SetVM(IN UINTN size, IN UINTN descriptorsize, IN UINTN descriptorversion, EFI_MEMORY_DESCRIPTOR * map, void * kernel)
{
// the code for setting up paging should go here
// edit the memory mapping so that the uefi runtime knows about it
EFI_MEMORY_DESCRIPTOR * tmp = map;
UINTN elements = size/descriptorsize;
UINTN i;
for(i = 0; i < elements; ++i)
{
tmp = (EFI_MEMORY_DESCRIPTOR*)(((EFI_PHYSICAL_ADDRESS)tmp + descriptorsize));
tmp->VirtualStart = tmp->PhysicalStart;
}
return uefi_call_wrapper(RT->SetVirtualAddressMap, 4, size, descriptorsize, descriptorversion, map);
}
|