Skip to content

Commit

Permalink
Use rwtext as link section (#200)
Browse files Browse the repository at this point in the history
* Use .rwtext as interrupt link-section

* Use .rwtext as interrupt link-section
  • Loading branch information
bjoernQ authored Mar 1, 2024
1 parent 50e13a3 commit 35de99f
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 16 deletions.
1 change: 1 addition & 0 deletions esp32/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub union Vector {
_reserved: u32,
}
#[cfg(feature = "rt")]
#[link_section = ".rwtext"]
#[doc(hidden)]
pub static __INTERRUPTS: [Vector; 69] = [
Vector { _handler: WIFI_MAC },
Expand Down
2 changes: 1 addition & 1 deletion esp32c2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 42] = [
Vector { _handler: WIFI_MAC },
Expand Down
2 changes: 1 addition & 1 deletion esp32c3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 62] = [
Vector { _handler: WIFI_MAC },
Expand Down
2 changes: 1 addition & 1 deletion esp32c6-lp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 22] = [
Vector { _reserved: 0 },
Expand Down
2 changes: 1 addition & 1 deletion esp32c6/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 77] = [
Vector { _handler: WIFI_MAC },
Expand Down
2 changes: 1 addition & 1 deletion esp32h2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 65] = [
Vector { _handler: PMU },
Expand Down
2 changes: 1 addition & 1 deletion esp32p4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 128] = [
Vector { _reserved: 0 },
Expand Down
2 changes: 1 addition & 1 deletion esp32s2-ulp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 9] = [
Vector {
Expand Down
1 change: 1 addition & 0 deletions esp32s2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ pub union Vector {
_reserved: u32,
}
#[cfg(feature = "rt")]
#[link_section = ".rwtext"]
#[doc(hidden)]
pub static __INTERRUPTS: [Vector; 95] = [
Vector { _handler: WIFI_MAC },
Expand Down
2 changes: 1 addition & 1 deletion esp32s3-ulp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub union Vector {
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".trap.rodata"]
#[link_section = ".rwtext"]
#[no_mangle]
pub static __EXTERNAL_INTERRUPTS: [Vector; 12] = [
Vector {
Expand Down
1 change: 1 addition & 0 deletions esp32s3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pub union Vector {
_reserved: u32,
}
#[cfg(feature = "rt")]
#[link_section = ".rwtext"]
#[doc(hidden)]
pub static __INTERRUPTS: [Vector; 99] = [
Vector { _handler: WIFI_MAC },
Expand Down
10 changes: 2 additions & 8 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,8 @@ fn generate_package(workspace: &Path, chip: &Chip) -> Result<()> {
output_dir: Some(path.clone()),
impl_debug: true,
impl_debug_feature: Some("impl-register-debug".to_owned()),

..match target {
Target::RISCV => Config {
interrupt_link_section: Some(".trap.rodata".to_owned()),
..Config::default()
},
_ => Config::default(),
}
interrupt_link_section: Some(".rwtext".to_owned()),
..Config::default()
};

let input = fs::read_to_string(svd_file)?;
Expand Down

0 comments on commit 35de99f

Please sign in to comment.