summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-11-26 21:03:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-11-26 21:03:37 +0000
commit52b6bdd89f9a2e3b62a1e18bb560e688a7351e23 (patch)
tree58bd87f3bf7a5d5b11598b81c16cada1f32c64f1 /sys/arch
parent8eebe8b819526be622a48a4e35b320836be03f8a (diff)
In gfxp_copyrect(), make sure that the - possibly negative - coordinate fields, which are supposed to be 16 bit values, are properly masked to avoid polluting
other fields. From NetBSD; ok kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/dev/gfxp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/gfxp.c b/sys/arch/sparc64/dev/gfxp.c
index b3b36741d02..efb59603e63 100644
--- a/sys/arch/sparc64/dev/gfxp.c
+++ b/sys/arch/sparc64/dev/gfxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gfxp.c,v 1.11 2009/09/05 14:09:35 miod Exp $ */
+/* $OpenBSD: gfxp.c,v 1.12 2010/11/26 21:03:36 miod Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
@@ -645,7 +645,7 @@ gfxp_copyrect(struct gfxp_softc *sc, int sx, int sy, int dx, int dy,
bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_CONFIG,
PM2_CONFIG_FB_WRITE_EN | PM2_CONFIG_FB_READ_SRC_EN);
bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_FB_SRC_DELTA,
- PM2_COORDS(sx - dx, sy - dy));
+ PM2_COORDS((sx - dx) & 0xffff, (sy - dy) & 0xffff));
bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_RECT_ORIG,
PM2_COORDS(dx, dy));
bus_space_write_4(sc->sc_mmiot, sc->sc_mmioh, PM2_RECT_SIZE,