Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sh3/sh3 make these compile with gcc -O0
details: https://anonhg.NetBSD.org/src/rev/02cd0354d977
branches: trunk
changeset: 525969:02cd0354d977
user: uch <uch%NetBSD.org@localhost>
date: Mon Apr 22 18:57:43 2002 +0000
description:
make these compile with gcc -O0
diffstat:
sys/arch/sh3/sh3/cache.c | 8 ++++++--
sys/arch/sh3/sh3/db_interface.c | 26 ++++++++++++++++++++------
sys/arch/sh3/sh3/exception_vector.S | 5 +++--
sys/arch/sh3/sh3/locore_subr.S | 5 +++--
sys/arch/sh3/sh3/mmu.c | 8 +++++---
sys/arch/sh3/sh3/sh3_machdep.c | 23 ++++++++++++++++++-----
6 files changed, 55 insertions(+), 20 deletions(-)
diffs (242 lines):
diff -r 10d23ad5da86 -r 02cd0354d977 sys/arch/sh3/sh3/cache.c
--- a/sys/arch/sh3/sh3/cache.c Mon Apr 22 18:31:11 2002 +0000
+++ b/sys/arch/sh3/sh3/cache.c Mon Apr 22 18:57:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cache.c,v 1.3 2002/03/10 07:46:51 uch Exp $ */
+/* $NetBSD: cache.c,v 1.4 2002/04/22 18:57:43 uch Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -81,10 +81,14 @@
#ifdef CACHE_DEBUG
return;
#endif
+#ifdef SH3
if (CPU_IS_SH3)
sh3_cache_config();
- else
+#endif
+#ifdef SH4
+ if (CPU_IS_SH4)
sh4_cache_config();
+#endif
}
void
diff -r 10d23ad5da86 -r 02cd0354d977 sys/arch/sh3/sh3/db_interface.c
--- a/sys/arch/sh3/sh3/db_interface.c Mon Apr 22 18:31:11 2002 +0000
+++ b/sys/arch/sh3/sh3/db_interface.c Mon Apr 22 18:57:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.14 2002/03/24 18:04:40 uch Exp $ */
+/* $NetBSD: db_interface.c,v 1.15 2002/04/22 18:57:43 uch Exp $ */
/*-
* Copyright (C) 2002 UCHIYAMA Yasushi. All rights reserved.
@@ -65,11 +65,17 @@
void kdb_printtrap(u_int, int);
void db_tlbdump_cmd(db_expr_t, int, db_expr_t, char *);
+
void __db_tlbdump_page_size_sh4(u_int32_t);
+
void __db_tlbdump_pfn(u_int32_t);
void db_cachedump_cmd(db_expr_t, int, db_expr_t, char *);
+
void __db_cachedump_sh3(vaddr_t);
+
+
void __db_cachedump_sh4(vaddr_t);
+
void db_stackcheck_cmd(db_expr_t, int, db_expr_t, char *);
void db_frame_cmd(db_expr_t, int, db_expr_t, char *);
void __db_print_symbol(db_expr_t);
@@ -219,9 +225,9 @@
static const char title[] =
" VPN ASID PFN AREA VDCGWtPR SZ";
static const char title2[] = "\t\t\t (user/kernel)";
- u_int32_t r, e, a;
+ u_int32_t r, e;
int i;
-
+#ifdef SH3
if (CPU_IS_SH3) {
/* MMU configuration. */
r = _reg_read_4(SH3_MMUCR);
@@ -233,6 +239,7 @@
for (i = 0; i < SH3_MMU_WAY; i++) {
db_printf(" [way %d]\n", i);
for (e = 0; e < SH3_MMU_ENTRY; e++) {
+ u_int32_t a;
/* address/data array common offset. */
a = (e << SH3_MMU_VPN_SHIFT) |
(i << SH3_MMU_WAY_SHIFT);
@@ -254,7 +261,10 @@
r & SH3_MMUDA_D_SZ ? 4 : 1);
}
}
- } else {
+ }
+#endif /* SH3 */
+#ifdef SH4
+ if (CPU_IS_SH4) {
/* MMU configuration */
r = _reg_read_4(SH4_MMUCR);
db_printf("%s virtual storage mode, SQ access: (kernel%s)\n",
@@ -311,6 +321,7 @@
r & SH4_UTLB_DA2_SA_MASK);
}
}
+#endif /* SH4 */
}
void
@@ -348,11 +359,14 @@
void
db_cachedump_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
{
-
+#ifdef SH3
if (CPU_IS_SH3)
__db_cachedump_sh3(have_addr ? addr : 0);
- else
+#endif
+#ifdef SH4
+ if (CPU_IS_SH4)
__db_cachedump_sh4(have_addr ? addr : 0);
+#endif
}
#ifdef SH3
diff -r 10d23ad5da86 -r 02cd0354d977 sys/arch/sh3/sh3/exception_vector.S
--- a/sys/arch/sh3/sh3/exception_vector.S Mon Apr 22 18:31:11 2002 +0000
+++ b/sys/arch/sh3/sh3/exception_vector.S Mon Apr 22 18:57:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exception_vector.S,v 1.6 2002/03/28 15:34:20 uch Exp $ */
+/* $NetBSD: exception_vector.S,v 1.7 2002/04/22 18:57:43 uch Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,8 @@
*/
#include "assym.h"
-
+#include "opt_cputype.h"
+
#include <sh3/param.h>
#include <sh3/asm.h>
#include <sh3/locore.h>
diff -r 10d23ad5da86 -r 02cd0354d977 sys/arch/sh3/sh3/locore_subr.S
--- a/sys/arch/sh3/sh3/locore_subr.S Mon Apr 22 18:31:11 2002 +0000
+++ b/sys/arch/sh3/sh3/locore_subr.S Mon Apr 22 18:57:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore_subr.S,v 1.7 2002/03/24 18:04:41 uch Exp $ */
+/* $NetBSD: locore_subr.S,v 1.8 2002/04/22 18:57:43 uch Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -35,7 +35,8 @@
#include "opt_ddb.h"
#include "opt_kgdb.h"
-
+#include "opt_cputype.h"
+
#include "assym.h"
#include <sys/syscall.h> /* SYS___sigreturn14, SYS_exit */
diff -r 10d23ad5da86 -r 02cd0354d977 sys/arch/sh3/sh3/mmu.c
--- a/sys/arch/sh3/sh3/mmu.c Mon Apr 22 18:31:11 2002 +0000
+++ b/sys/arch/sh3/sh3/mmu.c Mon Apr 22 18:57:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mmu.c,v 1.5 2002/03/17 14:03:34 uch Exp $ */
+/* $NetBSD: mmu.c,v 1.6 2002/04/22 18:57:43 uch Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -72,6 +72,7 @@
* Assing function hook. but if only defined SH3 or SH4, it is called
* directly. see sh3/mmu.h
*/
+#ifdef SH3
if (CPU_IS_SH3) {
__sh_mmu_start = sh3_mmu_start;
__sh_tlb_invalidate_addr = sh3_tlb_invalidate_addr;
@@ -83,7 +84,8 @@
__sh_mmu_ttb_write = sh3_mmu_ttb_write;
__sh_mmu_pd_area = __sh3_mmu_pd_area;
}
-
+#endif /* SH3 */
+#ifdef SH4
if (CPU_IS_SH4) {
__sh_mmu_start = sh4_mmu_start;
__sh_tlb_invalidate_addr = sh4_tlb_invalidate_addr;
@@ -95,7 +97,7 @@
__sh_mmu_ttb_write = sh4_mmu_ttb_write;
__sh_mmu_pd_area = __sh4_mmu_pd_area;
}
-
+#endif /* SH4 */
}
void
diff -r 10d23ad5da86 -r 02cd0354d977 sys/arch/sh3/sh3/sh3_machdep.c
--- a/sys/arch/sh3/sh3/sh3_machdep.c Mon Apr 22 18:31:11 2002 +0000
+++ b/sys/arch/sh3/sh3/sh3_machdep.c Mon Apr 22 18:57:43 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sh3_machdep.c,v 1.36 2002/03/24 18:04:41 uch Exp $ */
+/* $NetBSD: sh3_machdep.c,v 1.37 2002/04/22 18:57:43 uch Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@@ -133,9 +133,12 @@
/* exception handler holder (sh3/sh3/exception_vector.S) */
extern char sh_vector_generic[], sh_vector_generic_end[];
extern char sh_vector_interrupt[], sh_vector_interrupt_end[];
+#ifdef SH3
extern char sh3_vector_tlbmiss[], sh3_vector_tlbmiss_end[];
+#endif
+#ifdef SH4
extern char sh4_vector_tlbmiss[], sh4_vector_tlbmiss_end[];
-
+#endif
/*
* These variables are needed by /sbin/savecore
*/
@@ -169,13 +172,16 @@
/* Exception vector. */
memcpy(VBR + 0x100, sh_vector_generic,
sh_vector_generic_end - sh_vector_generic);
+#ifdef SH3
if (CPU_IS_SH3)
memcpy(VBR + 0x400, sh3_vector_tlbmiss,
sh3_vector_tlbmiss_end - sh3_vector_tlbmiss);
+#endif
+#ifdef SH4
if (CPU_IS_SH4)
memcpy(VBR + 0x400, sh4_vector_tlbmiss,
sh4_vector_tlbmiss_end - sh4_vector_tlbmiss);
-
+#endif
memcpy(VBR + 0x600, sh_vector_interrupt,
sh_vector_interrupt_end - sh_vector_interrupt);
@@ -300,8 +306,15 @@
printf("general exception handler:\t%d byte\n",
sh_vector_generic_end - sh_vector_generic);
printf("TLB miss exception handler:\t%d byte\n",
- CPU_IS_SH3 ? sh3_vector_tlbmiss_end - sh3_vector_tlbmiss :
- sh4_vector_tlbmiss_end - sh4_vector_tlbmiss);
+#if defined(SH3) && defined(SH4)
+ CPU_IS_SH3 ? sh3_vector_tlbmiss_end - sh3_vector_tlbmiss :
+ sh4_vector_tlbmiss_end - sh4_vector_tlbmiss
+#elif defined(SH3)
+ sh3_vector_tlbmiss_end - sh3_vector_tlbmiss
+#elif defined(SH4)
+ sh4_vector_tlbmiss_end - sh4_vector_tlbmiss
+#endif
+ );
printf("interrupt exception handler:\t%d byte\n",
sh_vector_interrupt_end - sh_vector_interrupt);
#endif /* DEBUG */
Home |
Main Index |
Thread Index |
Old Index