Replace __INTR_MASK and swap dance to load PSL_RB (and doing stc/ldc

twice in the process) with code that just uses mov.l to get the bits
to clear and set in SR.

Use proper local labels.  Add rcs id.  G/c unused includes.  Add .size
This commit is contained in:
uwe 2006-10-15 02:31:00 +00:00
parent 92dc06bfcf
commit 4fcce87c8c

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.2 2006/10/15 00:25:48 uwe Exp $ */
/* $NetBSD: locore.S,v 1.3 2006/10/15 02:31:00 uwe Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -33,46 +33,50 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "assym.h"
#include <sh3/asm.h>
#include <sh3/locore.h>
#include <sh3/exception.h>
__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.3 2006/10/15 02:31:00 uwe Exp $")
#include <sh3/psl.h>
#include <sh3/mmu_sh4.h>
/*
* void start(int howto, void *bootinfo);
* LINTSTUB: Func: void start(int howto, void *bootinfo)
* __attribute__((__noreturn__))
* Kernel entry point.
*/
*/
NENTRY(start)
ALTENTRY(kernel_text)
/* Set bootstrap stack pointer */
mov.l _L.bootstrap_stack, r15
/* Mask all interrupt */
__INTR_MASK(r0, r1)
/* MMU off */
mov.l _L.MMUCR, r0
xor r1, r1
mov.l r1, @r0
/* Make sure to change register bank 0 */
mov #0x20, r1
/* Init SR */
stc sr, r0
swap.b r1, r1
swap.w r1, r1
not r1, r1
mov.l .L_SR_clear, r1
mov.l .L_SR_set, r2
and r1, r0
ldc r0, sr /* SR.RB = 0 */
or r2, r0
ldc r0, sr
/* Disable MMU */
mov.l .L_MMUCR, r0
mov #0, r1
mov.l r1, @r0
/* Go! */
mov.l _L.landisk_startup, r0
mov.l .L_landisk_startup, r0
mov.l .L_bootstrap_stack, sp
jmp @r0
nop
/* NOTREACHED */
.align 2
_L.landisk_startup: .long _C_LABEL(landisk_startup)
_L.bootstrap_stack: .long _C_LABEL(start)
_L.MMUCR: .long SH4_MMUCR
/* Select register bank 0 */
.L_SR_clear: .long ~PSL_RB
/* Mask all interrupts */
.L_SR_set: .long PSL_IMASK
.L_MMUCR: .long SH4_MMUCR
.L_landisk_startup: .long _C_LABEL(landisk_startup)
.L_bootstrap_stack: .long _C_LABEL(start)
SET_ENTRY_SIZE(start)