make clear_bss faster

toolchain_update
WangRunji 6 years ago
parent 1d1d4109c3
commit 70b6db4282

@ -86,10 +86,11 @@ fn remap_the_kernel() {
static mut SATP: usize = 0; static mut SATP: usize = 0;
pub unsafe fn clear_bss() { pub unsafe fn clear_bss() {
let bss_start = sbss as usize; let start = sbss as usize;
let bss_end = ebss as usize; let end = ebss as usize;
for i in bss_start..bss_end { let step = core::mem::size_of::<usize>();
(i as *mut u8).write(0); for i in (start..end).step_by(step) {
(i as *mut usize).write(0);
} }
} }

Loading…
Cancel
Save