bootloader: Add remove_{physical|virtual}_allocated_range methods.

Will be used in following commits.

Change-Id: Ica89d28cbf6980aca8dc347dfdcb200a0e637e9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8442
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2024-10-10 16:13:11 +00:00
committed by waddlesplash
parent 5e451463d0
commit d1ef184af6
2 changed files with 22 additions and 0 deletions
+4
View File
@@ -36,7 +36,11 @@ status_t remove_physical_memory_range(uint64 start, uint64 size);
uint64 total_physical_memory();
status_t insert_physical_allocated_range(uint64 start, uint64 size);
status_t remove_physical_allocated_range(uint64 start, uint64 size);
status_t insert_virtual_allocated_range(uint64 start, uint64 size);
status_t remove_virtual_allocated_range(uint64 start, uint64 size);
void ignore_physical_memory_ranges_beyond_4gb();
#ifdef __cplusplus
+18
View File
@@ -317,6 +317,15 @@ insert_physical_allocated_range(uint64 start, uint64 size)
}
status_t
remove_physical_allocated_range(uint64 start, uint64 size)
{
return remove_address_range(gKernelArgs.physical_allocated_range,
&gKernelArgs.num_physical_allocated_ranges, MAX_PHYSICAL_ALLOCATED_RANGE,
start, size);
}
status_t
insert_virtual_allocated_range(uint64 start, uint64 size)
{
@@ -326,6 +335,15 @@ insert_virtual_allocated_range(uint64 start, uint64 size)
}
status_t
remove_virtual_allocated_range(uint64 start, uint64 size)
{
return remove_address_range(gKernelArgs.virtual_allocated_range,
&gKernelArgs.num_virtual_allocated_ranges, MAX_VIRTUAL_ALLOCATED_RANGE,
start, size);
}
#if B_HAIKU_PHYSICAL_BITS > 32
void