Skip to content

Commit 3a05e2c

Browse files
committed
Clarify the logical counter index in the snapshot area.
The counter start/stop function clearly states that snapshot shared memory area is only valid for the counters being stopped/started in the respective calls. That means the logical counter index modified must be relative to the counter base provided in the start/stop call. Add more clarification to avoid any ambiguity. Signed-off-by: Atish Patra <[email protected]>
1 parent 0870dde commit 3a05e2c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/ext-pmu.adoc

+12-5
Original file line numberDiff line numberDiff line change
@@ -538,21 +538,28 @@ implement it.
538538
|===
539539
| Name | Offset | Size | Description
540540
| counter_overflow_bitmap | 0x0000 | 8 | A bitmap of all logical overflown
541-
counters. This is valid only if
542-
the `Sscofpmf` ISA extension is
543-
available. Otherwise, it must be
544-
zero.
541+
counters relative to the
542+
`counter_idx_base`. This is valid
543+
only if the `Sscofpmf` ISA
544+
extension is available. Otherwise,
545+
it must be zero.
545546
| counter_values | 0x0008 | 512 | An array of 64-bit logical
546547
counters where each index
547548
represents the value of each
548549
logical counter associated with
549-
hardware/firmware.
550+
hardware/firmware relative to the
551+
`counter_idx_base`.
550552
| Reserved | 0x0208 | 3576 | Reserved for future use
551553
|===
552554
553555
Any future revisions to this structure should be made in a backward compatible
554556
manner and will be associated with an SBI version.
555557
558+
The logical counter indicies in the `counter_overflow_bitmap` and `counter_values`
559+
array are relative w.r.t to `counter_idx_base` argument present in the
560+
`sbi_pmu_counter_stop` and `sbi_pmu_counter_start` functions. This allows the
561+
users to use snapshot feature for more than XLEN counters if required.
562+
556563
This function should be invoked only once per hart at boot time. Once
557564
configured, the SBI implementation has read/write access to the shared memory
558565
when `sbi_pmu_counter_stop` is invoked with the

0 commit comments

Comments
 (0)