blob: 1e310aeec62cca7b26c405b4d24b9ea96f6841e2 (
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
26
27
28
29
|
#include "memory.h"
void * EFIAPI AllocatePagesType(IN UINTN size, IN UINTN type)
{
void * ret = NULL;
Print(L"About to allocate\n");
EFI_STATUS status = uefi_call_wrapper(BS->AllocatePool, 3, type, size, &ret);
if(status == EFI_SUCCESS)
{
Print(L"Pool Allocated\n");
return ret;
}
Print(L"Allocation Failed\n");
return NULL;
}
void bootloader_memset(void * in, uint64_t size, uint8_t value)
{
uint8_t * tmpin = in;
for(int i = 0; i < size; i++)
{
tmpin[i] = value;
}
}
|