Skip to content

The MTIP bit in mip register is read-only #62

Closed
@SKTT1Ryze

Description

@SKTT1Ryze

In the riscv-privileged manual, it is said that "The MTIP bit (in mip) is read-only and is cleared by writing to the memory-mapped machine-mode timer compare register."
But in the riscv crate, there is an interface like this:

use riscv::register::mip;
use riscv_rt::entry;

#[entry]  
fn main() {
    mip::set_mtimer();
}

We can write the code mip::set_mtimer() to set the 7th bit, the MTIP bit, of the mip register, which does not permitted in riscv-privileged manual.
Is there some reason for the existence of mip::set_mtimer()? If not, I suggest remove it.
Thanks.

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