258258//!
259259//! - `__INTERRUPTS`. This is the device specific interrupt portion of the vector table; its exact
260260//! 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.
263263//!
264264//! - `__pre_init`. This is a function to be run before RAM is initialized. It defaults to an empty
265265//! 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] = [
12341234
12351235// If we are not targeting a specific device we bind all the potential device specific interrupts
12361236// 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 ) ) ) ]
12381238#[ doc( hidden) ]
12391239#[ cfg_attr( cortex_m, link_section = ".vector_table.interrupts" ) ]
12401240#[ no_mangle]
@@ -1246,6 +1246,19 @@ pub static __INTERRUPTS: [unsafe extern "C" fn(); 240] = [{
12461246 DefaultHandler
12471247} ; 240 ] ;
12481248
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+
12491262// ARMv6-M can only have a maximum of 32 device specific interrupts
12501263#[ cfg( all( not( feature = "device" ) , armv6m) ) ]
12511264#[ doc( hidden) ]
0 commit comments