Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/mips More <machine/ include cleanup
details: https://anonhg.NetBSD.org/src/rev/6e9384c948bb
branches: trunk
changeset: 767187:6e9384c948bb
user: matt <matt%NetBSD.org@localhost>
date: Sun Jul 10 23:21:58 2011 +0000
description:
More <machine/ include cleanup
diffstat:
sys/arch/mips/mips/cpu_exec.c | 8 +-
sys/arch/mips/mips/db_disasm.c | 13 +-
sys/arch/mips/mips/lock_stubs.S | 691 -----------------------------------
sys/arch/mips/mips/lock_stubs_llsc.S | 4 +-
sys/arch/mips/mips/locore_mips3.S | 4 +-
sys/arch/mips/mips/mipsX_subr.S | 4 +-
sys/arch/mips/mips/sig_machdep.c | 8 +-
sys/arch/mips/mips/svr4_machdep.c | 23 +-
sys/arch/mips/mips/syscall.c | 12 +-
9 files changed, 37 insertions(+), 730 deletions(-)
diffs (truncated from 946 to 300 lines):
diff -r f817a02920d0 -r 6e9384c948bb sys/arch/mips/mips/cpu_exec.c
--- a/sys/arch/mips/mips/cpu_exec.c Sun Jul 10 23:13:22 2011 +0000
+++ b/sys/arch/mips/mips/cpu_exec.c Sun Jul 10 23:21:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_exec.c,v 1.63 2011/04/29 22:12:22 matt Exp $ */
+/* $NetBSD: cpu_exec.c,v 1.64 2011/07/10 23:21:58 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.63 2011/04/29 22:12:22 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.64 2011/07/10 23:21:58 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_ultrix.h"
@@ -58,9 +58,9 @@
#include <sys/exec_ecoff.h>
#endif
#include <sys/exec_elf.h> /* mandatory */
-#include <machine/reg.h>
+#include <mips/locore.h>
+#include <mips/reg.h>
#include <mips/regnum.h> /* symbolic register indices */
-#include <mips/locore.h>
#include <compat/common/compat_util.h>
diff -r f817a02920d0 -r 6e9384c948bb sys/arch/mips/mips/db_disasm.c
--- a/sys/arch/mips/mips/db_disasm.c Sun Jul 10 23:13:22 2011 +0000
+++ b/sys/arch/mips/mips/db_disasm.c Sun Jul 10 23:21:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_disasm.c,v 1.22 2011/04/29 22:06:12 matt Exp $ */
+/* $NetBSD: db_disasm.c,v 1.23 2011/07/10 23:21:58 matt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -35,16 +35,15 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.22 2011/04/29 22:06:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.23 2011/07/10 23:21:58 matt Exp $");
-#include <sys/types.h>
-#include <sys/systm.h>
#include <sys/param.h>
+#include <sys/cpu.h>
+#include <sys/systm.h>
-#include <machine/reg.h>
-#include <machine/cpu.h>
+#include <mips/reg.h>
#include <mips/mips_opcode.h>
-/*#include <machine/param.h>*/
+
#include <machine/db_machdep.h>
#include <ddb/db_interface.h>
diff -r f817a02920d0 -r 6e9384c948bb sys/arch/mips/mips/lock_stubs.S
--- a/sys/arch/mips/mips/lock_stubs.S Sun Jul 10 23:13:22 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,691 +0,0 @@
-/* $NetBSD: lock_stubs.S,v 1.14 2011/02/20 07:45:47 matt Exp $ */
-
-/*-
- * Copyright (c) 2007 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Andrew Doran.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "opt_cputype.h"
-#include "opt_lockdebug.h"
-#include "opt_multiprocessor.h"
-
-#include <sys/errno.h>
-
-#include <machine/asm.h>
-#include <machine/cpu.h>
-
-#include "assym.h"
-
-#if defined(DIAGNOSTIC) || defined(MULTIPROCESSOR)
-#define FULL
-#endif
-
-#if MIPS_HAS_LLSC != 0 && defined(MULTIPROCESSOR)
-#define SYNC sync
-#define BDSYNC sync
-#else
-#define SYNC /* nothing */
-#define BDSYNC nop
-#endif /* MIPS_HAS_LLSC != 0 && defined(MULTIPROCESSOR) */
-
-
-#if MIPS_HAS_LLSC != 0
-
-/*
- * Set ISA level for the assembler.
- * XXX Clean up with a macro? Same code fragment is in mipsX_subr.S too.
- * XXX Key off build abi instead of processor type?
- */
-#if defined(MIPS3)
- .set mips3
-#endif
-
-#if defined(MIPS32)
- .set mips32
-#endif
-
-#if defined(MIPS64)
- .set mips64
-#endif
-
- .set noreorder
- .set noat
-
-/*
- * unsigned long _atomic_cas_ulong(volatile unsigned long *val,
- * unsigned long old, unsigned long new);
- */
-LEAF(_atomic_cas_ulong)
-1:
- LONG_LL t0, (a0)
- bne t0, a1, 2f
- move t1, a2
- LONG_SC t1, (a0)
- beqz t1, 1b
- nop
-#ifdef MULTIPROCESSOR
- sync
-#endif
- j ra
- move v0, a1
-2:
- j ra
- move v0, t0
-END(_atomic_cas_ulong)
-
-STRONG_ALIAS(atomic_cas_ulong,_atomic_cas_ulong)
-STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_ulong)
-STRONG_ALIAS(atomic_cas_ptr,_atomic_cas_ulong)
-
-STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_ulong)
-STRONG_ALIAS(atomic_cas_ulong_ni,_atomic_cas_ulong)
-STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_ulong)
-STRONG_ALIAS(atomic_cas_ptr_ni,_atomic_cas_ulong)
-
-#if defined(_LP64)
-STRONG_ALIAS(_atomic_cas_64,_atomic_cas_ulong)
-STRONG_ALIAS(atomic_cas_64,_atomic_cas_ulong)
-
-STRONG_ALIAS(_atomic_cas_64_ni,_atomic_cas_ulong)
-STRONG_ALIAS(atomic_cas_64_ni,_atomic_cas_ulong)
-#endif
-
-/*
- * unsigned int _atomic_cas_uint(volatile unsigned int *val,
- * unsigned int old, unsigned int new);
- */
-LEAF(_atomic_cas_uint)
-1:
- INT_LL t0, (a0)
- bne t0, a1, 2f
- move t1, a2
- INT_SC t1, (a0)
- beqz t1, 1b
- nop
-#ifdef MULTIPROCESSOR
- sync
-#endif
- j ra
- move v0, a1
-2:
- j ra
- move v0, t0
-END(_atomic_cas_uint)
-
-STRONG_ALIAS(_atomic_cas_32,_atomic_cas_uint)
-STRONG_ALIAS(atomic_cas_32,_atomic_cas_uint)
-STRONG_ALIAS(atomic_cas_uint,_atomic_cas_uint)
-
-STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_uint)
-STRONG_ALIAS(atomic_cas_32_ni,_atomic_cas_uint)
-STRONG_ALIAS(_atomic_cas_uint_ni,_atomic_cas_uint)
-STRONG_ALIAS(atomic_cas_uint_ni,_atomic_cas_uint)
-
-/*
- * int ucas_32(volatile uint32_t *ptr, uint32_t old, uint32_t new, uint32_t *ret)
- */
-LEAF(ucas_32)
- .set at
- PTR_LA v0, _C_LABEL(ucaserr)
- .set noat
- PTR_L v1, L_PCB(MIPS_CURLWP)
- PTR_S v0, PCB_ONFAULT(v1)
- bltz a0, _C_LABEL(ucaserr)
- nop
- move v0, zero
-
-1: INT_LL t0, 0(a0)
- nop
- bne t0, a1, 2f
- move t1, a2
- INT_SC t1, 0(a0)
- beqz t1, 1b
- nop
-
-2: PTR_S zero, PCB_ONFAULT(v1)
- j ra
- INT_S t0, 0(a3)
-END(ucas_32)
-
-STRONG_ALIAS(ucas_int, ucas_32)
-STRONG_ALIAS(ucas_uint, ucas_32)
-#ifndef _LP64
-STRONG_ALIAS(ucas_long, ucas_32)
-STRONG_ALIAS(ucas_ulong, ucas_32)
-STRONG_ALIAS(ucas_ptr, ucas_32)
-#endif
-
-#ifndef __mips_o32
-/*
- * int ucas_64(volatile uint64_t *ptr, uint64_t old, uint64_t new, uint64_t *ret)
- */
-LEAF(ucas_64)
- .set at
- PTR_LA v0, _C_LABEL(ucaserr)
- .set noat
- PTR_L v1, L_PCB(MIPS_CURLWP)
- PTR_S v0, PCB_ONFAULT(v1)
- bltz a0, _C_LABEL(ucaserr)
- nop
- move v0, zero
-
-1: REG_LL t0, 0(a0)
- nop
- bne t0, a1, 2f
- move t1, a2
- REG_SC t1, 0(a0)
- beqz t1, 1b
- nop
-
-2: PTR_S zero, PCB_ONFAULT(v1)
- j ra
- REG_S t0, 0(a3)
-END(ucas_64)
-#ifdef _LP64
-STRONG_ALIAS(ucas_ptr, ucas_64)
-STRONG_ALIAS(ucas_long, ucas_64)
-STRONG_ALIAS(ucas_ulong, ucas_64)
-#endif
-
-#endif /* !__mips_o32 */
-
-#ifndef LOCKDEBUG
-
-/*
- * void mutex_enter(kmutex_t *mtx);
- */
-LEAF(mutex_enter)
- PTR_LL t0, MTX_OWNER(a0)
-1:
- bnez t0, 2f
- move t2, MIPS_CURLWP
- PTR_SC t2, MTX_OWNER(a0)
- beqz t2, 1b
- PTR_LL t0, MTX_OWNER(a0)
- j ra
- BDSYNC
-2:
- j _C_LABEL(mutex_vector_enter)
- nop
-END(mutex_enter)
-
Home |
Main Index |
Thread Index |
Old Index