Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/dev Fixed for amigappc by executing eieio aft...
details: https://anonhg.NetBSD.org/src/rev/9ed4fa65eaba
branches: trunk
changeset: 751322:9ed4fa65eaba
user: phx <phx%NetBSD.org@localhost>
date: Sun Jan 31 19:56:19 2010 +0000
description:
Fixed for amigappc by executing eieio after writing to a vga register.
diffstat:
sys/arch/amiga/dev/grf_cv.c | 14 ++------------
sys/arch/amiga/dev/grf_cvreg.h | 23 ++++++++++++++++++-----
2 files changed, 20 insertions(+), 17 deletions(-)
diffs (98 lines):
diff -r f086655f37b7 -r 9ed4fa65eaba sys/arch/amiga/dev/grf_cv.c
--- a/sys/arch/amiga/dev/grf_cv.c Sun Jan 31 19:49:29 2010 +0000
+++ b/sys/arch/amiga/dev/grf_cv.c Sun Jan 31 19:56:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: grf_cv.c,v 1.49 2010/01/30 16:49:14 phx Exp $ */
+/* $NetBSD: grf_cv.c,v 1.50 2010/01/31 19:56:19 phx Exp $ */
/*
* Copyright (c) 1995 Michael Teske
@@ -33,7 +33,7 @@
#include "opt_amigacons.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grf_cv.c,v 1.49 2010/01/30 16:49:14 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cv.c,v 1.50 2010/01/31 19:56:19 phx Exp $");
#include "grfcv.h"
#if NGRFCV > 0
@@ -68,16 +68,6 @@
#include <amiga/dev/grf_cvreg.h>
#include <amiga/dev/zbusvar.h>
-/*
- * finish all bus operations, flush pipelines
- * XXX is this really needed?
- */
-#if defined(__m68k__)
-#define cpu_sync() __asm volatile ("nop")
-#elif defined(__powerpc__)
-#define cpu_sync() __asm volatile ("sync; isync")
-#endif
-
int grfcvmatch(struct device *, struct cfdata *, void *);
void grfcvattach(struct device *, struct device *, void *);
int grfcvprint(void *, const char *);
diff -r f086655f37b7 -r 9ed4fa65eaba sys/arch/amiga/dev/grf_cvreg.h
--- a/sys/arch/amiga/dev/grf_cvreg.h Sun Jan 31 19:49:29 2010 +0000
+++ b/sys/arch/amiga/dev/grf_cvreg.h Sun Jan 31 19:56:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: grf_cvreg.h,v 1.13 2008/12/18 05:04:22 mhitch Exp $ */
+/* $NetBSD: grf_cvreg.h,v 1.14 2010/01/31 19:56:19 phx Exp $ */
/*
* Copyright (c) 1995 Michael Teske
@@ -59,12 +59,25 @@
#define MAXROWS 200
#define MAXCOLS 200
+/*
+ * macros for
+ * finishing all bus operations and flush pipelines: cpu_sync()
+ * barrier to ensure in order execution: barrier()
+ */
+#if defined(__m68k__)
+#define cpu_sync() __asm volatile ("nop")
+#define barrier()
+#elif defined(__powerpc__)
+#define cpu_sync() __asm volatile ("sync; isync")
+#define barrier() __asm volatile ("eieio")
+#endif
+
/* read VGA register */
#define vgar(ba, reg) (*(((volatile char *)ba)+reg))
/* write VGA register */
#define vgaw(ba, reg, val) \
- *(((volatile char *)ba)+reg) = ((val) & 0xff)
+ *(((volatile char *)ba)+reg) = ((val) & 0xff); barrier()
/* read 32 Bit VGA register */
@@ -73,7 +86,7 @@
/* write 32 Bit VGA register */
#define vgaw32(ba, reg, val) \
- *((unsigned long *) (((volatile char *)ba)+reg)) = val
+ *((unsigned long *) (((volatile char *)ba)+reg)) = val; barrier()
/* read 16 Bit VGA register */
#define vgar16(ba, reg) \
@@ -81,7 +94,7 @@
/* write 16 Bit VGA register */
#define vgaw16(ba, reg, val) \
- *((volatile unsigned short *) (((volatile char *)ba)+reg)) = val
+ *((volatile unsigned short *) (((volatile char *)ba)+reg)) = val; barrier()
#ifdef _KERNEL
int grfcv_cnprobe(void);
@@ -374,7 +387,7 @@
do {
test = vgar16 (ba, ECR_GP_STAT);
- __asm volatile ("nop");
+ cpu_sync();
} while (test & (1 << 9));
}
Home |
Main Index |
Thread Index |
Old Index