diff options
-rw-r--r-- | sys/arch/m68k/m68k/copy.s | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/arch/m68k/m68k/copy.s b/sys/arch/m68k/m68k/copy.s index a09f7f77a5e..b27a0a5a3dd 100644 --- a/sys/arch/m68k/m68k/copy.s +++ b/sys/arch/m68k/m68k/copy.s @@ -1,5 +1,5 @@ -/* $OpenBSD: copy.s,v 1.9 2000/05/27 21:38:36 art Exp $ */ -/* $NetBSD: copy.s,v 1.29 1998/02/15 21:18:45 thorpej Exp $ */ +/* $OpenBSD: copy.s,v 1.10 2001/03/28 22:38:13 art Exp $ */ +/* $NetBSD: copy.s,v 1.30 1998/03/04 06:39:14 thorpej Exp $ */ /*- * Copyright (c) 1998 Jason R. Thorpe. All rights reserved. @@ -319,11 +319,17 @@ Lcosfault: /* * kcopy(const void *src, void *dst, size_t len); * - * Copy len bytes from src to dst, aborting if we encounter a page fault. + * Copy len bytes from src to dst, aborting if we encounter a fatal + * page fault. + * + * kcopy() _must_ save and restore the old fault handler since it is + * called by uiomove(), which may be in the path of servicing a non-fatal + * page fault. */ ENTRY(kcopy) - link a6,#0 - movl _C_LABEL(curpcb),a0 | set fault handler + link a6,#-4 + movl _C_LABEL(curpcb),a0 | set fault handler + movl a0@(PCB_ONFAULT),a6@(-4) | save old handler first movl #Lkcfault,a0@(PCB_ONFAULT) movl a6@(16),sp@- | push len movl a6@(12),sp@- | push dst @@ -332,8 +338,8 @@ ENTRY(kcopy) addl #12,sp | pop args clrl d0 | success! Lkcdone: - movl _C_LABEL(curpcb),a0 | clear fault handler - clrl a0@(PCB_ONFAULT) + movl _C_LABEL(curpcb),a0 | restore fault handler + movl a6@(-4),a0@(PCB_ONFAULT) unlk a6 rts Lkcfault: |