Skip to content

Commit

Permalink
should be good to go
Browse files Browse the repository at this point in the history
  • Loading branch information
romancardenas committed Jan 23, 2024
1 parent 9b35313 commit bab06ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
ci-linux:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.59.0
# All generated code should be running on stable now, MRSV is 1.61.0
toolchain:
- stable
- nightly
Expand All @@ -34,10 +34,10 @@ jobs:
toolchain: ${{ matrix.toolchain }}
targets: riscv32i-unknown-none-elf,riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf,riscv64gc-unknown-none-elf
- name: Build riscv32i-unknown-none-elf
run: RUSTFLAGS="-C link-arg=-Thifive1-link.x" cargo build --workspace --target riscv32i-unknown-none-elf --features=${{ matrix.cargo_flags }},unsafe-assume-single-core
run: RUSTFLAGS="-C link-arg=-Thifive1-link.x" cargo build --workspace --target riscv32i-unknown-none-elf --features=${{ matrix.cargo_flags }}
- name: Build riscv32imc-unknown-none-elf
run: RUSTFLAGS="-C link-arg=-Thifive1-link.x" cargo build --workspace --target riscv32imc-unknown-none-elf --features=${{ matrix.cargo_flags }},unsafe-assume-single-core
run: RUSTFLAGS="-C link-arg=-Thifive1-link.x" cargo build --workspace --target riscv32imc-unknown-none-elf --features=${{ matrix.cargo_flags }}
- name: Build riscv32imac-unknown-none-elf (no example)
run: cargo build --target riscv32imac-unknown-none-elf --features=${{ matrix.cargo_flags }}
run: cargo build --target riscv32imac-unknown-none-elf --workspace --features=${{ matrix.cargo_flags }}
- name: Build riscv64gc-unknown-none-elf (no example)
run: cargo build --target riscv64gc-unknown-none-elf --features=${{ matrix.cargo_flags }}
run: cargo build --target riscv64gc-unknown-none-elf --workspace --features=${{ matrix.cargo_flags }}
10 changes: 2 additions & 8 deletions riscv-slic-macros/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ use quote::quote;

pub fn api_mod() -> TokenStream {
quote!(
use riscv_slic::InterruptNumber; // expose the InterruptNumber trait

/// Returns the current priority threshold of the SLIC.
///
/// # Safety
Expand All @@ -27,7 +25,6 @@ pub fn api_mod() -> TokenStream {
critical_section::with(|cs| {
let mut slic = __SLIC.borrow_ref_mut(cs);
slic.set_threshold(thresh);
// check if we need to trigger a software interrupt after changing the threshold
if slic.is_ready() {
__riscv_slic_swi_pend();
}
Expand Down Expand Up @@ -69,7 +66,6 @@ pub fn api_mod() -> TokenStream {
critical_section::with(|cs| {
let mut slic = __SLIC.borrow_ref_mut(cs);
slic.pend(interrupt);
// check if we need to trigger a software interrupt after pending
if slic.is_ready() {
__riscv_slic_swi_pend();
}
Expand All @@ -84,10 +80,8 @@ pub fn api_mod() -> TokenStream {
#[inline]
#[no_mangle]
pub unsafe fn __riscv_slic_run() {
if let Some((priority, interrupt)) =
critical_section::with(|cs| __SLIC.borrow_ref_mut(cs).pop())
{
riscv_slic::run(priority, || __SOFTWARE_INTERRUPTS[interrupt as usize]());
if let Some((pri, int)) = critical_section::with(|cs| __SLIC.borrow_ref_mut(cs).pop()) {
riscv_slic::run(pri, || __SOFTWARE_INTERRUPTS[int as usize]());
}
}
)
Expand Down

0 comments on commit bab06ba

Please sign in to comment.