vmbase: Clients separate eh_stack from .data+.bss
Remove the assumption that .data, .bss, and EH stack region are
contiguous e.g. when mapping or clearing them. This prepares the code
for an upcoming change moving the EH stack to a different part of the
writable_data region.
Bug: 377276983
Bug: 381440625
Test: m {pvmfw,rialto,vmbase_example_{bios,kernel}}_bin
Change-Id: Iae6220b1623b81ff9d7b6595be74504f6ec80865
diff --git a/libs/libvmbase/src/layout.rs b/libs/libvmbase/src/layout.rs
index adcb2fa..2f710ef 100644
--- a/libs/libvmbase/src/layout.rs
+++ b/libs/libvmbase/src/layout.rs
@@ -80,6 +80,11 @@
linker_region!(bss_begin, bss_end)
}
+/// Writable data region for .data and .bss.
+pub fn data_bss_range() -> Range<VirtualAddress> {
+ linker_region!(data_begin, bss_end)
+}
+
/// Writable data region for the stack.
pub fn stack_range(stack_size: usize) -> Range<VirtualAddress> {
let end = linker_addr!(init_stack_pointer);
@@ -89,9 +94,9 @@
start..end
}
-/// All writable sections, excluding the stack.
-pub fn scratch_range() -> Range<VirtualAddress> {
- linker_region!(eh_stack_limit, bss_end)
+/// Writable data region for the exception handler stack.
+pub fn eh_stack_range() -> Range<VirtualAddress> {
+ linker_region!(eh_stack_limit, init_eh_stack_pointer)
}
/// Range of the page at UART_PAGE_ADDR of PAGE_SIZE.