Initialize UTLB/ITLB data array 1 to zero.

If the VPN / PPN are not aligned to page boundary (the page size
is set by SZ bits in data array 1, which are random when power-up time),
unexpected exception occurs in some rare case, it seems....
Initialize SZ to zero (1KB page).  Also, clear VPN / PPN to zero just in case.

Make __sh4_itlb_invalidate_all() static.
This commit is contained in:
itohy 2002-11-04 01:31:43 +00:00
parent 85529376d3
commit babe417446
1 changed files with 9 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mmu_sh4.c,v 1.5 2002/05/09 12:27:04 uch Exp $ */
/* $NetBSD: mmu_sh4.c,v 1.6 2002/11/04 01:31:43 itohy Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -45,9 +45,9 @@
#define SH4_MMU_HAZARD __asm__ __volatile__("nop;nop;nop;nop;nop;nop;nop;nop;")
extern __inline__ void __sh4_itlb_invalidate_all(void);
static __inline__ void __sh4_itlb_invalidate_all(void);
void
static __inline__ void
__sh4_itlb_invalidate_all()
{
@ -129,8 +129,14 @@ sh4_tlb_invalidate_all()
for (e = 0; e < eend; e++) {
a = SH4_UTLB_AA | (e << SH4_UTLB_E_SHIFT);
_reg_write_4(a, 0);
a = SH4_UTLB_DA1 | (e << SH4_UTLB_E_SHIFT);
_reg_write_4(a, 0);
}
__sh4_itlb_invalidate_all();
_reg_write_4(SH4_ITLB_DA1, 0);
_reg_write_4(SH4_ITLB_DA1 | (1 << SH4_ITLB_E_SHIFT), 0);
_reg_write_4(SH4_ITLB_DA1 | (2 << SH4_ITLB_E_SHIFT), 0);
_reg_write_4(SH4_ITLB_DA1 | (3 << SH4_ITLB_E_SHIFT), 0);
RUN_P1;
}