diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-08-22 22:26:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-08-22 22:26:02 +0000 |
commit | 2da1ea8cfd5e9d38ec8937b7024d93efea1dff47 (patch) | |
tree | 1d880e26636ce3be47c3c120b592314f8ea30bf8 /sys/arch/alpha/dev | |
parent | e4a3d7c138089f32129f3331233474ad41e9f7cd (diff) |
wscons -> vga_xxx -> vga mmap() support. first cut
Diffstat (limited to 'sys/arch/alpha/dev')
-rw-r--r-- | sys/arch/alpha/dev/vga.c | 23 | ||||
-rw-r--r-- | sys/arch/alpha/dev/vgavar.h | 7 |
2 files changed, 24 insertions, 6 deletions
diff --git a/sys/arch/alpha/dev/vga.c b/sys/arch/alpha/dev/vga.c index 85f5c349ad0..6c3c5171674 100644 --- a/sys/arch/alpha/dev/vga.c +++ b/sys/arch/alpha/dev/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.6 1997/07/31 13:40:01 kstailey Exp $ */ +/* $OpenBSD: vga.c,v 1.7 1997/08/22 22:25:59 deraadt Exp $ */ /* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */ /* @@ -63,8 +63,6 @@ struct wscons_emulfuncs vga_emulfuncs = { }; int vgaprint __P((void *, const char *)); -int vgaioctl __P((void *, u_long, caddr_t, int, struct proc *)); -int vgammap __P((void *, off_t, int)); /* * The following functions implement back-end configuration grabbing @@ -172,8 +170,8 @@ vga_wscons_attach(parent, vc, console) wo->wo_emulfuncs = &vga_emulfuncs; wo->wo_emulfuncs_cookie = vc; - wo->wo_ioctl = vgaioctl; - wo->wo_mmap = vgammap; + wo->wo_ioctl = vc->vc_ioctl; + wo->wo_mmap = vc->vc_mmap; wo->wo_miscfuncs_cookie = vc; wo->wo_nrows = vc->vc_nrow; @@ -222,6 +220,8 @@ vgaioctl(v, cmd, data, flag, p) int flag; struct proc *p; { + /*struct vga_config *vc = v;*/ + /* XXX */ return -1; } @@ -232,7 +232,18 @@ vgammap(v, offset, prot) off_t offset; int prot; { - /* XXX */ + struct vga_config *vc = v; + + if (offset >= 0xb8000 && offset < 0xc0000) { + printf("%p\n", alpha_btop(ALPHA_K0SEG_TO_PHYS(vc->vc_memh) + offset - 0xb8000)); + return alpha_btop(ALPHA_K0SEG_TO_PHYS(vc->vc_memh) + offset - 0xb8000); + } + if (offset >= 0x0000 && offset < 0x2000) + return alpha_btop(ALPHA_K0SEG_TO_PHYS(vc->vc_ioh_b)); + if (offset >= 0x2000 && offset < 0x4000) + return alpha_btop(ALPHA_K0SEG_TO_PHYS(vc->vc_ioh_c)); + if (offset >= 0x4000 && offset < 0x6000) + return alpha_btop(ALPHA_K0SEG_TO_PHYS(vc->vc_ioh_d)); return -1; } diff --git a/sys/arch/alpha/dev/vgavar.h b/sys/arch/alpha/dev/vgavar.h index 3c5353a83b0..93ac39220f9 100644 --- a/sys/arch/alpha/dev/vgavar.h +++ b/sys/arch/alpha/dev/vgavar.h @@ -43,6 +43,11 @@ struct vga_config { char vc_so; /* in standout mode? */ char vc_at; /* normal attributes */ char vc_so_at; /* standout attributes */ + + int (*vc_ioctl) __P((void *, u_long, + caddr_t, int, struct proc *)); + int (*vc_mmap) __P((void *, off_t, int)); + }; int vga_common_probe __P((bus_space_tag_t, bus_space_tag_t)); @@ -50,3 +55,5 @@ void vga_common_setup __P((bus_space_tag_t, bus_space_tag_t, struct vga_config *)); void vga_wscons_attach __P((struct device *, struct vga_config *, int)); void vga_wscons_console __P((struct vga_config *)); +int vgaioctl __P((void *, u_long, caddr_t, int, struct proc *)); +int vgammap __P((void *, off_t, int)); |