1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use core::ptr;
#[inline(always)]
pub unsafe fn bss_init(start: &mut usize, end: &usize) {
let start = start as *mut _;
let end = end as *const _;
let count = end as usize - start as usize;
ptr::write_bytes(start, 0, count >> 2);
}
#[inline(always)]
pub unsafe fn data_init(start: &mut usize, end: &usize, data: &usize) {
let start = start as *mut _;
let end = end as *const _;
let data = data as *const _;
let count = end as usize - start as usize;
ptr::copy_nonoverlapping(data, start, count >> 2);
}