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 Allow defining a bus space with pbs...



details:   https://anonhg.NetBSD.org/src/rev/e6f23f44cbbc
branches:  trunk
changeset: 772090:e6f23f44cbbc
user:      phx <phx%NetBSD.org@localhost>
date:      Sat Dec 17 19:34:07 2011 +0000

description:
Allow defining a bus space with pbs_limit=0, which will have the effect to
create a space which ends with 0xffffffff.
This is needed, because pbs_limit=0xffffffff ends the space with 0xfffffffe.

diffstat:

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

diffs (36 lines):

diff -r 1229e11836f1 -r e6f23f44cbbc sys/arch/powerpc/powerpc/bus_space.c
--- a/sys/arch/powerpc/powerpc/bus_space.c      Sat Dec 17 19:14:10 2011 +0000
+++ b/sys/arch/powerpc/powerpc/bus_space.c      Sat Dec 17 19:34:07 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_space.c,v 1.28 2011/06/30 00:53:00 matt Exp $      */
+/*     $NetBSD: bus_space.c,v 1.29 2011/12/17 19:34:07 phx 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.28 2011/06/30 00:53:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.29 2011/12/17 19:34:07 phx Exp $");
 
 #define _POWERPC_BUS_SPACE_PRIVATE
 
@@ -526,7 +526,7 @@
        size = _BUS_SPACE_STRIDE(t, size);
        bpa = _BUS_SPACE_STRIDE(t, bpa);
 
-       if (bpa + size > t->pbs_limit) {
+       if (t->pbs_limit != 0 && bpa + size > 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);
@@ -702,7 +702,7 @@
        if (t->pbs_extent == NULL)
                return ENOMEM;
 
-       if (rstart + size > t->pbs_limit) {
+       if (t->pbs_limit != 0 && rstart + size > 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