L_MD_PCB and L_MD_UPTE are small enough to be used as immediate values.

This commit is contained in:
uwe 2007-03-16 01:30:56 +00:00
parent f1787e0a5d
commit c67ce65c70
1 changed files with 12 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_subr.S,v 1.32 2007/03/12 00:32:56 uwe Exp $ */
/* $NetBSD: locore_subr.S,v 1.33 2007/03/16 01:30:56 uwe Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
#include <sh3/mmu_sh3.h>
#include <sh3/mmu_sh4.h>
__KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.32 2007/03/12 00:32:56 uwe Exp $")
__KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.33 2007/03/16 01:30:56 uwe Exp $")
/*
@ -89,8 +89,7 @@ __KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.32 2007/03/12 00:32:56 uwe Exp $")
*/
ENTRY(cpu_switch)
/* Save current lwp's context to switchframe */
mov.l .L_PCB, r0
mov.l @(r0, r4), r1 /* l->l_md.md_pcb */
mov.l @(L_MD_PCB, r4), r1 /* l->l_md.md_pcb */
SAVEPCB(r1)
.L_find_and_switch:
@ -106,8 +105,7 @@ ENTRY(cpu_switch)
.L_doswitch:
/* Restore new lwp's context from switchframe */
mov.l .L_PCB, r0
mov.l @(r0, r4), r1 /* l->l_md.md_pcb */
mov.l @(L_MD_PCB, r4), r1 /* l->l_md.md_pcb */
/* no additional offset to l->l_md.md_pcb->pcb_sf */
/* Setup kernel stack first */
@ -138,8 +136,7 @@ ENTRY(cpu_switch)
/* Finish restoring new lwp's context from switchframe */
/* NOTE: r2 has return value! */
2: mov.l .L_PCB, r0
mov.l @(r0, r4), r1 /* l->l_md.md_pcb */
2: mov.l @(L_MD_PCB, r4), r1 /* l->l_md.md_pcb */
/* no additional offset to l->l_md.md_pcb->pcb_sf */
add #4, r1 /* r15 already restored */
mov.l @r1+, r14
@ -157,8 +154,8 @@ ENTRY(cpu_switch)
/* r2 has the return value; stuff it into r0 now. */
rts
mov r2, r0
.align 2
.L_PCB: .long (L_MD_PCB)
.L_cpu_switch_search: .long _C_LABEL(cpu_switch_search)
FUNC_SYMBOL(switch_resume)
@ -170,8 +167,7 @@ FUNC_SYMBOL(switch_resume)
*/
ENTRY(cpu_switchto)
/* Save current lwp's context to switchframe. */
mov.l .L_PCBp, r0
mov.l @(r0, r4), r1 /* l->l_md.md_pcb */
mov.l @(L_MD_PCB, r4), r1 /* l->l_md.md_pcb */
SAVEPCB(r1)
/*
@ -196,7 +192,6 @@ ENTRY(cpu_switchto)
mov r0, r4
.align 2
.L_PCBp: .long (L_MD_PCB)
.L_curlwp: .long _C_LABEL(curlwp)
.L_cpu_switch_prepare: .long _C_LABEL(cpu_switch_prepare)
@ -248,13 +243,12 @@ ENTRY(cpu_do_exit)
* hard reset. (never can access kernel stack).
*/
NENTRY(sh3_switch_resume)
mov.l .L_UPTE, r0
mov.l .L_curupte, r1
add r4, r0 /* l->l_md.md_upte */
add #L_MD_UPTE, r4 /* l->l_md.md_upte */
rts
mov.l r0, @r1
mov.l r4, @r1
.align 2
.L_UPTE: .long L_MD_UPTE
.L_curupte: .long _C_LABEL(curupte)
SET_ENTRY_SIZE(sh3_switch_resume)
#endif /* SH3 */
@ -267,8 +261,7 @@ NENTRY(sh3_switch_resume)
* TLB multiple hit.
*/
NENTRY(sh4_switch_resume)
mov.l .L_UPTE__sh4, r0
add r0, r4 /* l->l_md.md_upte */
add #L_MD_UPTE, r4 /* l->l_md.md_upte */
mov #UPAGES,r3
mov #1, r2
mov.l @r4, r0 /* if (l->l_md.md_upte[0].addr == 0) return; */
@ -321,7 +314,7 @@ NENTRY(sh4_switch_resume)
2: rts /* mova target must be 4byte alignment */
nop
.align 2
.L_UPTE__sh4: .long L_MD_UPTE
.L_4_PTEH: .long SH4_PTEH
.L_4_UTLB_AA_A: .long (SH4_UTLB_AA | SH4_UTLB_A)
.L_4_ITLB_AA: .long SH4_ITLB_AA