Skip to content

Libkernel yet more fixes#301

Merged
arihant2math merged 3 commits into
masterfrom
libkernel-yet-more-fixes
May 13, 2026
Merged

Libkernel yet more fixes#301
arihant2math merged 3 commits into
masterfrom
libkernel-yet-more-fixes

Conversation

@hexagonal-sun

Copy link
Copy Markdown
Owner
libkernel: region: add new utility functions

Add the following to all memory region variants:

 - `is_empty()`: Return true if the region has zero size.
 - `cap_size()`: Reduces the size if the given size < current.
 - `shrink_start()`: Move start address forward, while shrinking the
   region.

libkernel: smalloc: don't ever allocate a null address

If a memory list begins at NULL, never give out that address. It trips
up UB checks, instead reserve the null page when that condition has been
detected.

libkernel: paging: add `translate`

Add a `translate` function which is much more powerful that `get_pte`.
It permits block mappings to be returned for a given VA.

Add a `translate` function which is much more powerful that `get_pte`.
It permits block mappings to be returned for a given VA.
If a memory list begins at NULL, never give out that address. It trips
up UB checks, instead reserve the null page when that condition has been
detected.
Add the following to all memory region variants:

 - `is_empty()`: Return true if the region has zero size.
 - `cap_size()`: Reduces the size if the given size < current.
 - `shrink_start()`: Move start address forward, while shrinking the
   region.
@arihant2math
arihant2math merged commit 39eaded into master May 13, 2026
4 checks passed
@arihant2math
arihant2math deleted the libkernel-yet-more-fixes branch May 13, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants