Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/i386 return_address(9) can be called from inte...
details: https://anonhg.NetBSD.org/src/rev/2a3cf7a60b14
branches: trunk
changeset: 748833:2a3cf7a60b14
user: dyoung <dyoung%NetBSD.org@localhost>
date: Fri Nov 06 18:18:57 2009 +0000
description:
return_address(9) can be called from interrupt context; handle its
page faults appropriately.
diffstat:
sys/arch/i386/i386/copy.S | 15 +++++++--------
sys/arch/i386/i386/trap.c | 9 +++++----
2 files changed, 12 insertions(+), 12 deletions(-)
diffs (95 lines):
diff -r 26647590e4ec -r 2a3cf7a60b14 sys/arch/i386/i386/copy.S
--- a/sys/arch/i386/i386/copy.S Fri Nov 06 16:16:59 2009 +0000
+++ b/sys/arch/i386/i386/copy.S Fri Nov 06 18:18:57 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copy.S,v 1.19 2009/11/03 05:08:18 dyoung Exp $ */
+/* $NetBSD: copy.S,v 1.20 2009/11/06 18:18:57 dyoung Exp $ */
/* NetBSD: locore.S,v 1.34 2005/04/01 11:59:31 yamt Exp $ */
/*-
@@ -65,7 +65,7 @@
*/
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.19 2009/11/03 05:08:18 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.20 2009/11/06 18:18:57 dyoung Exp $");
#include "assym.h"
@@ -139,16 +139,18 @@
ENTRY(return_address)
movl %ebp,%eax /* frame pointer -> %eax */
movl 4(%esp),%ecx /* level -> %ecx */
+ movl CPUVAR(CURLWP),%edx
+ movl L_ADDR(%edx),%edx
+ movl $_C_LABEL(return_address_fault),PCB_ONFAULT(%edx)
cmpl $0,%ecx
je 2f
1:
-.Lreturn_address_start:
movl (%eax),%eax /* next frame pointer */
decl %ecx
jnz 1b
2:
movl 0x4(%eax),%eax
-.Lreturn_address_end:
+ movl $0,PCB_ONFAULT(%edx)
ret
/*
@@ -319,6 +321,7 @@
/* LINTSTUB: Ignore */
NENTRY(return_address_fault)
+ movl $0,PCB_ONFAULT(%edx)
movl $0,%eax
ret
@@ -815,10 +818,6 @@
.long .Lx86_copyargs_end
.long _C_LABEL(x86_copyargs_fault)
- .long .Lreturn_address_start
- .long .Lreturn_address_end
- .long _C_LABEL(return_address_fault)
-
.long 0 /* terminate */
.text
diff -r 26647590e4ec -r 2a3cf7a60b14 sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Fri Nov 06 16:16:59 2009 +0000
+++ b/sys/arch/i386/i386/trap.c Fri Nov 06 18:18:57 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.248 2009/10/05 19:04:14 dyoung Exp $ */
+/* $NetBSD: trap.c,v 1.249 2009/11/06 18:18:57 dyoung Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.248 2009/10/05 19:04:14 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.249 2009/11/06 18:18:57 dyoung Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -297,7 +297,8 @@
struct lwp *l = curlwp;
struct proc *p;
struct pcb *pcb;
- extern char fusubail[], kcopy_fault[], trapreturn[], IDTVEC(osyscall)[];
+ extern char fusubail[], kcopy_fault[], return_address_fault[],
+ trapreturn[], IDTVEC(osyscall)[];
struct trapframe *vframe;
ksiginfo_t ksi;
void *onfault;
@@ -581,7 +582,7 @@
* from inside the profiling interrupt.
*/
onfault = pcb->pcb_onfault;
- if (onfault == fusubail) {
+ if (onfault == fusubail || onfault == return_address_fault) {
goto copyefault;
}
if (cpu_intr_p() || (l->l_pflag & LP_INTR) != 0) {
Home |
Main Index |
Thread Index |
Old Index