diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-02-05 20:13:18 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-02-05 20:13:18 +0000 |
commit | 30fadad3e11f2bc1226d93092b8777507c866d63 (patch) | |
tree | b2bebfeb2684a87455bf1820ac9280ff789ee4b3 /sys/dev/sbus | |
parent | e30d71e11739a2e8a6e8bdea4a2394497e66a7f7 (diff) |
Allow mmap as a dumb framebuffer (from offset 0).
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r-- | sys/dev/sbus/cgthree.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c index d65a7179982..1ecb57cda76 100644 --- a/sys/dev/sbus/cgthree.c +++ b/sys/dev/sbus/cgthree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgthree.c,v 1.6 2002/02/05 18:34:39 jason Exp $ */ +/* $OpenBSD: cgthree.c,v 1.7 2002/02/05 20:13:17 jason Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -402,20 +402,10 @@ cgthree_mmap(v, offset, prot) if (offset & PGOFSET) return (-1); - if (offset < 0) - return (-1); - if ((u_int)offset >= NOOVERLAY) - offset -= NOOVERLAY; - else if ((u_int)offset >= START) - offset -= START; - else - offset = 0; - - if (offset >= sc->sc_linebytes * sc->sc_height) - return (-1); - return (bus_space_mmap(sc->sc_bustag, sc->sc_paddr, - CGTHREE_VID_OFFSET + offset, prot, BUS_SPACE_MAP_LINEAR)); + if (offset >= 0 && offset < (sc->sc_linebytes * sc->sc_height)) + return (bus_space_mmap(sc->sc_bustag, sc->sc_paddr, + CGTHREE_VID_OFFSET + offset, prot, BUS_SPACE_MAP_LINEAR)); return (-1); } |