bond/include/kernel/mm/pmm.h

36 lines
916 B
C
Raw Normal View History

#ifndef _KERNEL_MM_PMM_H_
#define _KERNEL_MM_PMM_H_
2017-02-01 03:26:08 +00:00
2018-01-26 08:43:22 +00:00
#include "type.h"
#include "lib/avl_tree.h"
#include "lib/linked_list.h"
#include "kernel/mm/mem.h"
#include "kernel/ke/atomic.h"
#include "status.h"
2017-02-01 03:26:08 +00:00
//#define PMM_PAGE_ATTR_FREE_BIT 0
//#define PMM_PAGE_ATTR_PAGED_BIT 1
//
//typedef struct
//{
// uint32_t attr;
//} k_physical_page_attr_t;
2018-02-18 07:48:59 +00:00
status_t SXAPI sx_pmm_init(pmm_info_t *info);
2017-02-01 03:26:08 +00:00
2018-02-18 07:48:59 +00:00
status_t SXAPI mm_alloc_page(uintptr_t *out);
2017-02-01 03:26:08 +00:00
2018-02-18 07:48:59 +00:00
status_t SXAPI mm_free_page(uintptr_t base);
2017-02-01 03:26:08 +00:00
2018-02-18 07:48:59 +00:00
status_t SXAPI mm_query_page_attr(uintptr_t base,
2017-02-01 03:26:08 +00:00
int32_t *out);
// TODO: implement these somehow, i might just reserve the first 16MB for these
2018-02-18 07:48:59 +00:00
int32_t SXAPI mm_alloc_contiguous_pages(uint64_t num_of_page,
uintptr_t highest_p_addr,
uintptr_t *out);
2017-02-01 03:26:08 +00:00
2018-02-18 07:48:59 +00:00
int32_t SXAPI mm_free_contiguous_pages(uintptr_t base);
2017-02-01 03:26:08 +00:00
#endif