File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
library/std/src/sys/pal/vexos Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ pub unsafe extern "C" fn _start() -> ! {
5252 abort_internal ( )
5353}
5454
55+ #[ link_section = ".code_signature" ]
56+ #[ linkage = "weak" ]
57+ #[ used]
58+ static CODE_SIGNATURE : vex_sdk:: vcodesig = vex_sdk:: vcodesig {
59+ magic : u32:: from_le_bytes ( * b"XVX5" ) ,
60+ r#type : 2 ,
61+ owner : 0 ,
62+ options : 0 ,
63+ } ;
64+
5565// This function is needed by the panic runtime. The symbol is named in
5666// pre-link args for the target specification, so keep that in sync.
5767#[ cfg( not( test) ) ]
@@ -61,8 +71,12 @@ pub extern "C" fn __rust_abort() -> ! {
6171 abort_internal ( )
6272}
6373
74+ // SAFETY: must be called only once during runtime initialization.
75+ // NOTE: this is not guaranteed to run, for example when Rust code is called externally.
6476pub unsafe fn init ( _argc : isize , _argv : * const * const u8 , _sigpipe : u8 ) { }
6577
78+ // SAFETY: must be called only once during runtime cleanup.
79+ // NOTE: this is not guaranteed to run, for example when the program aborts.
6680pub unsafe fn cleanup ( ) { }
6781
6882pub fn unsupported < T > ( ) -> crate :: io:: Result < T > {
@@ -83,6 +97,7 @@ pub fn decode_error_kind(_code: i32) -> crate::io::ErrorKind {
8397
8498pub fn abort_internal ( ) -> ! {
8599 unsafe {
100+ vex_sdk:: vexTasksRun ( ) ;
86101 vex_sdk:: vexSystemExitRequest ( ) ;
87102 }
88103
You can’t perform that action at this time.
0 commit comments