lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]
PATCH 1/1 lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]
The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when adding a new extension, there is a mismatch between ids and extension names and it can even display corrupted extension names.
--- lib/sbi/sbi_hart.c | 2 ++ 1 file changed, 2 insertions(+)
lib/sbi/sbi_hart.c +2 -0
@@ -666,6 +666,8 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {__SBI_HART_EXT_DATA (sdtrig,SBI_HART_EXT_SDTRIG ),__SBI_HART_EXT_DATA (smcsrind,SBI_HART_EXT_SMCSRIND ),__SBI_HART_EXT_DATA (smcdeleg,SBI_HART_EXT_SMCDELEG ), +__SBI_HART_EXT_DATA (sscsrind,SBI_HART_EXT_SSCSRIND ), + __SBI_HART_EXT_DATA(ssccfg, SBI_HART_EXT_SSCCFG), };/**
Signature · 1 line
2.43.0
PATCH 1/1 lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]
Quoted 17 lines · Cl?ment L?ger
The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when adding a new extension, there is a mismatch between ids and extension names and it can even display corrupted extension names.
Signed-off-by Cl?ment L?ger <[email protected]>--- lib/sbi/sbi_hart.c | 2 ++ 1 file changed, 2 insertions(+)lib/sbi/sbi_hart.c +0
-0
lib/sbi/sbi_hart.c const struct sbi_hart_ext_data sbi_hart_ext[] = { · line 671
Quoted 6 lines
lib/sbi/sbi_hart.c +2
-0@@ -666,6 +666,8 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {__SBI_HART_EXT_DATA (sdtrig,SBI_HART_EXT_SDTRIG ),__SBI_HART_EXT_DATA (smcsrind,SBI_HART_EXT_SMCSRIND ),__SBI_HART_EXT_DATA (smcdeleg,SBI_HART_EXT_SMCDELEG ), +__SBI_HART_EXT_DATA (sscsrind,SBI_HART_EXT_SSCSRIND ), + __SBI_HART_EXT_DATA(ssccfg, SBI_HART_EXT_SSCCFG), };
Please add a static_assert to verify that the size of sbi_hart_ext agrees with SBI_HART_EXT_MAX.
Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
PATCH 1/1 lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]
Quoted 14 lines · Andreas Schwab
Quoted 12 lines · Cl?ment L?ger
The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when adding a new extension, there is a mismatch between ids and extension names and it can even display corrupted extension names.
Signed-off-by Cl?ment L?ger <[email protected]>--- lib/sbi/sbi_hart.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 14 lines
lib/sbi/sbi_hart.c const struct sbi_hart_ext_data sbi_hart_ext[] = { · line 671
Quoted 11 lines
lib/sbi/sbi_hart.c +2
-0@@ -666,6 +666,8 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {__SBI_HART_EXT_DATA (sdtrig,SBI_HART_EXT_SDTRIG ),__SBI_HART_EXT_DATA (smcsrind,SBI_HART_EXT_SMCSRIND ),__SBI_HART_EXT_DATA (smcdeleg,SBI_HART_EXT_SMCDELEG ), +__SBI_HART_EXT_DATA (sscsrind,SBI_HART_EXT_SSCSRIND ), + __SBI_HART_EXT_DATA(ssccfg, SBI_HART_EXT_SSCCFG), };Please add a
static_assertto verify that the size ofsbi_hart_extagrees withSBI_HART_EXT_MAX.
Yes sure.
Regards,
Cl?ment
Anup Patel
AppliedPATCH 1/1 lib: sbi: Add missing sscrind and sscfg extensions in sbi_hart_ext[]
In reply to Clément LégerQuoted 8 lines · On Wed, Mar 20, 2024 at 8:21?PM Cl?ment L?ger <[email protected]> wrote:
The sbi_hart_ext[] array is missing these two extensions ids. It is expected that this array contains all the extensions declaration at the same index of the SBI_HART_EXT_* define. Without this, when adding a new extension, there is a mismatch between ids and extension names and it can even display corrupted extension names.
Signed-off-by Cl?ment L?ger <[email protected]>
I have taken _Static_assert() and Fixes tag from Heinrich's patch.
Applied this patch to the riscv/opensbi repo.
Thanks,
Anup
Quoted 26 lines
--- lib/sbi/sbi_hart.c | 2 ++ 1 file changed, 2 insertions(+)lib/sbi/sbi_hart.c +2
-1@@ -666,6 +666,8 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {__SBI_HART_EXT_DATA (sdtrig,SBI_HART_EXT_SDTRIG ),__SBI_HART_EXT_DATA (smcsrind,SBI_HART_EXT_SMCSRIND ),__SBI_HART_EXT_DATA (smcdeleg,SBI_HART_EXT_SMCDELEG ), +__SBI_HART_EXT_DATA (sscsrind,SBI_HART_EXT_SSCSRIND ), + __SBI_HART_EXT_DATA(ssccfg, SBI_HART_EXT_SSCCFG), };/** -- 2.43.0
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi