2018-08-06 18:41:45 +02:00
|
|
|
#pragma once
|
2018-08-06 21:00:58 +02:00
|
|
|
#include "stdarg.h"
|
2018-08-06 18:41:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
#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;
|
2018-08-09 22:19:34 +02:00
|
|
|
struct mem_desc *next, *prev;
|
2018-08-06 18:41:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-08 22:08:27 +01:00
|
|
|
int memSetup(unsigned long upper_mem);
|
2018-08-09 22:19:34 +02:00
|
|
|
unsigned long allocPage(void);
|
|
|
|
int unrefPage(unsigned long addr);
|