22 lines
396 B
C
22 lines
396 B
C
#pragma once
|
|
#include "stdarg.h"
|
|
|
|
|
|
#define PAGE_SHIFT 12
|
|
#define PAGE_SIZE (1 << PAGE_SHIFT)
|
|
|
|
// Defined in linker.ld script
|
|
extern uint32_t __ld_kernel_begin;
|
|
extern uint32_t __ld_kernel_end;
|
|
|
|
struct mem_desc{
|
|
unsigned long phy_addr;
|
|
unsigned long ref;
|
|
struct mem_desc *next, *prev;
|
|
};
|
|
|
|
|
|
int memInit(unsigned long upper_mem);
|
|
unsigned long allocPage(void);
|
|
int unrefPage(unsigned long addr);
|