Skip to content

Commit 7c5d838

Browse files
charlie-rivospalmer-dabbelt
authored andcommitted
documentation: Fix riscv cmodx example
ON/OFF in the keys was swapped between the first and second argument of the prctl. The prctl key is always PR_RISCV_SET_ICACHE_FLUSH_CTX, and the second argument can be PR_RISCV_CTX_SW_FENCEI_ON or PR_RISCV_CTX_SW_FENCEI_OFF. Signed-off-by: Charlie Jenkins <[email protected]> Fixes: 6a08e47 ("documentation: Document PR_RISCV_SET_ICACHE_FLUSH_CTX prctl") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 22a40d1 commit 7c5d838

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Documentation/arch/riscv/cmodx.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ cmodx.c::
6262
printf("Value before cmodx: %d\n", value);
6363

6464
// Call prctl before first fence.i is called inside modify_instruction
65-
prctl(PR_RISCV_SET_ICACHE_FLUSH_CTX_ON, PR_RISCV_CTX_SW_FENCEI, PR_RISCV_SCOPE_PER_PROCESS);
65+
prctl(PR_RISCV_SET_ICACHE_FLUSH_CTX, PR_RISCV_CTX_SW_FENCEI_ON, PR_RISCV_SCOPE_PER_PROCESS);
6666
modify_instruction();
6767
// Call prctl after final fence.i is called in process
68-
prctl(PR_RISCV_SET_ICACHE_FLUSH_CTX_OFF, PR_RISCV_CTX_SW_FENCEI, PR_RISCV_SCOPE_PER_PROCESS);
68+
prctl(PR_RISCV_SET_ICACHE_FLUSH_CTX, PR_RISCV_CTX_SW_FENCEI_OFF, PR_RISCV_SCOPE_PER_PROCESS);
6969

7070
value = get_value();
7171
printf("Value after cmodx: %d\n", value);

0 commit comments

Comments
 (0)