Skip to content

Commit aab73db

Browse files
committed
riscv_csr: Set OPST=ES16 to indicate success
Previously, the OPST field was set to BIST (0), indicating that a Built-In Self-Test is running.
1 parent cf79e38 commit aab73db

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/riscv_csr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static inline bool riscv_csr_seed(rvvm_hart_t* vm, rvvm_uxlen_t* dest)
166166
if (riscv_csr_seed_enabled(vm)) {
167167
uint16_t seed = 0;
168168
rvvm_randombytes(&seed, sizeof(seed));
169-
return riscv_csr_const(dest, seed);
169+
return riscv_csr_const(dest, seed | CSR_SEED_OPST_ES16);
170170
}
171171
return false;
172172
}

src/riscv_csr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ file, You can obtain one at https://mozilla.org/MPL/2.0/.
297297
#define CSR_COUNTEREN_TM 0x2U
298298
#define CSR_COUNTEREN_IR 0x4U
299299

300+
#define CSR_SEED_OPST_ES16 (3ULL << 30)
301+
300302
/*
301303
* CSR Masks (For WARL behavior of CSRs)
302304
*/

0 commit comments

Comments
 (0)