Add machine-dependent bits of RAS for arm32.
This commit is contained in:
parent
cda9af7bb6
commit
212cb9f78d
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: cpuswitch.S,v 1.17 2002/08/17 16:36:33 thorpej Exp $ */
|
/* $NetBSD: cpuswitch.S,v 1.18 2002/08/31 03:07:32 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994-1998 Mark Brinicombe.
|
* Copyright (c) 1994-1998 Mark Brinicombe.
|
||||||
|
@ -584,6 +584,8 @@ ENTRY(cpu_switch)
|
||||||
add r7, r1, #PCB_R8
|
add r7, r1, #PCB_R8
|
||||||
ldmia r7, {r8-r13}
|
ldmia r7, {r8-r13}
|
||||||
|
|
||||||
|
mov r7, r1 /* preserve PCB pointer */
|
||||||
|
|
||||||
#ifdef ARMFPE
|
#ifdef ARMFPE
|
||||||
add r0, r1, #(USER_SIZE) & 0x00ff
|
add r0, r1, #(USER_SIZE) & 0x00ff
|
||||||
add r0, r0, #(USER_SIZE) & 0xff00
|
add r0, r0, #(USER_SIZE) & 0xff00
|
||||||
|
@ -593,6 +595,18 @@ ENTRY(cpu_switch)
|
||||||
/* We can enable interrupts again */
|
/* We can enable interrupts again */
|
||||||
IRQenable
|
IRQenable
|
||||||
|
|
||||||
|
/* rem: r6 = new proc */
|
||||||
|
/* rem: r7 = new PCB */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for restartable atomic sequences (RAS).
|
||||||
|
*/
|
||||||
|
|
||||||
|
ldr r2, [r6, #(P_NRAS)]
|
||||||
|
ldr r4, [r7, #(PCB_TF)] /* r4 = trapframe (used below) */
|
||||||
|
teq r2, #0 /* p->p_nras == 0? */
|
||||||
|
bne .Lswitch_do_ras /* no, check for one */
|
||||||
|
|
||||||
.Lswitch_return:
|
.Lswitch_return:
|
||||||
|
|
||||||
/* Get the spl level from the stack and update the current spl level */
|
/* Get the spl level from the stack and update the current spl level */
|
||||||
|
@ -608,6 +622,14 @@ ENTRY(cpu_switch)
|
||||||
*/
|
*/
|
||||||
ldmfd sp!, {r4-r7, pc}
|
ldmfd sp!, {r4-r7, pc}
|
||||||
|
|
||||||
|
.Lswitch_do_ras:
|
||||||
|
ldr r1, [r4, #(TF_PC)] /* second ras_lookup() arg */
|
||||||
|
mov r0, r6 /* first ras_lookup() arg */
|
||||||
|
bl _C_LABEL(ras_lookup)
|
||||||
|
cmn r0, #1 /* -1 means "not in a RAS" */
|
||||||
|
strne r0, [r4, #(TF_PC)]
|
||||||
|
b .Lswitch_return
|
||||||
|
|
||||||
.Lswitch_exited:
|
.Lswitch_exited:
|
||||||
/*
|
/*
|
||||||
* We skip the cache purge because switch_exit() already did
|
* We skip the cache purge because switch_exit() already did
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $NetBSD: genassym.cf,v 1.14 2002/06/23 00:16:59 thorpej Exp $
|
# $NetBSD: genassym.cf,v 1.15 2002/08/31 03:07:32 thorpej Exp $
|
||||||
|
|
||||||
# Copyright (c) 1982, 1990 The Regents of the University of California.
|
# Copyright (c) 1982, 1990 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
@ -72,12 +72,14 @@ define P_STAT offsetof(struct proc, p_stat)
|
||||||
define P_WCHAN offsetof(struct proc, p_wchan)
|
define P_WCHAN offsetof(struct proc, p_wchan)
|
||||||
define P_VMSPACE offsetof(struct proc, p_vmspace)
|
define P_VMSPACE offsetof(struct proc, p_vmspace)
|
||||||
define P_FLAG offsetof(struct proc, p_flag)
|
define P_FLAG offsetof(struct proc, p_flag)
|
||||||
|
define P_NRAS offsetof(struct proc, p_nras)
|
||||||
define P_SIGLIST offsetof(struct proc, p_sigctx) + offsetof(struct sigctx, ps_siglist)
|
define P_SIGLIST offsetof(struct proc, p_sigctx) + offsetof(struct sigctx, ps_siglist)
|
||||||
define P_SIGMASK offsetof(struct proc, p_sigctx) + offsetof(struct sigctx, ps_sigmask)
|
define P_SIGMASK offsetof(struct proc, p_sigctx) + offsetof(struct sigctx, ps_sigmask)
|
||||||
define P_USRPRI offsetof(struct proc, p_usrpri)
|
define P_USRPRI offsetof(struct proc, p_usrpri)
|
||||||
|
|
||||||
define SONPROC SONPROC
|
define SONPROC SONPROC
|
||||||
|
|
||||||
|
define PCB_TF offsetof(struct pcb, pcb_tf)
|
||||||
define PCB_PAGEDIR offsetof(struct pcb, pcb_pagedir)
|
define PCB_PAGEDIR offsetof(struct pcb, pcb_pagedir)
|
||||||
define PCB_FLAGS offsetof(struct pcb, pcb_flags)
|
define PCB_FLAGS offsetof(struct pcb, pcb_flags)
|
||||||
define PCB_R8 offsetof(struct pcb, pcb_un.un_32.pcb32_r8)
|
define PCB_R8 offsetof(struct pcb, pcb_un.un_32.pcb32_r8)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: types.h,v 1.1 2001/11/22 17:59:58 thorpej Exp $ */
|
/* $NetBSD: types.h,v 1.2 2002/08/31 03:07:32 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Wasabi Systems, Inc.
|
* Copyright (c) 2001 Wasabi Systems, Inc.
|
||||||
|
@ -44,4 +44,6 @@
|
||||||
|
|
||||||
#include <arm/types.h> /* pull in generic ARM definitions */
|
#include <arm/types.h> /* pull in generic ARM definitions */
|
||||||
|
|
||||||
|
#define __HAVE_RAS
|
||||||
|
|
||||||
#endif /* _ARM_ARM32_TYPES_H_ */
|
#endif /* _ARM_ARM32_TYPES_H_ */
|
||||||
|
|
Loading…
Reference in New Issue