Skip to content

Immediate support for CSR instructions? #393

@XuanTongYao

Description

@XuanTongYao

When I use riscv::register::mstatus::set_mie(); to enable global interrupts, the resulting assembly code is quite puzzling.

It does not use the csrsi instruction, but instead uses the csrs instruction.
The csrs instruction uses an additional register.

This causes two problems:

  1. Code bloat
  2. Toggling global interrupts becomes a non-atomic operation (which contradicts the RISC-V Privileges document)

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