mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
The serial UML OS-abstraction layer patch (um/kernel dir). This moves all systemcalls from uaccess_user.c file under os-Linux dir Signed-off-by: Gennady Sharapov <[email protected]> Signed-off-by: Jeff Dike <[email protected]> Cc: Paolo Giarrusso <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
31 lines
746 B
C
31 lines
746 B
C
/*
|
|
* Copyright (C) 2001 Chris Emerson ([email protected])
|
|
* Copyright (C) 2001, 2002 Jeff Dike ([email protected])
|
|
* Licensed under the GPL
|
|
*/
|
|
|
|
/* These are here rather than tt/uaccess.c because skas mode needs them in
|
|
* order to do SIGBUS recovery when a tmpfs mount runs out of room.
|
|
*/
|
|
|
|
#include <linux/string.h>
|
|
#include "os.h"
|
|
|
|
void __do_copy(void *to, const void *from, int n)
|
|
{
|
|
memcpy(to, from, n);
|
|
}
|
|
|
|
|
|
int __do_copy_to_user(void *to, const void *from, int n,
|
|
void **fault_addr, void **fault_catcher)
|
|
{
|
|
unsigned long fault;
|
|
int faulted;
|
|
|
|
fault = __do_user_copy(to, from, n, fault_addr, fault_catcher,
|
|
__do_copy, &faulted);
|
|
if(!faulted) return(0);
|
|
else return(n - (fault - (unsigned long) to));
|
|
}
|