Move some low-level code (SVC mode switching and PID address translation

disabling) which was written using inlined asm in initarm() to just after
the kernel entry point.
This commit is contained in:
toshii 2001-06-01 14:04:29 +00:00
parent 4909bd1ed2
commit ea77ec5725
2 changed files with 14 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpc_machdep.c,v 1.11 2001/04/17 16:10:47 toshii Exp $ */
/* $NetBSD: hpc_machdep.c,v 1.12 2001/06/01 14:04:29 toshii Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -321,12 +321,6 @@ initarm(argc, argv, bi)
*/
set_cpufuncs();
/* Put the processer in SVC mode */
__asm("mov r0, sp; mov r1, lr; mrs r2, cpsr_all;");
/* PSR_MODE, PSR_SVC32_MODE" */
__asm("bic r2, r2, #31; orr r2, r2, #19;");
__asm("msr cpsr_all, r2; mov sp, r0; mov lr, r1;");
#ifdef DEBUG_BEFOREMMU
/*
* At this point, we cannot call real consinit().
@ -682,8 +676,6 @@ initarm(argc, argv, bi)
/* Set the page table address. */
setttb(kernel_l1pt.pv_pa);
/* Disable PID virtual address mapping */
asm("mcr 15, 0, %0, c13, c0, 0" : : "r" (0));
#ifdef BOOT_DUMP
dumppages((char *)0xc0000000, 16 * NBPG);
dumppages((char *)0xb0100000, 64); /* XXX */

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.2 2001/03/23 08:58:14 toshii Exp $ */
/* $NetBSD: locore.S,v 1.3 2001/06/01 14:04:29 toshii Exp $ */
/*
* Copyright (C) 1994-1997 Mark Brinicombe
@ -51,6 +51,18 @@
ENTRY_NP(kernel_text)
ASENTRY_NP(start)
/* Put the processer in SVC mode */
mov r5, sp
mrs r4, cpsr_all
bic r4, r4, #31
orr r4, r4, #(PSR_SVC32_MODE)
msr cpsr_all, r4
mov sp, r5
/* Disable PID virtual address mapping */
mov r4, #0
mcr 15, 0, r4, c13, c0, 0
mov fp, #0x00000000 /* trace back starts here */
bl _C_LABEL(initarm) /* Off we go */