File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
tests/test_kernels/lower_memory_free/src/bin Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use bootloader_api::{
77use test_kernel_lower_memory_free:: { exit_qemu, QemuExitCode } ;
88
99const LOWER_MEMORY_END_PAGE : u64 = 0x0010_0000 ;
10+ const WRITE_TEST_UNTIL : u64 = 0x4000_0000 ;
1011
1112pub const BOOTLOADER_CONFIG : BootloaderConfig = {
1213 let mut config = BootloaderConfig :: new_default ( ) ;
@@ -34,16 +35,17 @@ fn kernel_main(boot_info: &'static mut BootInfo) -> ! {
3435 . unwrap ( ) ;
3536 if region. kind == MemoryRegionKind :: Usable && region. start < LOWER_MEMORY_END_PAGE {
3637 let end = core:: cmp:: min ( region. end , LOWER_MEMORY_END_PAGE ) ;
37-
38+ let pages = ( end - region. start ) / 4096 ;
39+ count += pages;
40+ }
41+ if region. kind == MemoryRegionKind :: Usable && region. start < WRITE_TEST_UNTIL {
42+ let end = core:: cmp:: min ( region. end , WRITE_TEST_UNTIL ) ;
3843 // ensure region is actually writable
3944 let addr = phys_mem_offset + region. start ;
4045 let size = end - region. start ;
4146 unsafe {
4247 core:: ptr:: write_bytes ( addr as * mut u8 , 0xff , size as usize ) ;
4348 }
44-
45- let pages = ( end - region. start ) / 4096 ;
46- count += pages;
4749 }
4850 }
4951
You can’t perform that action at this time.
0 commit comments