Skip to content

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

Open
@Disasm

Description

@Disasm

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions