Xiang Wang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
arch/riscv: Add error detection for supports_extension
Change-Id: I5df3d82b9a9b4968beea6040b86628b58fd8a45d Signed-off-by: Xiang Wang merle@hardenedlinux.org --- M src/arch/riscv/include/arch/cpu.h 1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/37130/1
diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h index 72a8a69..dd70af7 100644 --- a/src/arch/riscv/include/arch/cpu.h +++ b/src/arch/riscv/include/arch/cpu.h @@ -49,7 +49,7 @@ * */ int soc_supports_extension(char ext);
-static inline int supports_extension(char ext) +static inline int supports_extension_imp(char ext) { uintptr_t isa = read_csr(misa); if (isa) @@ -58,6 +58,13 @@ return soc_supports_extension(ext); }
+#define supports_extension(c)\ +({\ + _Static_assert(((c >= 'A') && (c <= 'Z')),\ + "The parameter of supports_extension must be [A-Z]");\ + supports_extension_imp(c);\ +}) + /* If the SOC does not implement misa, the read misa will be zero. * Such SOC requires a non-standard mechanism to detect machine XLEN. * If the soc does not implement misa, implement this function.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37130/1/src/arch/riscv/include/arch... File src/arch/riscv/include/arch/cpu.h:
https://review.coreboot.org/c/coreboot/+/37130/1/src/arch/riscv/include/arch... PS1, Line 64: "The parameter of supports_extension must be [A-Z]");\ Prefer using '"%s...", __func__' to using 'supports_extension', this function's name, in a string
Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37130/1/src/arch/riscv/include/arch... File src/arch/riscv/include/arch/cpu.h:
https://review.coreboot.org/c/coreboot/+/37130/1/src/arch/riscv/include/arch... PS1, Line 64: "The parameter of supports_extension must be [A-Z]");\
Prefer using '"%s... […]
The robot incorrectly recognizes the macro as a function.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37130/2/src/arch/riscv/include/arch... File src/arch/riscv/include/arch/cpu.h:
https://review.coreboot.org/c/coreboot/+/37130/2/src/arch/riscv/include/arch... PS2, Line 64: "The parameter of supports_extension must be [A-Z]");\ Prefer using '"%s...", __func__' to using 'supports_extension', this function's name, in a string
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37130/3/src/arch/riscv/include/arch... File src/arch/riscv/include/arch/cpu.h:
https://review.coreboot.org/c/coreboot/+/37130/3/src/arch/riscv/include/arch... PS3, Line 64: "The parameter of supports_extension must be [A-Z]");\ Prefer using '"%s...", __func__' to using 'supports_extension', this function's name, in a string
Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 3:
Have anything update ?
Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 3:
Have anything update ?
Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 3:
Have anything update?
Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37130 )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Patch Set 3:
Have anything update?
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/37130?usp=email )
Change subject: arch/riscv: Add error detection for supports_extension ......................................................................
Abandoned
This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author.