Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V targets do not support ARM "thread mode" check #7

Open
Disasm opened this issue Jun 21, 2020 · 0 comments
Open

RISC-V targets do not support ARM "thread mode" check #7

Disasm opened this issue Jun 21, 2020 · 0 comments

Comments

@Disasm
Copy link
Member

Disasm commented Jun 21, 2020

fn in_thread_mode() -> bool {
const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32;
// NOTE(unsafe) single-instruction load with no side effects
unsafe { SCB_ICSR.read_volatile() as u8 == 0 }
}

This code checks for a value of the VECTACTIVE field (only for bits 7..0 of the 9-bit field). This value corresponds to the current interrupt number handled (0 for none).

I wonder what should we use here for RISC-V. @ilya-epifanov any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant