First commit, Vystem v0.1
This commit is contained in:
20
shelter/lib/include/memory/pba.h
Normal file
20
shelter/lib/include/memory/pba.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
#ifndef SH_LIB_PBA_H
|
||||
#define SH_LIB_PBA_H
|
||||
#include "std/type.h"
|
||||
#include "std/status.h"
|
||||
#include "memory/page.h"
|
||||
#include "memory/pez/pez.h"
|
||||
// Page block allocator
|
||||
typedef struct {
|
||||
sh_page_VIRTUAL_ADDRESS start_va;
|
||||
sh_uint64 total_pages;
|
||||
sh_uint64 block_pages;
|
||||
sh_uint64 block_count;
|
||||
sh_uint64 max_blocks;
|
||||
} sh_pba_PAGE_BLOCK_ALLOCATOR;
|
||||
// Initialize a page block allocator
|
||||
SH_STATUS sh_pba_init(sh_pba_PAGE_BLOCK_ALLOCATOR *pba,sh_page_VIRTUAL_ADDRESS start_va,sh_uint64 area_pages_amount,sh_uint64 block_pages);
|
||||
// Allocate a block and return corresponding pointer
|
||||
SH_STATUS sh_pba_alloc(sh_pba_PAGE_BLOCK_ALLOCATOR *pba,sh_page_PAGE_TABLE_POOL *ptp,sh_page_VIRTUAL_ADDRESS *ptr);
|
||||
#endif
|
||||
Reference in New Issue
Block a user