File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
library/std/src/sys/pal/vexos Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,29 @@ pub mod thread_local_key;
24
24
#[ path = "../unsupported/time.rs" ]
25
25
pub mod time;
26
26
27
- use crate :: arch:: asm;
27
+ use crate :: { arch:: asm, ptr :: { self , addr_of_mut } } ;
28
28
29
29
#[ cfg( not( test) ) ]
30
30
#[ no_mangle]
31
31
#[ link_section = ".text.boot" ]
32
32
pub unsafe extern "C" fn _start ( ) -> ! {
33
33
extern "C" {
34
+ static mut __bss_start: u8 ;
35
+ static mut __bss_end: u8 ;
36
+
34
37
fn main ( ) -> i32 ;
35
38
}
36
39
37
40
asm ! ( "ldr sp, =__stack_top" , options( nostack) ) ;
38
41
42
+ ptr:: slice_from_raw_parts_mut (
43
+ addr_of_mut ! ( __bss_start) ,
44
+ addr_of_mut ! ( __bss_end) . offset_from ( addr_of_mut ! ( __bss_start) ) as usize ,
45
+ )
46
+ . as_mut ( )
47
+ . unwrap_unchecked ( )
48
+ . fill ( 0 ) ;
49
+
39
50
main ( ) ;
40
51
41
52
abort_internal ( )
You can’t perform that action at this time.
0 commit comments