diff options
| author | uch <uch@NetBSD.org> | 2002-03-11 16:39:39 +0000 |
|---|---|---|
| committer | uch <uch@NetBSD.org> | 2002-03-11 16:39:39 +0000 |
| commit | 552fdb7e1b31b00ea44cdcd623637d22199c0acd (patch) | |
| tree | f61d83b8ca129e58c0f842b7868361c85b86a832 | |
| parent | 7e8becd64d2f36e62a5c8a18ba1180878e62ccc6 (diff) | |
make this compile and work with MIPS3_5900.
| -rw-r--r-- | sys/arch/mips/include/locore.h | 11 | ||||
| -rw-r--r-- | sys/arch/mips/mips/db_interface.c | 6 | ||||
| -rw-r--r-- | sys/arch/mips/mips/locore_mips3.S | 3 | ||||
| -rw-r--r-- | sys/arch/mips/mips/mipsX_subr.S | 7 | ||||
| -rw-r--r-- | sys/arch/mips/mips/mips_machdep.c | 21 | ||||
| -rw-r--r-- | sys/arch/mips/mips/trap.c | 8 |
6 files changed, 39 insertions, 17 deletions
diff --git a/sys/arch/mips/include/locore.h b/sys/arch/mips/include/locore.h index b0684e8f69e..719c6c965f7 100644 --- a/sys/arch/mips/include/locore.h +++ b/sys/arch/mips/include/locore.h @@ -1,4 +1,4 @@ -/* $NetBSD: locore.h,v 1.59 2002/03/05 15:36:51 simonb Exp $ */ +/* $NetBSD: locore.h,v 1.60 2002/03/11 16:39:39 uch Exp $ */ /* * Copyright 1996 The Board of Trustees of The Leland Stanford @@ -219,7 +219,7 @@ extern long *mips_locoresw[]; #define MachTLBUpdate mips1_TLBUpdate #define wbflush() mips1_wbflush() #define proc_trampoline mips1_proc_trampoline -#elif !defined(MIPS1) && defined(MIPS3) && !defined(MIPS32) && !defined(MIPS64) +#elif !defined(MIPS1) && defined(MIPS3) && !defined(MIPS32) && !defined(MIPS64) && !defined(MIPS3_5900) #define MachSetPID mips3_SetPID #define MIPS_TBIAP() mips3_TBIAP(mips_num_tlb_entries) #define MIPS_TBIS mips3_TBIS @@ -241,6 +241,13 @@ extern long *mips_locoresw[]; #define MachTLBUpdate mips64_TLBUpdate #define proc_trampoline mips64_proc_trampoline #define wbflush() mips64_wbflush() +#elif !defined(MIPS1) && defined(MIPS3) && !defined(MIPS32) && !defined(MIPS64) && defined(MIPS3_5900) +#define MachSetPID mips5900_SetPID +#define MIPS_TBIAP() mips5900_TBIAP(mips_num_tlb_entries) +#define MIPS_TBIS mips5900_TBIS +#define MachTLBUpdate mips5900_TLBUpdate +#define proc_trampoline mips5900_proc_trampoline +#define wbflush() mips5900_wbflush() #else #define MachSetPID (*(mips_locore_jumpvec.setTLBpid)) #define MIPS_TBIAP() (*(mips_locore_jumpvec.TBIAP))(mips_num_tlb_entries) diff --git a/sys/arch/mips/mips/db_interface.c b/sys/arch/mips/mips/db_interface.c index 5312a6986c6..cc1859d7d2c 100644 --- a/sys/arch/mips/mips/db_interface.c +++ b/sys/arch/mips/mips/db_interface.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.41 2002/03/05 15:43:25 simonb Exp $ */ +/* $NetBSD: db_interface.c,v 1.42 2002/03/11 16:39:40 uch Exp $ */ /* * Mach Operating System @@ -350,7 +350,11 @@ db_tlbdump_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) for (i = 0; i < mips_num_tlb_entries; i++) { #if defined(MIPS3) +#if defined(MIPS3_5900) + mips5900_TLBRead(i, &tlb); +#else mips3_TLBRead(i, &tlb); +#endif #elif defined(MIPS32) mips32_TLBRead(i, &tlb); #elif defined(MIPS64) diff --git a/sys/arch/mips/mips/locore_mips3.S b/sys/arch/mips/mips/locore_mips3.S index 9576f873edb..676781c0586 100644 --- a/sys/arch/mips/mips/locore_mips3.S +++ b/sys/arch/mips/mips/locore_mips3.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore_mips3.S,v 1.76 2002/03/05 15:50:59 simonb Exp $ */ +/* $NetBSD: locore_mips3.S,v 1.77 2002/03/11 16:39:40 uch Exp $ */ /* * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author) @@ -150,6 +150,7 @@ *---------------------------------------------------------------------------- */ LEAF(mips3_wbflush) +XLEAF(mips5900_wbflush) XLEAF(mips32_wbflush) XLEAF(mips64_wbflush) nop diff --git a/sys/arch/mips/mips/mipsX_subr.S b/sys/arch/mips/mips/mipsX_subr.S index faaf5862db0..2d5c5154fbd 100644 --- a/sys/arch/mips/mips/mipsX_subr.S +++ b/sys/arch/mips/mips/mipsX_subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: mipsX_subr.S,v 1.1 2002/03/05 15:51:00 simonb Exp $ */ +/* $NetBSD: mipsX_subr.S,v 1.2 2002/03/11 16:39:40 uch Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -242,6 +242,11 @@ #define MIPSX(name) mips3_/**/name #endif +#if defined(MIPS3_5900) +#undef MIPSX +#define MIPSX(name) mips5900_/**/name +#endif + #if defined(MIPS32) #define MIPSX(name) mips32_/**/name #endif diff --git a/sys/arch/mips/mips/mips_machdep.c b/sys/arch/mips/mips/mips_machdep.c index d293258192f..cd59890b374 100644 --- a/sys/arch/mips/mips/mips_machdep.c +++ b/sys/arch/mips/mips/mips_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.123 2002/03/06 13:10:22 tsutsui Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.124 2002/03/11 16:39:40 uch Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -120,7 +120,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.123 2002/03/06 13:10:22 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.124 2002/03/11 16:39:40 uch Exp $"); #include "opt_cputype.h" #include "opt_compat_netbsd.h" @@ -170,11 +170,12 @@ extern long *mips1_locoresw[]; #if defined(MIPS3) #if defined(MIPS3_5900) static void r5900_vector_init(void); +extern long *mips5900_locoresw[]; #else static void mips3_vector_init(void); -#endif extern long *mips3_locoresw[]; #endif +#endif #if defined(MIPS32) static void mips32_vector_init(void); @@ -436,6 +437,7 @@ mips1_vector_init(void) #endif /* MIPS1 */ #if defined(MIPS3) +#ifndef MIPS3_5900 /* XXX */ /* * MIPS III locore function vector */ @@ -448,7 +450,6 @@ static const mips_locore_jumpvec_t mips3_locore_vec = mips3_wbflush, }; -#ifndef MIPS3_5900 /* XXX */ static void mips3_vector_init(void) { @@ -827,15 +828,19 @@ mips_vector_init(void) #if defined(MIPS3) case CPU_ARCH_MIPS3: case CPU_ARCH_MIPS4: +#ifdef MIPS3_5900 /* XXX */ mips3_cp0_wired_write(0); - mips3_TBIA(mips_num_tlb_entries); + mips5900_TBIA(mips_num_tlb_entries); mips3_cp0_wired_write(MIPS3_TLB_WIRED_UPAGES); -#ifdef MIPS3_5900 /* XXX */ r5900_vector_init(); -#else + memcpy(mips_locoresw, mips5900_locoresw, sizeof(mips_locoresw)); +#else /* MIPS3_5900 */ + mips3_cp0_wired_write(0); + mips3_TBIA(mips_num_tlb_entries); + mips3_cp0_wired_write(MIPS3_TLB_WIRED_UPAGES); mips3_vector_init(); -#endif /* MIPS3_5900 */ memcpy(mips_locoresw, mips3_locoresw, sizeof(mips_locoresw)); +#endif /* MIPS3_5900 */ break; #endif #ifdef MIPS32 diff --git a/sys/arch/mips/mips/trap.c b/sys/arch/mips/mips/trap.c index b4e0ed13555..e2e89e3207b 100644 --- a/sys/arch/mips/mips/trap.c +++ b/sys/arch/mips/mips/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.168 2002/03/05 15:55:41 simonb Exp $ */ +/* $NetBSD: trap.c,v 1.169 2002/03/11 16:39:40 uch Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -44,7 +44,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.168 2002/03/05 15:55:41 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.169 2002/03/11 16:39:40 uch Exp $"); #include "opt_cputype.h" /* which mips CPU levels do we support? */ #include "opt_ktrace.h" @@ -1036,13 +1036,13 @@ static struct { void *addr; char *name;} names[] = { #endif /* MIPS1 */ /* XXX simonb: need mips32 and mips64 checks here too */ -#ifdef MIPS3 /* r4000 family (mips-III cpu) */ +#if defined(MIPS3) && !defined(MIPS3_5900) /* r4000 family (mips-III cpu) */ Name(mips3_KernGenException), Name(mips3_UserGenException), Name(mips3_SystemCall), Name(mips3_KernIntr), Name(mips3_UserIntr), -#endif /* MIPS3 */ +#endif /* MIPS3 && !MIPS3_5900 */ Name(mips_idle), Name(cpu_switch), |
