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 vga_extended_attach function on arc port, to ...
details: https://anonhg.NetBSD.org/src/rev/c6c077c84587
branches: trunk
changeset: 488058:c6c077c84587
user: soda <soda%NetBSD.org@localhost>
date: Sat Jun 17 07:11:50 2000 +0000
description:
add vga_extended_attach function on arc port, to make mmap() available.
XXX - is it better to remove "#ifdef arc"?
diffstat:
sys/dev/ic/vga.c | 29 ++++++++++++++++++++++++++++-
sys/dev/ic/vgavar.h | 7 ++++++-
2 files changed, 34 insertions(+), 2 deletions(-)
diffs (86 lines):
diff -r 4d524af0de58 -r c6c077c84587 sys/dev/ic/vga.c
--- a/sys/dev/ic/vga.c Sat Jun 17 06:58:35 2000 +0000
+++ b/sys/dev/ic/vga.c Sat Jun 17 07:11:50 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vga.c,v 1.27 2000/06/08 07:01:19 cgd Exp $ */
+/* $NetBSD: vga.c,v 1.28 2000/06/17 07:11:50 soda Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -101,6 +101,10 @@
void (*switchcb) __P((void *, int, int));
void *switchcbarg;
+#ifdef arc
+ int (*vc_mmap) __P((void *, off_t, int));
+#endif
+
struct callout vc_switch_callout;
};
@@ -511,6 +515,18 @@
bus_space_tag_t iot, memt;
int type;
{
+#ifdef arc
+ vga_extended_attach(self, iot, memt, type, NULL);
+}
+
+void
+vga_extended_attach(self, iot, memt, type, map)
+ struct device *self;
+ bus_space_tag_t iot, memt;
+ int type;
+ int (*map) __P((void *, off_t, int));
+{
+#endif /* arc */
int console;
struct vga_config *vc;
struct wsemuldisplaydev_attach_args aa;
@@ -525,6 +541,10 @@
vga_init(vc, iot, memt);
}
+#ifdef arc
+ vc->vc_mmap = map;
+#endif
+
aa.console = console;
aa.scrdata = (vc->hdl.vh_mono ? &vga_screenlist_mono : &vga_screenlist);
aa.accessops = &vga_accessops;
@@ -623,7 +643,14 @@
int prot;
{
+#ifdef arc
+ struct vga_config *vc = v;
+
+ if (vc->vc_mmap != NULL)
+ return (*vc->vc_mmap)(v, offset, prot);
+#else
/* XXX */
+#endif
return -1;
}
diff -r 4d524af0de58 -r c6c077c84587 sys/dev/ic/vgavar.h
--- a/sys/dev/ic/vgavar.h Sat Jun 17 06:58:35 2000 +0000
+++ b/sys/dev/ic/vgavar.h Sat Jun 17 07:11:50 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vgavar.h,v 1.3 1999/01/13 16:48:58 drochner Exp $ */
+/* $NetBSD: vgavar.h,v 1.4 2000/06/17 07:11:50 soda Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -138,6 +138,11 @@
int vga_common_probe __P((bus_space_tag_t, bus_space_tag_t));
void vga_common_attach __P((struct device *, bus_space_tag_t,
bus_space_tag_t, int));
+#ifdef arc
+void vga_extended_attach __P((struct device *, bus_space_tag_t,
+ bus_space_tag_t, int,
+ int (*) __P((void *, off_t, int))));
+#endif
int vga_is_console __P((bus_space_tag_t, int));
int vga_cnattach __P((bus_space_tag_t, bus_space_tag_t, int, int));
Home |
Main Index |
Thread Index |
Old Index