Module Name: src
Committed By: matt
Date: Fri Apr 29 22:04:42 UTC 2011
Modified Files:
src/sys/arch/mips/mips: lock_stubs_ras.S mips_machdep.c
Log Message:
Since the RAS lock stubs are the default, don't bother assigning them just
make the default.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/mips/lock_stubs_ras.S
cvs rdiff -u -r1.239 -r1.240 src/sys/arch/mips/mips/mips_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/mips/lock_stubs_ras.S
diff -u src/sys/arch/mips/mips/lock_stubs_ras.S:1.2 src/sys/arch/mips/mips/lock_stubs_ras.S:1.3
--- src/sys/arch/mips/mips/lock_stubs_ras.S:1.2 Tue Mar 8 15:01:02 2011
+++ src/sys/arch/mips/mips/lock_stubs_ras.S Fri Apr 29 22:04:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: lock_stubs_ras.S,v 1.2 2011/03/08 15:01:02 tsutsui Exp $ */
+/* $NetBSD: lock_stubs_ras.S,v 1.3 2011/04/29 22:04:42 matt Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -446,8 +446,8 @@
END(ras_mutex_spin_exit)
#endif /* !LOCKDEBUG */
- .rdata
-EXPORT(mips_ras_locore_atomicvec)
+ .data
+EXPORT(mips_locore_atomicvec)
PTR_WORD ras_atomic_cas_uint
PTR_WORD ras_atomic_cas_ulong
PTR_WORD ras_ucas_uint
Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.239 src/sys/arch/mips/mips/mips_machdep.c:1.240
--- src/sys/arch/mips/mips/mips_machdep.c:1.239 Thu Apr 14 05:10:04 2011
+++ src/sys/arch/mips/mips/mips_machdep.c Fri Apr 29 22:04:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mips_machdep.c,v 1.239 2011/04/14 05:10:04 cliff Exp $ */
+/* $NetBSD: mips_machdep.c,v 1.240 2011/04/29 22:04:42 matt Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.239 2011/04/14 05:10:04 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.240 2011/04/29 22:04:42 matt Exp $");
#define __INTR_PRIVATE
#include "opt_cputype.h"
@@ -250,7 +250,6 @@
mips_locore_jumpvec_t mips_locore_jumpvec;
struct locoresw mips_locoresw;
-mips_locore_atomicvec_t mips_locore_atomicvec;
extern const struct splsw std_splsw;
struct splsw mips_splsw;
@@ -1141,9 +1140,8 @@
mips_config_cache();
/*
- * Default to RAS atomic ops since they are the lowest overhead.
+ * We default to RAS atomic ops since they are the lowest overhead.
*/
- mips_locore_atomicvec = mips_ras_locore_atomicvec;
#ifdef MULTIPROCESSOR
if (multicpu_p) {
/*
@@ -1844,14 +1842,13 @@
{
vsize_t sz = (vsize_t)round_page(MSGBUFSIZE);
vsize_t reqsz = sz;
- struct vm_physseg *vps;
-
- vps = VM_PHYSMEM_PTR(vm_nphysseg - 1);
+ u_int bank = vm_nphysseg - 1;
+ struct vm_physseg *vps = VM_PHYSMEM_PTR(bank);
#ifndef _LP64
/*
* Fist the physical segment that can be mapped to KSEG0
*/
- for (; vps >= vm_physmem; vps--) {
+ for (; vps >= vm_physmem; vps--, bank--) {
if (vps->avail_start + atop(sz) <= atop(MIPS_PHYS_MASK))
break;
}
@@ -1872,9 +1869,9 @@
/* Remove the [last] segment if it now has no pages. */
if (vps->start == vps->end) {
- for (; vps != &vm_physmem[vm_nphysseg - 1]; vps++)
- vps[0] = vps[1];
- vm_nphysseg--;
+ for (vm_nphysseg--; bank < vm_nphysseg - 1; bank++) {
+ VM_PHYSMEM_PTR_SWAP(bank, bank + 1);
+ }
}
/* warn if the message buffer had to be shrunk */