add vga_extended_attach function on arc port, to make mmap() available.
XXX - is it better to remove "#ifdef arc"?
This commit is contained in:
parent
7c109ba712
commit
849b74a926
|
@ -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 @@ struct vga_config {
|
|||
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 @@ vga_common_attach(self, iot, memt, type)
|
|||
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_common_attach(self, iot, memt, type)
|
|||
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 @@ vga_mmap(v, offset, prot)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 @@ static inline void _vga_gdc_write(vh, reg, val)
|
|||
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));
|
||||
|
|
Loading…
Reference in New Issue