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() -> ! {
52
52
abort_internal ( )
53
53
}
54
54
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
+
55
65
// This function is needed by the panic runtime. The symbol is named in
56
66
// pre-link args for the target specification, so keep that in sync.
57
67
#[ cfg( not( test) ) ]
@@ -61,8 +71,12 @@ pub extern "C" fn __rust_abort() -> ! {
61
71
abort_internal ( )
62
72
}
63
73
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.
64
76
pub unsafe fn init ( _argc : isize , _argv : * const * const u8 , _sigpipe : u8 ) { }
65
77
78
+ // SAFETY: must be called only once during runtime cleanup.
79
+ // NOTE: this is not guaranteed to run, for example when the program aborts.
66
80
pub unsafe fn cleanup ( ) { }
67
81
68
82
pub fn unsupported < T > ( ) -> crate :: io:: Result < T > {
@@ -83,6 +97,7 @@ pub fn decode_error_kind(_code: i32) -> crate::io::ErrorKind {
83
97
84
98
pub fn abort_internal ( ) -> ! {
85
99
unsafe {
100
+ vex_sdk:: vexTasksRun ( ) ;
86
101
vex_sdk:: vexSystemExitRequest ( ) ;
87
102
}
88
103
You can’t perform that action at this time.
0 commit comments