include: sbi: Don't unconditionally define '__always_inline'
PATCH 1/1 include: sbi: Don't unconditionally define '__always_inline'
From: Elyes Haouas <[email protected]>
Update __always_inline macro define to fix opensbi upstream
build for coreboot.
Refer, https://qa.coreboot.org/job/coreboot-gerrit/257449/testReport/junit/(root)/clang/EMULATION_QEMU_RISCV_RV64_/
--- include/sbi/sbi_types.h | 3 +++ 1 file changed, 3 insertions(+)
include/sbi/sbi_types.h +3 -0
@@ -69,7 +69,10 @@ typedef uint64_t be64_t;#define __packed __attribute__((packed))#define __noreturn __attribute__((noreturn))#define __aligned (x) __attribute__((aligned(x))) + +#ifndef __always_inline#define __always_inline inline __attribute__((always_inline)) +#endif #define likely (x) __builtin_expect((x), 1)#define unlikely (x) __builtin_expect((x), 0)
Signature · 1 line
2.43.0
PATCH 1/1 include: sbi: Don't unconditionally define '__always_inline'
Quoted 18 lines · Anup Patel
From: Elyes Haouas <[email protected]>
Update
__always_inlinemacro define to fix opensbi upstream
build for coreboot.
Refer, https://qa.coreboot.org/job/coreboot-gerrit/257449/testReport/junit/(root)/clang/EMULATION_QEMU_RISCV_RV64_/Signed-off-by Elyes Haouas <[email protected]>Signed-off-by Anup Patel <[email protected]>--- include/sbi/sbi_types.h | 3 +++ 1 file changed, 3 insertions(+)include/sbi/sbi_types.h +0
-0
include/sbi/sbi_types.h typedef uint64_t be64_t; · line 75
Quoted 7 lines
include/sbi/sbi_types.h +3
-0@@ -69,7 +69,10 @@ typedef uint64_t be64_t;#define __packed __attribute__((packed))#define __noreturn __attribute__((noreturn))#define __aligned (x) __attribute__((aligned(x))) + +#ifndef __always_inline#define __always_inline inline __attribute__((always_inline)) +#endif
If we're concerned about an existing definition behaving differently, we could unconditionally #undef __always_inline instead. But I expect any existing definition to be equivalent, so:
Quoted 3 lines
include/sbi/sbi_types.h +0
-0#define likely (x) __builtin_expect((x), 1)#define unlikely (x) __builtin_expect((x), 0)
Anup Patel
AppliedPATCH 1/1 include: sbi: Don't unconditionally define '__always_inline'
In reply to Anup PatelQuoted 10 lines · On Sun, Sep 15, 2024 at 9:34?PM Anup Patel <[email protected]> wrote:
From: Elyes Haouas <[email protected]>
Update
__always_inlinemacro define to fix opensbi upstream
build for coreboot.
Refer, https://qa.coreboot.org/job/coreboot-gerrit/257449/testReport/junit/(root)/clang/EMULATION_QEMU_RISCV_RV64_/Signed-off-by Elyes Haouas <[email protected]>Signed-off-by Anup Patel <[email protected]>
Applied this patch to the riscv/opensbi repo.
Thanks,
Anup
Quoted 22 lines
--- include/sbi/sbi_types.h | 3 +++ 1 file changed, 3 insertions(+)include/sbi/sbi_types.h +3
-1@@ -69,7 +69,10 @@ typedef uint64_t be64_t;#define __packed __attribute__((packed))#define __noreturn __attribute__((noreturn))#define __aligned (x) __attribute__((aligned(x))) + +#ifndef __always_inline#define __always_inline inline __attribute__((always_inline)) +#endif #define likely (x) __builtin_expect((x), 1)#define unlikely (x) __builtin_expect((x), 0) --2.43.0