Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/arch/vax/vsa Pull up revision 1.45 (requested by ra...



details:   https://anonhg.NetBSD.org/src/rev/03e92b882105
branches:  netbsd-2-0
changeset: 560731:03e92b882105
user:      tron <tron%NetBSD.org@localhost>
date:      Wed May 05 15:31:38 2004 +0000

description:
Pull up revision 1.45 (requested by ragge in ticket #245):
Fix bug that were introduced together with the merge of nathanw_sa:
SCSI on VS2k/VS3100 stopped working.  Spotted and fixed by Anders Hjalmarsson.
This fixes PR#25307.

diffstat:

 sys/arch/vax/vsa/vsbus.c |  28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diffs (58 lines):

diff -r 32de52fb162c -r 03e92b882105 sys/arch/vax/vsa/vsbus.c
--- a/sys/arch/vax/vsa/vsbus.c  Wed May 05 15:30:07 2004 +0000
+++ b/sys/arch/vax/vsa/vsbus.c  Wed May 05 15:31:38 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vsbus.c,v 1.44 2003/07/15 02:15:07 lukem Exp $ */
+/*     $NetBSD: vsbus.c,v 1.44.2.1 2004/05/05 15:31:38 tron Exp $ */
 /*
  * Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.44 2003/07/15 02:15:07 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.44.2.1 2004/05/05 15:31:38 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -311,10 +311,16 @@
                bcopy(from, to, len);
                return;
        }
-       if ((long)to & 0x40000000)
-               pte = &p->p_vmspace->vm_map.pmap->pm_p1br[((long)to & ~0x40000000)];
+
+#ifdef DIAGNOSTIC
+       if (p == NULL)
+               panic("vsbus_copytoproc: no proc");
+#endif
+
+       if ((vaddr_t)to & 0x40000000)
+               pte = &p->p_vmspace->vm_map.pmap->pm_p1br[vax_btop((vaddr_t)to & ~0x40000000)];
        else
-               pte = &p->p_vmspace->vm_map.pmap->pm_p0br[(long)to];
+               pte = &p->p_vmspace->vm_map.pmap->pm_p0br[vax_btop((vaddr_t)to)];
        if ((vaddr_t)to & PGOFSET) {
                int cz = round_page((vaddr_t)to) - (vaddr_t)to;
 
@@ -345,10 +351,16 @@
                bcopy(from, to, len);
                return;
        }
-       if ((long)to & 0x40000000)
-               pte = &p->p_vmspace->vm_map.pmap->pm_p1br[((long)to & ~0x40000000)];
+
+#ifdef DIAGNOSTIC
+       if (p == NULL)
+               panic("vsbus_copyfromproc: no proc");
+#endif
+
+       if ((vaddr_t)from & 0x40000000)
+               pte = &p->p_vmspace->vm_map.pmap->pm_p1br[vax_btop((vaddr_t)from & ~0x40000000)];
        else
-               pte = &p->p_vmspace->vm_map.pmap->pm_p0br[(long)to];
+               pte = &p->p_vmspace->vm_map.pmap->pm_p0br[vax_btop((vaddr_t)from)];
        if ((vaddr_t)from & PGOFSET) {
                int cz = round_page((vaddr_t)from) - (vaddr_t)from;
 



Home | Main Index | Thread Index | Old Index