mscontext
Machine Supervisor Context
- Address
0x7AA- Group
- Debug CSRs (0x7A0 to 0x7BF)
- Access
- read/write; lowest privilege M (machine)
- Address range
- Standard read/write debug CSRs
- Name in riscv-unified-db
- Machine Supervisor Context
Description
This optional register is an alias for scontext. It is only
accessible in S/HS-mode, M-mode and Debug Mode. It is included
for backward compatibility with version 0.13.
The encoding of this CSR does not conform to the CSR Address
Mapping Convention in the Privileged Spec. It is expected that
new implementations will not support this encoding and that new
debuggers will not use this CSR if scontext is available.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description |
|---|---|---|---|
DATA | RV32 31-0 / RV64 63-0 | RW | Supervisor mode software can write a context number to this register, which can be used to set triggers that only fire in that specific context. An implementation may tie any number of high bits in this field to 0. It’s recommended to implement 16 bits on RV32 and 32 bits on RV64. |
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/mscontext.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)