summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-01-17 08:56:05 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-01-19 19:29:42 +0000
commit4ac35707d9f2d358487b58398597bc66d3b215e5 (patch)
tree8b6fdaa4a6c69b75d383f4fc885db0235778052d /src/arch
parent0767da9fc90aeeaece0c1d5f532bf5d48ba6cb87 (diff)
arch/riscv: Fix some SMP related headers
Change-Id: I58419450dbe34741b4f5b4920f435fdb91e9df22 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61143 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/riscv/include/arch/barrier.h2
-rw-r--r--src/arch/riscv/include/arch/smp/spinlock.h4
-rw-r--r--src/arch/riscv/smp.c5
3 files changed, 6 insertions, 5 deletions
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 <arch/encoding.h>
+#include <arch/barrier.h>
#include <arch/smp/atomic.h>
-#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 <arch/barrier.h>
#include <arch/encoding.h>
#include <arch/smp/smp.h>
-#include <arch/smp/spinlock.h>
-#include <mcall.h>
+#include <arch/smp/atomic.h>
#include <console/console.h>
+#include <mcall.h>
void smp_pause(int working_hartid)
{