ptos: bpal: Add memory map interface

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
2026-07-10 20:16:46 +00:00
parent cbd74a54fb
commit 128060dca0
2 changed files with 56 additions and 1 deletions
+30
View File
@@ -12,6 +12,34 @@
#include <ptapi/status.h>
#include <ptdef.h>
/*
* Valid memory types
*/
typedef enum {
MEMORY_USABLE,
MEMORY_RESERVED,
MEMORY_ACPI_RECLAIM,
MEMORY_ACPI_NVS,
MEMORY_BAD,
MEMORY_BOOTLOADER,
MEMORY_KERNEL,
MEMORY_FRAMEBUFFER,
MEMORY_ACPI_TABLES
} MEM_TYPE;
/*
* Memory map entry
*
* @Base: Entry base
* @Length: Entry length
* @Type: Entry type
*/
typedef struct {
UQUAD Base;
UQUAD Length;
UQUAD Type;
} MEMMAP_ENTRY;
/*
* Represents a framebuffer
*/
@@ -35,10 +63,12 @@ typedef struct {
*
* @KernelBase: Represents the kernel load base
* @Framebuffer: Framebuffer information
* @MemEntryIdx: Callback to get memory map entry by index
*/
typedef struct {
UPTR KernelBase;
BPAL_FRAMEBUFFER Framebuffer;
PT_STATUS(*MemEntryIdx)(USIZE Idx, MEMMAP_ENTRY *Result);
} BPAL_HANDLE;
/*