@@ -6,7 +6,7 @@ use lazy_static::lazy_static;
66use riscv:: register:: satp;
77
88use crate :: {
9- config:: { MEMORY_END , MMIO , PAGE_SIZE , TRAMPOLINE , TRAP_CONTEXT , USER_STACK_SIZE } ,
9+ config:: { MEMORY_END , MMIO , PAGE_SIZE , TRAMPOLINE } ,
1010 mm:: address:: StepByOne ,
1111 sync:: UPSafeCell ,
1212} ;
@@ -176,14 +176,6 @@ impl MemorySet {
176176 memory_set. map_trampoline ( ) ;
177177
178178 // map kernel sections
179- // println!(".text [{:#x}, {:#x})", stext as usize, etext as usize);
180- // println!(".rodata [{:#x}, {:#x})", srodata as usize, erodata as usize);
181- // println!(".data [{:#x}, {:#x})", sdata as usize, edata as usize);
182- // println!(
183- // ".bss [{:#x}, {:#x})",
184- // sbss_with_stack as usize, ebss as usize
185- // );
186-
187179 // println!("mapping kernel .text section");
188180 memory_set. push (
189181 MapArea :: new (
@@ -310,30 +302,10 @@ impl MemorySet {
310302 let mut user_stack_bottom: usize = max_end_va. into ( ) ;
311303 // guard page
312304 user_stack_bottom += PAGE_SIZE ;
313- let user_stack_top = user_stack_bottom + USER_STACK_SIZE ;
314- memory_set. push (
315- MapArea :: new (
316- user_stack_bottom. into ( ) ,
317- user_stack_top. into ( ) ,
318- MapType :: Framed ,
319- MapPermission :: R | MapPermission :: W | MapPermission :: U ,
320- ) ,
321- None ,
322- ) ;
323- // map TrapContext
324- memory_set. push (
325- MapArea :: new (
326- TRAP_CONTEXT . into ( ) ,
327- TRAMPOLINE . into ( ) ,
328- MapType :: Framed ,
329- MapPermission :: R | MapPermission :: W ,
330- ) ,
331- None ,
332- ) ;
333305
334306 (
335307 memory_set,
336- user_stack_top ,
308+ user_stack_bottom ,
337309 elf. header . pt2 . entry_point ( ) as usize ,
338310 )
339311 }
@@ -474,5 +446,4 @@ pub fn remap_test() {
474446 . executable( ) ,
475447 false
476448 ) ;
477- println ! ( "remap_test passed!" ) ;
478449}
0 commit comments