File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ fn main() {
47
47
// make sure that these env variables are not changed without notice.
48
48
println ! ( "cargo:rerun-if-env-changed=RISCV_RT_BASE_ISA" ) ;
49
49
println ! ( "cargo:rerun-if-env-changed=RISCV_RT_LLVM_ARCH_PATCH" ) ;
50
+ if env:: var_os ( "CARGO_FEATURE_V_TRAP" ) . is_some ( )
51
+ && env:: var_os ( "CARGO_FEATURE_NO_INTERRUPTS" ) . is_none ( )
52
+ {
53
+ // This environment variable is used by the `#[riscv::pac_enum()]` call in
54
+ // `src/interrupts.rs` (when `v-trap` is enabled and `no-interrupts` disabled).
55
+ println ! ( "cargo:rerun-if-env-changed=RISCV_MTVEC_ALIGN" ) ;
56
+ }
50
57
51
58
for flag in target. rustc_flags ( ) {
52
59
// Required until target_feature risc-v is stable and in-use
Original file line number Diff line number Diff line change 7
7
//!
8
8
//! In vectored mode (i.e., `v-trap` feature enabled), interrupt dispatching is handled by hardware.
9
9
//! To support this mode, we provide inline assembly code that defines the interrupt vector table.
10
+ //! Since the alignment constraint of this vector table is implementation-specific, it can be
11
+ //! changed by setting the `RISCV_MTVEC_ALIGN` environment variable (the default is 4).
10
12
//!
11
13
//! # Note
12
14
//!
13
- //! If your target has custom core interrupt sources, the target PAC might provide equivalent
14
- //! code to adapt for the target needs. In this case, you may need to opt out this module.
15
- //! To do so, activate the `no-interrupts` feature of the `riscv-rt` crate.
15
+ //! If your target has custom core interrupt sources, the target PAC might provide equivalent code
16
+ //! to adapt for the target needs (and is responsible for any alignment constraint). In this case,
17
+ //! you may need to opt out this module. To do so, activate the `no-interrupts` feature of the
18
+ //! `riscv-rt` crate.
16
19
17
20
// In vectored mode, we also must provide a vector table
18
21
#[ riscv:: pac_enum( unsafe CoreInterruptNumber ) ]
You can’t perform that action at this time.
0 commit comments