Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch powerpc: Implement bus_space_barrier as eieio.
details: https://anonhg.NetBSD.org/src/rev/f5fb5ab33092
branches: trunk
changeset: 363403:f5fb5ab33092
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Mar 10 00:14:16 2022 +0000
description:
powerpc: Implement bus_space_barrier as eieio.
diffstat:
sys/arch/evbppc/virtex/dcr.c | 11 +++++++++--
sys/arch/evbppc/virtex/dcr.h | 4 +++-
sys/arch/powerpc/include/bus_defs.h | 5 ++++-
sys/arch/powerpc/include/bus_funcs.h | 4 ++--
sys/arch/powerpc/powerpc/bus_space.c | 14 ++++++++++++--
5 files changed, 30 insertions(+), 8 deletions(-)
diffs (130 lines):
diff -r 041342f95929 -r f5fb5ab33092 sys/arch/evbppc/virtex/dcr.c
--- a/sys/arch/evbppc/virtex/dcr.c Wed Mar 09 23:09:15 2022 +0000
+++ b/sys/arch/evbppc/virtex/dcr.c Thu Mar 10 00:14:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dcr.c,v 1.2 2011/07/01 19:03:50 dyoung Exp $ */
+/* $NetBSD: dcr.c,v 1.3 2022/03/10 00:14:16 riastradh Exp $ */
/*
* Copyright (c) 2006 Jachym Holecek
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dcr.c,v 1.2 2011/07/01 19:03:50 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dcr.c,v 1.3 2022/03/10 00:14:16 riastradh Exp $");
#include <sys/types.h>
#include <sys/bus.h>
@@ -66,3 +66,10 @@
return (0);
}
+
+void
+dcr_barrier(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t offset,
+ bus_size_t size, int flags)
+{
+ /* XXX EIEIO? */
+}
diff -r 041342f95929 -r f5fb5ab33092 sys/arch/evbppc/virtex/dcr.h
--- a/sys/arch/evbppc/virtex/dcr.h Wed Mar 09 23:09:15 2022 +0000
+++ b/sys/arch/evbppc/virtex/dcr.h Thu Mar 10 00:14:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dcr.h,v 1.2 2021/10/21 13:21:54 andvar Exp $ */
+/* $NetBSD: dcr.h,v 1.3 2022/03/10 00:14:16 riastradh Exp $ */
/*
* Copyright (c) 2006 Jachym Holecek
@@ -52,6 +52,8 @@
int dcr_map(bus_space_tag_t, bus_addr_t, bus_size_t, int,
bus_space_handle_t *);
void dcr_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+void dcr_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t,
+ bus_size_t, int);
/* Bus space tag contents, one tag per DCR device. */
#define DCR_BST_BODY(base, read, write) \
diff -r 041342f95929 -r f5fb5ab33092 sys/arch/powerpc/include/bus_defs.h
--- a/sys/arch/powerpc/include/bus_defs.h Wed Mar 09 23:09:15 2022 +0000
+++ b/sys/arch/powerpc/include/bus_defs.h Thu Mar 10 00:14:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_defs.h,v 1.4 2020/07/06 09:34:17 rin Exp $ */
+/* $NetBSD: bus_defs.h,v 1.5 2022/03/10 00:14:16 riastradh Exp $ */
/* $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $ */
/*-
@@ -220,6 +220,9 @@
const struct powerpc_bus_space_set *pbs_set;
const struct powerpc_bus_space_set *pbs_set_stream;
const struct powerpc_bus_space_copy *pbs_copy;
+
+ void (*pbs_barrier)(bus_space_tag_t, bus_space_handle_t, bus_size_t,
+ bus_size_t, int);
};
#define _BUS_SPACE_STRIDE(t, o) \
diff -r 041342f95929 -r f5fb5ab33092 sys/arch/powerpc/include/bus_funcs.h
--- a/sys/arch/powerpc/include/bus_funcs.h Wed Mar 09 23:09:15 2022 +0000
+++ b/sys/arch/powerpc/include/bus_funcs.h Thu Mar 10 00:14:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_funcs.h,v 1.1 2011/07/01 17:10:00 dyoung Exp $ */
+/* $NetBSD: bus_funcs.h,v 1.2 2022/03/10 00:14:16 riastradh Exp $ */
/* $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $ */
/*-
@@ -485,7 +485,7 @@
*
*/
#define bus_space_barrier(t, h, o, l, f) \
- ((void)((void)(t), (void)(h), (void)(o), (void)(l), (void)(f)))
+ ((*(t)->pbs_barrier)((t), (h), (o), (l), (f)))
#endif /* !__HAVE_LOCAL_BUS_SPACE */
diff -r 041342f95929 -r f5fb5ab33092 sys/arch/powerpc/powerpc/bus_space.c
--- a/sys/arch/powerpc/powerpc/bus_space.c Wed Mar 09 23:09:15 2022 +0000
+++ b/sys/arch/powerpc/powerpc/bus_space.c Thu Mar 10 00:14:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_space.c,v 1.38 2020/07/06 10:31:24 rin Exp $ */
+/* $NetBSD: bus_space.c,v 1.39 2022/03/10 00:14:16 riastradh Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#define _POWERPC_BUS_SPACE_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.38 2020/07/06 10:31:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.39 2022/03/10 00:14:16 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_ppcarch.h"
@@ -395,6 +395,8 @@
static int memio_alloc(bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t,
bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
static void memio_free(bus_space_tag_t, bus_space_handle_t, bus_size_t);
+static void memio_barrier(bus_space_tag_t, bus_space_handle_t, bus_size_t,
+ bus_size_t, int);
static int extent_flags;
@@ -416,6 +418,7 @@
t->pbs_unmap = memio_unmap;
t->pbs_alloc = memio_alloc;
t->pbs_free = memio_free;
+ t->pbs_barrier = memio_barrier;
if (t->pbs_flags & _BUS_SPACE_STRIDE_MASK) {
t->pbs_scalar_stream = scalar_strided_ops;
@@ -763,3 +766,10 @@
/* memio_unmap() does all that we need to do. */
memio_unmap(t, bsh, size);
}
+
+void
+memio_barrier(bus_space_tag_t t, bus_space_handle_t bsh, bus_size_t size,
+ bus_size_t offset, int flags)
+{
+ __asm volatile("eieio" ::: "memory");
+}
Home |
Main Index |
Thread Index |
Old Index