From 4fcce87c8cee15e8dd6eb298a528e0e30967522f Mon Sep 17 00:00:00 2001 From: uwe Date: Sun, 15 Oct 2006 02:31:00 +0000 Subject: [PATCH] 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 --- sys/arch/landisk/landisk/locore.S | 60 ++++++++++++++++--------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/sys/arch/landisk/landisk/locore.S b/sys/arch/landisk/landisk/locore.S index 0597eeffcdf7..027d8114112a 100644 --- a/sys/arch/landisk/landisk/locore.S +++ b/sys/arch/landisk/landisk/locore.S @@ -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 -#include -#include +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.3 2006/10/15 02:31:00 uwe Exp $") + +#include #include + /* - * 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)