Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/powerpc Fix some boundary conditions (fence...



details:   https://anonhg.NetBSD.org/src/rev/a20b4f86bc0b
branches:  trunk
changeset: 780263:a20b4f86bc0b
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jul 18 17:41:59 2012 +0000

description:
Fix some boundary conditions (fence post errors).

diffstat:

 sys/arch/powerpc/powerpc/bus_space.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r eaff0da55a4e -r a20b4f86bc0b sys/arch/powerpc/powerpc/bus_space.c
--- a/sys/arch/powerpc/powerpc/bus_space.c      Wed Jul 18 17:12:39 2012 +0000
+++ b/sys/arch/powerpc/powerpc/bus_space.c      Wed Jul 18 17:41:59 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_space.c,v 1.33 2012/07/05 03:02:53 kiyohara Exp $  */
+/*     $NetBSD: bus_space.c,v 1.34 2012/07/18 17:41:59 matt Exp $      */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.33 2012/07/05 03:02:53 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.34 2012/07/18 17:41:59 matt Exp $");
 
 #define _POWERPC_BUS_SPACE_PRIVATE
 
@@ -400,7 +400,7 @@
 {
        if (t->pbs_extent == NULL && extent_name != NULL) {
                t->pbs_extent = extent_create(extent_name, t->pbs_base,
-                   t->pbs_limit-1, storage, storage_size,
+                   t->pbs_limit, storage, storage_size,
                    EX_NOCOALESCE|EX_NOWAIT);
                if (t->pbs_extent == NULL)
                        return ENOMEM;
@@ -525,7 +525,7 @@
        size = _BUS_SPACE_STRIDE(t, size);
        bpa = _BUS_SPACE_STRIDE(t, bpa);
 
-       if (t->pbs_limit != 0 && bpa + size > t->pbs_limit) {
+       if (t->pbs_limit != 0 && bpa + size - 1 > t->pbs_limit) {
 #ifdef DEBUG
                printf("bus_space_map(%p[%x:%x], %#x, %#x) failed: EINVAL\n",
                    t, t->pbs_base, t->pbs_limit, bpa, size);
@@ -709,7 +709,7 @@
        if (t->pbs_extent == NULL)
                return ENOMEM;
 
-       if (t->pbs_limit != 0 && rstart + size > t->pbs_limit) {
+       if (t->pbs_limit != 0 && rstart + size - 1 > t->pbs_limit) {
 #ifdef DEBUG
                printf("%s(%p[%x:%x], %#x, %#x) failed: EINVAL\n",
                   __func__, t, t->pbs_base, t->pbs_limit, rstart, size);



Home | Main Index | Thread Index | Old Index