summaryrefslogtreecommitdiff
path: root/lib/utils/cppc
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2025-02-20 10:42:29 -0800
committerAnup Patel <[email protected]>2025-03-24 17:56:08 +0530
commit757f7acafdd25e0ff71a444bbe9f670bc33a3b7f (patch)
tree259fa5f4515274474399e3624859e248e5fc89a2 /lib/utils/cppc
parent6b97950cf5d51afcfd8d059a0d8baa15601e55ab (diff)
lib: sbi_scratch: Add sbi_hart_count() and for_each_hartindex()
There is currently no helper for iterating through the harts in a system, and code must choose between sbi_scratch_last_hartindex() and sbi_platform_hart_count() for the loop condition. sbi_scratch_last_hartindex() has unusual semantics, leading to the likelihood of off-by-one errors, and sbi_platform_hart_count() is provided by the platform and so may not be properly bounded. Add a new helper which definitively reports the number of harts managed by this OpenSBI instance, i.e. the number of valid hart indexes, and a convenient iterator macro. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/cppc')
0 files changed, 0 insertions, 0 deletions