diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-10 04:12:10 -0500 | 
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-10 04:12:10 -0500 | 
| commit | 2f67bdb23d74a6c6fd4f98f64239c5c34d1833cc (patch) | |
| tree | fe533abe3e7c400848647b95e4806f5125c654c3 /arch/um/kernel/uaccess.c | |
| parent | d40d9d29c020f8466c96f8e3ad4b7c014ff1085d (diff) | |
| parent | 3b44f137b9a846c5452d9e6e1271b79b1dbcc942 (diff) | |
Merge branch 'master'
Diffstat (limited to 'arch/um/kernel/uaccess.c')
| -rw-r--r-- | arch/um/kernel/uaccess.c | 30 | 
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c new file mode 100644 index 000000000000..054e3de0784e --- /dev/null +++ b/arch/um/kernel/uaccess.c  | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) | ||
| 3 | * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
| 4 | * Licensed under the GPL | ||
| 5 | */ | ||
| 6 | |||
| 7 | /* These are here rather than tt/uaccess.c because skas mode needs them in | ||
| 8 | * order to do SIGBUS recovery when a tmpfs mount runs out of room. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <linux/string.h> | ||
| 12 | #include "os.h" | ||
| 13 | |||
| 14 | void __do_copy(void *to, const void *from, int n) | ||
| 15 | { | ||
| 16 | memcpy(to, from, n); | ||
| 17 | } | ||
| 18 | |||
| 19 | |||
| 20 | int __do_copy_to_user(void *to, const void *from, int n, | ||
| 21 | void **fault_addr, void **fault_catcher) | ||
| 22 | { | ||
| 23 | unsigned long fault; | ||
| 24 | int faulted; | ||
| 25 | |||
| 26 | fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, | ||
| 27 | __do_copy, &faulted); | ||
| 28 | if(!faulted) return(0); | ||
| 29 | else return(n - (fault - (unsigned long) to)); | ||
| 30 | } | ||
