/*1* Copyright (C) 2001 Chris Emerson ([email protected])2* Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)3* Licensed under the GPL4*/56/*7* These are here rather than tt/uaccess.c because skas mode needs them in8* order to do SIGBUS recovery when a tmpfs mount runs out of room.9*/1011#include <linux/string.h>12#include "os.h"1314static void __do_copy(void *to, const void *from, int n)15{16memcpy(to, from, n);17}181920int __do_copy_to_user(void *to, const void *from, int n,21void **fault_addr, jmp_buf **fault_catcher)22{23unsigned long fault;24int faulted;2526fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,27__do_copy, &faulted);28if (!faulted)29return 0;30else31return n - (fault - (unsigned long) to);32}333435