diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-05-27 21:38:37 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-05-27 21:38:37 +0000 |
commit | 355d85b7b75c60519d2a65960dd0c4465d69f11f (patch) | |
tree | 1fe143ded71e852df7fea5256a686377d08d2ed3 /sys/arch/m68k | |
parent | 731dad203084edac6a7b8d3d39e47794e0904763 (diff) |
kcopy, needed by UVM.
From NetBSD.
Diffstat (limited to 'sys/arch/m68k')
-rw-r--r-- | sys/arch/m68k/m68k/copy.s | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/sys/arch/m68k/m68k/copy.s b/sys/arch/m68k/m68k/copy.s index 75860ab8377..a09f7f77a5e 100644 --- a/sys/arch/m68k/m68k/copy.s +++ b/sys/arch/m68k/m68k/copy.s @@ -1,7 +1,8 @@ -/* $OpenBSD: copy.s,v 1.8 1999/11/13 21:34:06 deraadt Exp $ */ -/* $NetBSD: copy.s,v 1.28 1997/05/21 03:51:04 jeremy Exp $ */ +/* $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 $ */ /*- + * Copyright (c) 1998 Jason R. Thorpe. All rights reserved. * Copyright (c) 1994, 1995 Charles Hannum. * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -314,6 +315,33 @@ Lcosfault: moveq #EFAULT,d0 bra Lcosdone +#if defined(UVM) +/* + * kcopy(const void *src, void *dst, size_t len); + * + * Copy len bytes from src to dst, aborting if we encounter a page fault. + */ +ENTRY(kcopy) + link a6,#0 + movl _C_LABEL(curpcb),a0 | set fault handler + movl #Lkcfault,a0@(PCB_ONFAULT) + movl a6@(16),sp@- | push len + movl a6@(12),sp@- | push dst + movl a6@(8),sp@- | push src + jbsr _C_LABEL(bcopy) | copy it + addl #12,sp | pop args + clrl d0 | success! +Lkcdone: + movl _C_LABEL(curpcb),a0 | clear fault handler + clrl a0@(PCB_ONFAULT) + unlk a6 + rts +Lkcfault: + addl #16,sp | pop args and return address + moveq #EFAULT,d0 | indicate a fault + bra Lkcdone +#endif /* UVM */ + /* * fuword(caddr_t uaddr); * Fetch an int from the user's address space. |