bond/x64/src/include/kernel/mm/pmm.h

35 lines
949 B
C
Raw Normal View History

2017-02-01 03:26:08 +00:00
#ifndef _PMM_H_
#define _PMM_H_
#include "avl_tree.h"
#include "linked_list.h"
#include "../../../common/inc/abi.h"
#include "../arch/amd64/mm.h"
2017-02-01 03:26:08 +00:00
#include "atomic.h"
#include "../../../common/inc/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;
status_t KABI sx_pmm_init(pmm_info_t *info);
status_t KABI mm_alloc_page(physical_addr_t *out);
status_t KABI mm_free_page(physical_addr_t base);
status_t KABI mm_query_page_attr(physical_addr_t base,
int32_t *out);
// TODO: implement these somehow, i might just reserve the first 16MB for these
int32_t KABI mm_alloc_contiguous_pages(uint64_t num_of_page,
physical_addr_t highest_p_addr,
physical_addr_t *out);
int32_t KABI mm_free_contiguous_pages(physical_addr_t base);
#endif