Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 Use trunc_page or round_page where appropri...
details: https://anonhg.NetBSD.org/src/rev/ae505c828c16
branches: trunk
changeset: 748461:ae505c828c16
user: nakayama <nakayama%NetBSD.org@localhost>
date: Sat Oct 24 14:52:19 2009 +0000
description:
Use trunc_page or round_page where appropriate.
No functional changes intended, and generate same binaries.
diffstat:
sys/arch/sparc64/dev/iommu.c | 10 +++++-----
sys/arch/sparc64/dev/mkclock.c | 6 +++---
sys/arch/sparc64/sparc64/machdep.c | 8 ++++----
sys/arch/sparc64/sparc64/pmap.c | 6 +++---
4 files changed, 15 insertions(+), 15 deletions(-)
diffs (128 lines):
diff -r e90c52eacbd9 -r ae505c828c16 sys/arch/sparc64/dev/iommu.c
--- a/sys/arch/sparc64/dev/iommu.c Sat Oct 24 14:50:48 2009 +0000
+++ b/sys/arch/sparc64/dev/iommu.c Sat Oct 24 14:52:19 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iommu.c,v 1.86 2009/02/15 13:04:03 martin Exp $ */
+/* $NetBSD: iommu.c,v 1.87 2009/10/24 14:52:19 nakayama Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.86 2009/02/15 13:04:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.87 2009/10/24 14:52:19 nakayama Exp $");
#include "opt_ddb.h"
@@ -569,7 +569,7 @@
("iommu_dvmamap_load: map %p loading va %p "
"dva %lx at pa %lx\n",
map, (void *)vaddr, (long)dvmaddr,
- (long)(curaddr & ~(PAGE_SIZE-1))));
+ (long)trunc_page(curaddr)));
iommu_enter(sb, trunc_page(dvmaddr), trunc_page(curaddr),
flags|0x4000);
@@ -926,8 +926,8 @@
return (0);
}
- vaend = (va + len + PGOFSET) & ~PGOFSET;
- va &= ~PGOFSET;
+ vaend = round_page(va + len);
+ va = trunc_page(va);
#ifdef DIAGNOSTIC
if (va < is->is_dvmabase || vaend > is->is_dvmaend)
diff -r e90c52eacbd9 -r ae505c828c16 sys/arch/sparc64/dev/mkclock.c
--- a/sys/arch/sparc64/dev/mkclock.c Sat Oct 24 14:50:48 2009 +0000
+++ b/sys/arch/sparc64/dev/mkclock.c Sat Oct 24 14:52:19 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkclock.c,v 1.5 2008/03/29 05:47:53 tsutsui Exp $ */
+/* $NetBSD: mkclock.c,v 1.6 2009/10/24 14:52:19 nakayama Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mkclock.c,v 1.5 2008/03/29 05:47:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mkclock.c,v 1.6 2009/10/24 14:52:19 nakayama Exp $");
/*
* Clock driver for 'mkclock' - Mostek MK48Txx TOD clock.
@@ -165,7 +165,7 @@
if (sbus_bus_map(sc->sc_bst,
sa->sa_slot,
- (sa->sa_offset & ~(PAGE_SIZE - 1)),
+ trunc_page(sa->sa_offset),
sz,
BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_READONLY,
&sc->sc_bsh) != 0) {
diff -r e90c52eacbd9 -r ae505c828c16 sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c Sat Oct 24 14:50:48 2009 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c Sat Oct 24 14:52:19 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.245 2009/10/21 21:12:03 rmind Exp $ */
+/* $NetBSD: machdep.c,v 1.246 2009/10/24 14:52:20 nakayama Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.245 2009/10/21 21:12:03 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.246 2009/10/24 14:52:20 nakayama Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -1498,7 +1498,7 @@
{
#ifdef DIAGNOSTIC
- if ((u_long)kva & PAGE_MASK)
+ if ((u_long)kva & PGOFSET)
panic("_bus_dmamem_unmap");
#endif
@@ -1709,7 +1709,7 @@
else
hp->_asi = ASI_PRIMARY;
- pa = addr & ~PAGE_MASK; /* = trunc_page(addr); Will drop high bits */
+ pa = trunc_page(addr);
if (!(flags&BUS_SPACE_MAP_READONLY))
pm_prot |= VM_PROT_WRITE;
diff -r e90c52eacbd9 -r ae505c828c16 sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c Sat Oct 24 14:50:48 2009 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c Sat Oct 24 14:52:19 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.239 2009/10/21 21:12:03 rmind Exp $ */
+/* $NetBSD: pmap.c,v 1.240 2009/10/24 14:52:20 nakayama Exp $ */
/*
*
* Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.239 2009/10/21 21:12:03 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.240 2009/10/24 14:52:20 nakayama Exp $");
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */
#define HWREF
@@ -2032,7 +2032,7 @@
}
mutex_enter(&pmap_lock);
- sva = sva & ~PGOFSET;
+ sva = trunc_page(sva);
for (; sva < eva; sva += PAGE_SIZE) {
#ifdef DEBUG
/*
Home |
Main Index |
Thread Index |
Old Index