diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-04-16 11:56:40 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-04-16 11:56:40 +0000 |
commit | ab08be91e5dc66cfc42b85763d4caf94e2fd3d09 (patch) | |
tree | 89caace66e8787764cc54b781a8cbfd881b69458 /sys/arch/hp300/dev/grf.c | |
parent | 75113d46e0ad67778c0741a5bfc96d9d686f7eec (diff) |
Merge portions of NetBSD up to 970415.
This includes:
* All of the prototyping and KNF changes.
* The new interrupt system.
* Portions of the Domain Keyboard support from Mike Smith.
This does not include:
* m68k changes, namely generic dumps.
Various sundry changes and fixes by me.
Diffstat (limited to 'sys/arch/hp300/dev/grf.c')
-rw-r--r-- | sys/arch/hp300/dev/grf.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/sys/arch/hp300/dev/grf.c b/sys/arch/hp300/dev/grf.c index 3c9d16d3b40..d4fb949475c 100644 --- a/sys/arch/hp300/dev/grf.c +++ b/sys/arch/hp300/dev/grf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: grf.c,v 1.5 1997/02/03 04:47:25 downsj Exp $ */ -/* $NetBSD: grf.c,v 1.23 1997/01/30 09:18:42 thorpej Exp $ */ +/* $OpenBSD: grf.c,v 1.6 1997/04/16 11:56:02 downsj Exp $ */ +/* $NetBSD: grf.c,v 1.25 1997/04/02 22:37:30 scottr Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,14 +50,15 @@ */ #include <sys/param.h> -#include <sys/proc.h> -#include <sys/ioctl.h> +#include <sys/systm.h> +#include <sys/conf.h> +#include <sys/device.h> #include <sys/file.h> +#include <sys/ioctl.h> #include <sys/malloc.h> -#include <sys/vnode.h> #include <sys/mman.h> -#include <sys/conf.h> -#include <sys/device.h> +#include <sys/proc.h> +#include <sys/vnode.h> #include <machine/autoconf.h> #include <machine/cpu.h> @@ -355,7 +356,7 @@ grfoff(dev) int grfaddr(sc, off) struct grf_softc *sc; - register int off; + int off; { struct grf_data *gp= sc->sc_data; struct grfinfo *gi = &gp->g_display; @@ -519,8 +520,8 @@ grflock(gp, block) return(OEAGAIN); do { gp->g_flags |= GF_WANTED; - if (error = tsleep((caddr_t)&gp->g_flags, - (PZERO+1) | PCATCH, devioc, 0)) + if ((error = tsleep((caddr_t)&gp->g_flags, + (PZERO+1) | PCATCH, devioc, 0))) return (error); } while (gp->g_lockp); } @@ -625,7 +626,7 @@ grfmap(dev, addrp, p) #ifdef DEBUG if (grfdebug & GDB_MMAP) - printf("grfmap(%d): addr %x\n", p->p_pid, *addrp); + printf("grfmap(%d): addr %p\n", p->p_pid, *addrp); #endif len = gp->g_display.gd_regsize + gp->g_display.gd_fbsize; flags = MAP_SHARED; @@ -644,6 +645,7 @@ grfmap(dev, addrp, p) return(error); } +int grfunmap(dev, addr, p) dev_t dev; caddr_t addr; @@ -656,7 +658,7 @@ grfunmap(dev, addr, p) #ifdef DEBUG if (grfdebug & GDB_MMAP) - printf("grfunmap(%d): dev %x addr %x\n", p->p_pid, dev, addr); + printf("grfunmap(%d): dev %x addr %p\n", p->p_pid, dev, addr); #endif if (addr == 0) return(EINVAL); /* XXX: how do we deal with this? */ @@ -675,7 +677,7 @@ iommap(dev, addrp) #ifdef DEBUG if (grfdebug & (GDB_MMAP|GDB_IOMAP)) - printf("iommap(%d): addr %x\n", curproc->p_pid, *addrp); + printf("iommap(%d): addr %p\n", curproc->p_pid, *addrp); #endif return(EINVAL); } @@ -685,11 +687,11 @@ iounmmap(dev, addr) dev_t dev; caddr_t addr; { +#ifdef DEBUG int unit = minor(dev); -#ifdef DEBUG if (grfdebug & (GDB_MMAP|GDB_IOMAP)) - printf("iounmmap(%d): id %d addr %x\n", + printf("iounmmap(%d): id %d addr %p\n", curproc->p_pid, unit, addr); #endif return(0); @@ -702,11 +704,12 @@ iounmmap(dev, addr) * process ids. Returns a slot number between 1 and GRFMAXLCK or 0 if no * slot is available. */ +int grffindpid(gp) struct grf_data *gp; { - register short pid, *sp; - register int i, limit; + short pid, *sp; + int i, limit; int ni; if (gp->g_pid == NULL) { @@ -740,11 +743,12 @@ done: return(i); } +void grfrmpid(gp) struct grf_data *gp; { - register short pid, *sp; - register int limit, i; + short pid, *sp; + int limit, i; int mi; if (gp->g_pid == NULL || (limit = gp->g_pid[0]) == 0) @@ -768,6 +772,7 @@ grfrmpid(gp) #endif } +int grflckmmap(dev, addrp) dev_t dev; caddr_t *addrp; @@ -776,12 +781,13 @@ grflckmmap(dev, addrp) struct proc *p = curproc; /* XXX */ if (grfdebug & (GDB_MMAP|GDB_LOCK)) - printf("grflckmmap(%d): addr %x\n", + printf("grflckmmap(%d): addr %p\n", p->p_pid, *addrp); #endif return(EINVAL); } +int grflckunmmap(dev, addr) dev_t dev; caddr_t addr; @@ -790,7 +796,7 @@ grflckunmmap(dev, addr) int unit = minor(dev); if (grfdebug & (GDB_MMAP|GDB_LOCK)) - printf("grflckunmmap(%d): id %d addr %x\n", + printf("grflckunmmap(%d): id %d addr %p\n", curproc->p_pid, unit, addr); #endif return(EINVAL); |