First commit, Vystem v0.1

This commit is contained in:
2026-03-31 22:15:00 +02:00
commit e15daed8c0
462 changed files with 134655 additions and 0 deletions

View 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