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
10 /* These are here rather than tt/uaccess.c because skas mode needs them in
11 * order to do SIGBUS recovery when a tmpfs mount runs out of room.
14 unsigned long __do_user_copy(void *to
, const void *from
, int n
,
15 void **fault_addr
, void **fault_catcher
,
16 void (*op
)(void *to
, const void *from
,
17 int n
), int *faulted_out
)
19 unsigned long *faddrp
= (unsigned long *) fault_addr
, ret
;
22 *fault_catcher
= &jbuf
;
23 if(sigsetjmp(jbuf
, 1) == 0){
33 *fault_catcher
= NULL
;
37 void __do_copy(void *to
, const void *from
, int n
)
43 int __do_copy_to_user(void *to
, const void *from
, int n
,
44 void **fault_addr
, void **fault_catcher
)
49 fault
= __do_user_copy(to
, from
, n
, fault_addr
, fault_catcher
,
51 if(!faulted
) return(0);
52 else return(n
- (fault
- (unsigned long) to
));
56 * Overrides for Emacs so that we follow Linus's tabbing style.
57 * Emacs will notice this stuff at the end of the file and automatically
58 * adjust the settings for this buffer only. This must remain at the end
60 * ---------------------------------------------------------------------------
62 * c-file-style: "linux"