mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-01-02 18:51:14 +00:00
Currently, OpenSBI fails to compile for LLVM=1 using 2025.11.27
riscv-gnu-toolchain with the following error:
In file included from opensbi/lib/utils/suspend/fdt_suspend_sifive_smc0.c:20:
opensbi/include/sbi_utils/hsm/fdt_hsm_sifive_inst.h:17:23: error: expected instruction format
17 | __asm__ __volatile__(".insn 0xfc000073" ::: "memory");
| ^
<inline asm>:1:8: note: instantiated into assembly here
1 | .insn 0xfc000073
| ^
In file included from opensbi/lib/utils/suspend/fdt_suspend_sifive_smc0.c:20:
opensbi/include/sbi_utils/hsm/fdt_hsm_sifive_inst.h:12:23: error: expected instruction format
12 | __asm__ __volatile__(".insn 0x30500073" ::: "memory");
| ^
<inline asm>:1:8: note: instantiated into assembly here
1 | .insn 0x30500073
| ^
2 errors generated.
To fix this compile error, use ".word" in-place ".insn".
Fixes: 1514a32730 ("lib: utils/hsm: Add SiFive TMC0 driver")
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251227100916.327524-1-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
21 lines
361 B
C
21 lines
361 B
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2025 SiFive Inc.
|
|
*/
|
|
|
|
#ifndef __FDT_HSM_SIFIVE_INST_H__
|
|
#define __FDT_HSM_SIFIVE_INST_H__
|
|
|
|
static inline void sifive_cease(void)
|
|
{
|
|
__asm__ __volatile__(".word 0x30500073" ::: "memory");
|
|
}
|
|
|
|
static inline void sifive_cflush(void)
|
|
{
|
|
__asm__ __volatile__(".word 0xfc000073" ::: "memory");
|
|
}
|
|
|
|
#endif
|