Hypervisor Context
This optional register may be implemented only if the H extension is implemented. If it is implemented, `mcontext` must also be implemented.
This register is only accessible in HS-Mode, M-mode and Debug Mode. If Smstateen is implemented, then accessibility of in HS-Mode is controlled by `mstateen0[57]`.
This register is an alias of the `mcontext` register, providing access to the HCONTEXT field from HS-Mode.
| 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| — | HCONTEXT | ||||||||||||||||||||||||||||||
| 63:56 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| — | HCONTEXT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| [13:0] | HCONTEXT | mcontext.HCONTEXT | Alias of `mcontext.HCONTEXT`. | RW | 0 |
# check if mstateen0 is implemented
if (implemented?(ExtensionName::Smstateen) && CSR[mstateen0].CONTEXT != 0) {
unimplemented_csr($encoding);
}
# check if HCONTEXT is implemented
if (!HCONTEXT_IMPLEMENTED) {
unimplemented_csr($encoding);
}
# return the value of mcontext
return $bits(CSR[mcontext]); # might truncate if xlen() < MXLEN, but that's the expected behaviorVersion af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.