Flush the I-cache before jumping into just-loaded code.

This commit is contained in:
gwr 1997-10-06 19:43:23 +00:00
parent 81bc13db4b
commit c01d3eb597
3 changed files with 20 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bootxx.c,v 1.1.1.1 1997/03/13 16:27:27 gwr Exp $ */
/* $NetBSD: bootxx.c,v 1.2 1997/10/06 19:43:23 gwr Exp $ */
/*
* Copyright (c) 1994 Paul Kranenburg
@ -47,6 +47,8 @@
#include <machine/mon.h>
#include "stand.h"
extern void ICIA();
/*
* Boot device is derived from ROM provided information.
*/
@ -90,6 +92,7 @@ main()
printf("bootxx: start 0x%x\n", (long)addr);
#endif
entry = (void (*)())addr;
ICIA();
(*entry)();
}
/* copyboot had a problem... */

View File

@ -1,4 +1,4 @@
| $NetBSD: SRT0.S,v 1.2 1997/03/13 17:52:48 gwr Exp $
| $NetBSD: SRT0.S,v 1.3 1997/10/06 19:43:24 gwr Exp $
| Copyright (c) 1995 Gordon W. Ross
| All rights reserved.
@ -30,6 +30,8 @@
| SRT0.S - Stand-alone Run-Time startup code, part 0
.file "SRT0.S"
.set IC_CLEAR,0x3119
.text
.globl __estack
__estack:
@ -51,6 +53,9 @@ Lcp:
movl a0@+, a1@+
dbra d0, Lcp
| Clear the I-cache in case the copied code was cached.
movl #IC_CLEAR, d0
movc d0, cacr
| Force a long jump to the relocated code (not pc-relative)
lea restart:l, a0
jmp a0@
@ -84,6 +89,13 @@ _getvbr:
movc vbr, d0
rts
| function to clear the I-cache
.globl _ICIA
_ICIA:
movl #IC_CLEAR, d0
movc d0, cacr
rts
| function to flush the ATC of cached entries.
.globl _mmu_atc_flush
_mmu_atc_flush:

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_sun.c,v 1.1.1.1 1997/03/13 16:27:28 gwr Exp $ */
/* $NetBSD: exec_sun.c,v 1.2 1997/10/06 19:43:25 gwr Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -41,6 +41,7 @@
#include "stand.h"
extern void ICIA();
extern int debug;
int errno;
@ -166,6 +167,7 @@ exec_sun(file, loadaddr)
printf("Starting program at 0x%x\n", (int)entry);
asm("_exec_sun_call_entry:");
ICIA();
(*entry)();
panic("exec returned");