aboutsummaryrefslogtreecommitdiffstats
path: root/bootloader/memory.c
diff options
context:
space:
mode:
authorGravatar ornitorrincos 2026-08-18 12:15:05 +0200
committerGravatar ornitorrincos 2026-08-18 12:15:05 +0200
commit132d3236bb884433bf94e961f6d32264e0334aec (patch)
tree06638976b06f019ea4037175ff228f8271057c44 /bootloader/memory.c
Diffstat (limited to 'bootloader/memory.c')
-rw-r--r--bootloader/memory.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/bootloader/memory.c b/bootloader/memory.c
new file mode 100644
index 0000000..1e310ae
--- /dev/null
+++ b/bootloader/memory.c
@@ -0,0 +1,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;
+ }
+}