stos: bpal: Add memory map callbacks
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user