|
3 | 3 | $schema: "inst_schema.json#"
|
4 | 4 | kind: instruction
|
5 | 5 | name: wrs.nto
|
6 |
| -long_name: No synopsis available |
| 6 | +long_name: Wait-on-Reservation-Set-with-No-Timeout |
7 | 7 | description: |
|
8 |
| - No description available. |
| 8 | + -id: inst-wrs.nto-behaviour |
| 9 | + -normative: false |
| 10 | + -text: | |
| 11 | + To mitigate the wasteful looping in such usages, a `wrs.nto` (WRS-with-no-timeout) instruction is provided. |
| 12 | + Instead of polling for a store to a specific memory location, software registers a reservation set that |
| 13 | + includes all the bytes of the memory location using the LR instruction. Then a subsequent `wrs.nto` |
| 14 | + instruction would cause the hart to temporarily stall execution in a low-power state until a store |
| 15 | + occurs to the reservation set or an interrupt is observed. |
| 16 | +
|
| 17 | + This instruction is not supported in a constrained LR/SC loop. |
| 18 | + While stalled, an implementation is permitted to occasionally terminate the stall and complete |
| 19 | + execution for any reason. |
| 20 | +
|
| 21 | + `wrs.nto` follows the rules of the WFI instruction for resuming execution |
| 22 | + on a pending interrupt. |
| 23 | +
|
| 24 | + When the TW (Timeout Wait) bit in `mstatus` is set and `wrs.nto` is executed |
| 25 | + in any privilege mode otherthan M mode, and it does not complete within an implementation-specific |
| 26 | + bounded time limit, the `wrs.nto` instruction will cause an illegal instruction exception. |
| 27 | +
|
| 28 | + When executing in VS or VU mode, if the VTW bit is set in `hstatus`, the TW bit in `mstatus` is clear, |
| 29 | + and the `wrs.nto` does not complete within an implementation-specific bounded time limit, |
| 30 | + the `wrs.nto` instruction will cause a virtual instruction exception. |
| 31 | +
|
| 32 | + [Note] |
| 33 | + Since `wrs.nto` can complete execution for reasons other than stores to the reservation set, |
| 34 | + software will likely need a means of looping until the required stores have occurred. |
| 35 | +
|
| 36 | + [Note] |
| 37 | + `wrs.nto`, unlike WFI, is not specified to cause an illegal instruction exception if executed in U-mode |
| 38 | + when the governing TW bit is 0. WFI is typically not expected to be used in U-mode and on many systems |
| 39 | + may promptly cause an illegal instruction exception if used at U-mode. |
| 40 | + Unlike WFI, `wrs.nto` is expected to be used by software in U-mode when waiting on memory but without |
| 41 | + a deadline for that wait. |
9 | 42 | definedBy: Zawrs
|
10 |
| -assembly: wrs_nto |
| 43 | +assembly: "" |
11 | 44 | encoding:
|
12 | 45 | match: "00000000110100000000000001110011"
|
13 | 46 | variables: []
|
|
0 commit comments