mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-25 15:48:27 +00:00
lib: sbi_pmu: remove mhpm_count field in hart feature
After supporting noncontigous hpm event and counters in opensbi, the number of hpm counters can be calculated by the mhpm_mask. So this field is unnecessary and can be removed to save some space. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
e7e73aa532
commit
ee1f83ca84
5 changed files with 37 additions and 34 deletions
|
@ -112,6 +112,22 @@ static inline unsigned long sbi_fls(unsigned long word)
|
|||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* sbi_popcount - find the number of set bit in a long word
|
||||
* @word: the word to search
|
||||
*/
|
||||
static inline unsigned long sbi_popcount(unsigned long word)
|
||||
{
|
||||
unsigned long count = 0;
|
||||
|
||||
while (word) {
|
||||
word &= word - 1;
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#define for_each_set_bit(bit, addr, size) \
|
||||
for ((bit) = find_first_bit((addr), (size)); \
|
||||
(bit) < (size); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue