stos: bpal: Add memory map callbacks

Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
Chloe M.
2026-06-22 03:51:35 +00:00
parent c317ed8a4d
commit e9a1de69cf
2 changed files with 56 additions and 0 deletions
+31
View File
@@ -9,8 +9,37 @@
#ifndef _KE_BPAL_H_
#define _KE_BPAL_H_ 1
#include <stapi/status.h>
#include <stdef.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
*/
@@ -33,10 +62,12 @@ typedef struct {
*
* @KernelBase: Kernel load base
* @Framebuffer: Framebuffer info
* @MemEntryIdx: Callback to get memory map entry by index
*/
typedef struct {
UPTR KernelBase;
BPAL_FRAMEBUFFER Framebuffer;
ST_STATUS(*MemEntryIdx)(USIZE Idx, MEMMAP_ENTRY *Result);
} BPAL_HANDLE;
/*