Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm Use some mac...
details: https://anonhg.NetBSD.org/src/rev/2f787b32a2f4
branches: trunk
changeset: 350464:2f787b32a2f4
user: skrll <skrll%NetBSD.org@localhost>
date: Thu Jan 12 05:35:45 2017 +0000
description:
Use some macros for magic numbers and correct return value.
diffstat:
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c | 32 ++++++---
1 files changed, 21 insertions(+), 11 deletions(-)
diffs (70 lines):
diff -r 0cae018bcc95 -r 2f787b32a2f4 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c Thu Jan 12 05:25:03 2017 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_kmod_netbsd.c Thu Jan 12 05:35:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vchiq_kmod_netbsd.c,v 1.6 2016/01/15 07:49:41 mlelstv Exp $ */
+/* $NetBSD: vchiq_kmod_netbsd.c,v 1.7 2017/01/12 05:35:45 skrll Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_netbsd.c,v 1.6 2016/01/15 07:49:41 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vchiq_kmod_netbsd.c,v 1.7 2017/01/12 05:35:45 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,6 +72,13 @@
/* External functions */
int vchiq_init(void);
+
+#define VCHIQ_DOORBELL0 0x40
+#define VCHIQ_DOORBELL1 0x44
+#define VCHIQ_DOORBELL2 0x48
+#define VCHIQ_DOORBELL3 0x4C
+
+
CFATTACH_DECL_NEW(vchiq, sizeof(struct vchiq_softc),
vchiq_match, vchiq_attach, NULL, NULL);
@@ -138,14 +145,17 @@
struct vchiq_softc *sc = priv;
uint32_t status;
- status = bus_space_read_4(sc->sc_iot, sc->sc_ioh, 0x40);
- if (status & 0x4)
- remote_event_pollall(&g_state);
+ bus_space_barrier(sc->sc_iot, sc->sc_ioh,
+ VCHIQ_DOORBELL0, 4, BUS_SPACE_BARRIER_READ);
- bus_space_barrier(vchiq_softc->sc_iot, vchiq_softc->sc_ioh,
- 0x40, 4, BUS_SPACE_BARRIER_READ);
+ rmb();
+ status = bus_space_read_4(sc->sc_iot, sc->sc_ioh, VCHIQ_DOORBELL0);
+ if (status & 0x4) {
+ remote_event_pollall(&g_state);
+ return 1;
+ }
- return 1;
+ return 0;
}
static int
@@ -169,10 +179,10 @@
dsb(); /* data barrier operation */
if (event->armed) {
- bus_space_barrier(vchiq_softc->sc_iot, vchiq_softc->sc_ioh,
- 0x48, 4, BUS_SPACE_BARRIER_WRITE);
bus_space_write_4(vchiq_softc->sc_iot, vchiq_softc->sc_ioh,
- 0x48, 0);
+ VCHIQ_DOORBELL2, 0);
+ bus_space_barrier(vchiq_softc->sc_iot, vchiq_softc->sc_ioh,
+ VCHIQ_DOORBELL2, 4, BUS_SPACE_BARRIER_WRITE);
}
}
Home |
Main Index |
Thread Index |
Old Index