Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic add support for an optional machine-dependent mma...
details: https://anonhg.NetBSD.org/src/rev/18ffa5c65b67
branches: trunk
changeset: 748928:18ffa5c65b67
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Nov 10 22:23:22 2009 +0000
description:
add support for an optional machine-dependent mmap() method, so the bus
backend can do whatever voodoo necessary to the aperture, IO space etc.
Mainly for shark, to get around the weird ARM bus_space.
diffstat:
sys/dev/ic/igsfb.c | 17 +++++++++--------
sys/dev/ic/igsfbvar.h | 5 ++++-
2 files changed, 13 insertions(+), 9 deletions(-)
diffs (64 lines):
diff -r d6f1a95a5797 -r 18ffa5c65b67 sys/dev/ic/igsfb.c
--- a/sys/dev/ic/igsfb.c Tue Nov 10 21:44:11 2009 +0000
+++ b/sys/dev/ic/igsfb.c Tue Nov 10 22:23:22 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: igsfb.c,v 1.44 2008/04/08 12:07:26 cegger Exp $ */
+/* $NetBSD: igsfb.c,v 1.45 2009/11/10 22:23:22 macallan Exp $ */
/*
* Copyright (c) 2002, 2003 Valeriy E. Ushakov
@@ -31,7 +31,7 @@
* Integraphics Systems IGA 168x and CyberPro series.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.44 2008/04/08 12:07:26 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.45 2009/11/10 22:23:22 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,7 +53,7 @@
#include <dev/ic/igsfbvar.h>
-struct igsfb_devconfig igsfb_console_dc;
+struct igsfb_devconfig igsfb_console_dc = {.dc_mmap = NULL,};
/*
* wsscreen
@@ -577,11 +577,12 @@
struct vcons_data *vd = v;
struct igsfb_devconfig *dc = vd->cookie;
- if (offset >= dc->dc_memsz || offset < 0)
- return -1;
-
- return bus_space_mmap(dc->dc_memt, dc->dc_memaddr, offset, prot,
- dc->dc_memflags | BUS_SPACE_MAP_LINEAR);
+ if (offset < dc->dc_memsz && offset >= 0)
+ return bus_space_mmap(dc->dc_memt, dc->dc_memaddr, offset,
+ prot, dc->dc_memflags | BUS_SPACE_MAP_LINEAR);
+ if (dc->dc_mmap)
+ return dc->dc_mmap(v, vs, offset, prot);
+ return -1;
}
diff -r d6f1a95a5797 -r 18ffa5c65b67 sys/dev/ic/igsfbvar.h
--- a/sys/dev/ic/igsfbvar.h Tue Nov 10 21:44:11 2009 +0000
+++ b/sys/dev/ic/igsfbvar.h Tue Nov 10 22:23:22 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: igsfbvar.h,v 1.16 2006/04/05 01:13:50 uwe Exp $ */
+/* $NetBSD: igsfbvar.h,v 1.17 2009/11/10 22:23:22 macallan Exp $ */
/*
* Copyright (c) 2002, 2003 Valeriy E. Ushakov
@@ -105,6 +105,9 @@
/* saved dc_ri.ri_ops.putchar */
void (*dc_ri_putchar)(void *, int, int, u_int, long);
+ /* optional MD mmap() method */
+ paddr_t (*dc_mmap)(void *, void *, off_t, int);
+
struct igs_hwcmap dc_cmap; /* software copy of colormap */
struct igs_hwcursor dc_cursor; /* software copy of cursor sprite */
Home |
Main Index |
Thread Index |
Old Index