From 4ac35707d9f2d358487b58398597bc66d3b215e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 17 Jan 2022 08:56:05 +0200 Subject: arch/riscv: Fix some SMP related headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I58419450dbe34741b4f5b4920f435fdb91e9df22 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/61143 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/arch/riscv/include/arch/barrier.h | 2 ++ src/arch/riscv/include/arch/smp/spinlock.h | 4 +--- src/arch/riscv/smp.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/arch/riscv') diff --git a/src/arch/riscv/include/arch/barrier.h b/src/arch/riscv/include/arch/barrier.h index 798f879a32..023e8c3acd 100644 --- a/src/arch/riscv/include/arch/barrier.h +++ b/src/arch/riscv/include/arch/barrier.h @@ -7,4 +7,6 @@ static inline void mb(void) { asm volatile("fence"); } static inline void rmb(void) { asm volatile("fence"); } static inline void wmb(void) { asm volatile("fence"); } +#define barrier() { asm volatile ("fence" ::: "memory"); } + #endif /* __ARCH_BARRIER_H__ */ diff --git a/src/arch/riscv/include/arch/smp/spinlock.h b/src/arch/riscv/include/arch/smp/spinlock.h index b316ff078d..968fdc6c70 100644 --- a/src/arch/riscv/include/arch/smp/spinlock.h +++ b/src/arch/riscv/include/arch/smp/spinlock.h @@ -3,11 +3,9 @@ #ifndef ARCH_SMP_SPINLOCK_H #define ARCH_SMP_SPINLOCK_H -#include +#include #include -#define barrier() { asm volatile ("fence" ::: "memory"); } - typedef struct { atomic_t lock; } spinlock_t; diff --git a/src/arch/riscv/smp.c b/src/arch/riscv/smp.c index 1d58602627..0a93763cb0 100644 --- a/src/arch/riscv/smp.c +++ b/src/arch/riscv/smp.c @@ -1,10 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include -#include -#include +#include #include +#include void smp_pause(int working_hartid) { -- cgit v1.2.3