@@ -189,42 +189,42 @@ pub fn clear_flash(dev_id: u8) {
189
189
// This isn't meant to call directly, but by a wrapper.
190
190
191
191
#[ no_mangle]
192
- pub extern fn sim_get_flash_areas ( ) -> * const CAreaDesc {
192
+ pub extern "C" fn sim_get_flash_areas ( ) -> * const CAreaDesc {
193
193
THREAD_CTX . with ( |ctx| {
194
194
ctx. borrow ( ) . flash_areas . ptr
195
195
} )
196
196
}
197
197
198
198
#[ no_mangle]
199
- pub extern fn sim_set_flash_areas ( areas : * const CAreaDesc ) {
199
+ pub extern "C" fn sim_set_flash_areas ( areas : * const CAreaDesc ) {
200
200
THREAD_CTX . with ( |ctx| {
201
201
ctx. borrow_mut ( ) . flash_areas . ptr = areas;
202
202
} ) ;
203
203
}
204
204
205
205
#[ no_mangle]
206
- pub extern fn sim_reset_flash_areas ( ) {
206
+ pub extern "C" fn sim_reset_flash_areas ( ) {
207
207
THREAD_CTX . with ( |ctx| {
208
208
ctx. borrow_mut ( ) . flash_areas . ptr = ptr:: null ( ) ;
209
209
} ) ;
210
210
}
211
211
212
212
#[ no_mangle]
213
- pub extern fn sim_get_context ( ) -> * const CSimContext {
213
+ pub extern "C" fn sim_get_context ( ) -> * const CSimContext {
214
214
SIM_CTX . with ( |ctx| {
215
215
ctx. borrow ( ) . ptr
216
216
} )
217
217
}
218
218
219
219
#[ no_mangle]
220
- pub extern fn sim_set_context ( ptr : * const CSimContext ) {
220
+ pub extern "C" fn sim_set_context ( ptr : * const CSimContext ) {
221
221
SIM_CTX . with ( |ctx| {
222
222
ctx. borrow_mut ( ) . ptr = ptr;
223
223
} ) ;
224
224
}
225
225
226
226
#[ no_mangle]
227
- pub extern fn sim_reset_context ( ) {
227
+ pub extern "C" fn sim_reset_context ( ) {
228
228
SIM_CTX . with ( |ctx| {
229
229
ctx. borrow_mut ( ) . ptr = ptr:: null ( ) ;
230
230
} ) ;
@@ -257,7 +257,7 @@ pub fn clear_ram_info() {
257
257
}
258
258
259
259
#[ no_mangle]
260
- pub extern fn sim_flash_erase ( dev_id : u8 , offset : u32 , size : u32 ) -> libc:: c_int {
260
+ pub extern "C" fn sim_flash_erase ( dev_id : u8 , offset : u32 , size : u32 ) -> libc:: c_int {
261
261
let mut rc: libc:: c_int = -19 ;
262
262
THREAD_CTX . with ( |ctx| {
263
263
if let Some ( flash) = ctx. borrow ( ) . flash_map . get ( & dev_id) {
@@ -269,7 +269,7 @@ pub extern fn sim_flash_erase(dev_id: u8, offset: u32, size: u32) -> libc::c_int
269
269
}
270
270
271
271
#[ no_mangle]
272
- pub extern fn sim_flash_read ( dev_id : u8 , offset : u32 , dest : * mut u8 , size : u32 ) -> libc:: c_int {
272
+ pub extern "C" fn sim_flash_read ( dev_id : u8 , offset : u32 , dest : * mut u8 , size : u32 ) -> libc:: c_int {
273
273
let mut rc: libc:: c_int = -19 ;
274
274
THREAD_CTX . with ( |ctx| {
275
275
if let Some ( flash) = ctx. borrow ( ) . flash_map . get ( & dev_id) {
@@ -282,7 +282,7 @@ pub extern fn sim_flash_read(dev_id: u8, offset: u32, dest: *mut u8, size: u32)
282
282
}
283
283
284
284
#[ no_mangle]
285
- pub extern fn sim_flash_write ( dev_id : u8 , offset : u32 , src : * const u8 , size : u32 ) -> libc:: c_int {
285
+ pub extern "C" fn sim_flash_write ( dev_id : u8 , offset : u32 , src : * const u8 , size : u32 ) -> libc:: c_int {
286
286
let mut rc: libc:: c_int = -19 ;
287
287
THREAD_CTX . with ( |ctx| {
288
288
if let Some ( flash) = ctx. borrow ( ) . flash_map . get ( & dev_id) {
@@ -295,14 +295,14 @@ pub extern fn sim_flash_write(dev_id: u8, offset: u32, src: *const u8, size: u32
295
295
}
296
296
297
297
#[ no_mangle]
298
- pub extern fn sim_flash_align ( id : u8 ) -> u32 {
298
+ pub extern "C" fn sim_flash_align ( id : u8 ) -> u32 {
299
299
THREAD_CTX . with ( |ctx| {
300
300
ctx. borrow ( ) . flash_params . get ( & id) . unwrap ( ) . align
301
301
} )
302
302
}
303
303
304
304
#[ no_mangle]
305
- pub extern fn sim_flash_erased_val ( id : u8 ) -> u8 {
305
+ pub extern "C" fn sim_flash_erased_val ( id : u8 ) -> u8 {
306
306
THREAD_CTX . with ( |ctx| {
307
307
ctx. borrow ( ) . flash_params . get ( & id) . unwrap ( ) . erased_val
308
308
} )
@@ -325,7 +325,7 @@ fn map_err(err: Result<()>) -> libc::c_int {
325
325
/// or
326
326
/// RUST_LOG=bootsim=info cargo run --release runall
327
327
#[ no_mangle]
328
- pub extern fn sim_log_enabled ( level : libc:: c_int ) -> libc:: c_int {
328
+ pub extern "C" fn sim_log_enabled ( level : libc:: c_int ) -> libc:: c_int {
329
329
let res = match level {
330
330
1 => log_enabled ! ( Level :: Error ) ,
331
331
2 => log_enabled ! ( Level :: Warn ) ,
0 commit comments