diff options
| author | Anup Patel <[email protected]> | 2023-09-02 17:34:32 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-09-24 11:48:21 +0530 |
| commit | 9560fb38febf6e74d30a2c22e020b0e0dece8d49 (patch) | |
| tree | b72baf74e8afc70ccd1b459abbbbd2203ebad991 | |
| parent | 112daa2e647cb819834b84abd77cd8cdfc3bfee3 (diff) | |
include: sbi: Remove sbi_hartmask_for_each_hart() macro
The sbi_hartmask_for_each_hart() macro is slow and has only one user
so let us completely remove the sbi_hartmask_for_each_hart() macro.
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | include/sbi/sbi_hartmask.h | 13 | ||||
| -rw-r--r-- | lib/sbi/sbi_system.c | 3 |
2 files changed, 2 insertions, 14 deletions
diff --git a/include/sbi/sbi_hartmask.h b/include/sbi/sbi_hartmask.h index 105653e1..bcfa50db 100644 --- a/include/sbi/sbi_hartmask.h +++ b/include/sbi/sbi_hartmask.h @@ -170,19 +170,6 @@ static inline void sbi_hartmask_xor(struct sbi_hartmask *dstp, } /** - * Iterate over each HART in hartmask - * __h hart id - * __i hart index - * __m hartmask -*/ -#define sbi_hartmask_for_each_hart(__h, __i, __m) \ - for((__i) = find_first_bit((__m)->bits, SBI_HARTMASK_MAX_BITS), \ - (__h) = sbi_hartindex_to_hartid(__i); \ - (__i) < SBI_HARTMASK_MAX_BITS; \ - (__i) = find_next_bit((__m)->bits, SBI_HARTMASK_MAX_BITS, (__i) + 1), \ - (__h) = sbi_hartindex_to_hartid(__i)) - -/** * Iterate over each HART index in hartmask * __i hart index * __m hartmask diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index bae97304..d1fa3495 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -170,7 +170,8 @@ int sbi_system_suspend(u32 sleep_type, ulong resume_addr, ulong opaque) if (prev_mode != PRV_S && prev_mode != PRV_U) return SBI_EFAIL; - sbi_hartmask_for_each_hart(i, j, &dom->assigned_harts) { + sbi_hartmask_for_each_hartindex(j, &dom->assigned_harts) { + i = sbi_hartindex_to_hartid(j); if (i == hartid) continue; if (__sbi_hsm_hart_get_state(i) != SBI_HSM_STATE_STOPPED) |
