[PATCH] EDAC: amd76x pci_dev_get/pci_dev_put fixes
[linux-2.6/mini2440.git] / arch / um / os-Linux / uaccess.c
blob166fb66995df87e58793c6f99a33334324eaddce
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 */
7 #include <setjmp.h>
8 #include <string.h>
9 #include "longjmp.h"
11 unsigned long __do_user_copy(void *to, const void *from, int n,
12 void **fault_addr, void **fault_catcher,
13 void (*op)(void *to, const void *from,
14 int n), int *faulted_out)
16 unsigned long *faddrp = (unsigned long *) fault_addr, ret;
17 int enable;
19 sigjmp_buf jbuf;
20 *fault_catcher = &jbuf;
21 if(UML_SIGSETJMP(&jbuf, enable) == 0){
22 (*op)(to, from, n);
23 ret = 0;
24 *faulted_out = 0;
26 else {
27 ret = *faddrp;
28 *faulted_out = 1;
30 *fault_addr = NULL;
31 *fault_catcher = NULL;
32 return ret;