258
258
//!
259
259
//! - `__INTERRUPTS`. This is the device specific interrupt portion of the vector table; its exact
260
260
//! size depends on the target device but if the `"device"` feature has not been enabled it will
261
- //! have a size of 32 vectors (on ARMv6-M) or 240 vectors (on ARMv7-M). This array is located after
262
- //! `__EXCEPTIONS` in the `.vector_table` section.
261
+ //! have a size of 32 vectors (on ARMv6-M), 240 vectors (on ARMv7-M) or 496 vectors (on ARMv8-M).
262
+ //! This array is located after `__EXCEPTIONS` in the `.vector_table` section.
263
263
//!
264
264
//! - `__pre_init`. This is a function to be run before RAM is initialized. It defaults to an empty
265
265
//! function. As this runs before RAM is initialised, it is not sound to use a Rust function for
@@ -1234,7 +1234,7 @@ pub static __EXCEPTIONS: [Vector; 14] = [
1234
1234
1235
1235
// If we are not targeting a specific device we bind all the potential device specific interrupts
1236
1236
// to the default handler
1237
- #[ cfg( all( any( not( feature = "device" ) , test) , not( armv6m) ) ) ]
1237
+ #[ cfg( all( any( not( feature = "device" ) , test) , not( armv6m) , not ( armv8m ) ) ) ]
1238
1238
#[ doc( hidden) ]
1239
1239
#[ cfg_attr( cortex_m, link_section = ".vector_table.interrupts" ) ]
1240
1240
#[ no_mangle]
@@ -1246,6 +1246,19 @@ pub static __INTERRUPTS: [unsafe extern "C" fn(); 240] = [{
1246
1246
DefaultHandler
1247
1247
} ; 240 ] ;
1248
1248
1249
+ // ARMv8-M can have up to 496 device specific interrupts
1250
+ #[ cfg( all( not( feature = "device" ) , armv8m) ) ]
1251
+ #[ doc( hidden) ]
1252
+ #[ cfg_attr( cortex_m, link_section = ".vector_table.interrupts" ) ]
1253
+ #[ no_mangle]
1254
+ pub static __INTERRUPTS: [ unsafe extern "C" fn ( ) ; 496 ] = [ {
1255
+ extern "C" {
1256
+ fn DefaultHandler ( ) ;
1257
+ }
1258
+
1259
+ DefaultHandler
1260
+ } ; 496 ] ;
1261
+
1249
1262
// ARMv6-M can only have a maximum of 32 device specific interrupts
1250
1263
#[ cfg( all( not( feature = "device" ) , armv6m) ) ]
1251
1264
#[ doc( hidden) ]
0 commit comments