Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb578426 authored by Gennady Sharapov's avatar Gennady Sharapov Committed by Linus Torvalds
Browse files

[PATCH] uml: separate libc-dependent uaccess code



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: default avatarGennady Sharapov <Gennady.V.Sharapov@intel.com>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0e76422c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -199,6 +199,12 @@ extern void forward_pending_sigio(int target);
extern int start_fork_tramp(void *arg, unsigned long temp_stack,
			    int clone_flags, int (*tramp)(void *));

/* uaccess.c */
extern unsigned long __do_user_copy(void *to, const void *from, int n,
				    void **fault_addr, void **fault_catcher,
				    void (*op)(void *to, const void *from,
					       int n), int *faulted_out);

#endif

/*
+0 −4
Original line number Diff line number Diff line
@@ -8,10 +8,6 @@

extern int __do_copy_to_user(void *to, const void *from, int n,
			     void **fault_addr, void **fault_catcher);
extern unsigned long __do_user_copy(void *to, const void *from, int n,
				    void **fault_addr, void **fault_catcher,
				    void (*op)(void *to, const void *from,
					       int n), int *faulted_out);
void __do_copy(void *to, const void *from, int n);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ obj-y = config.o exec_kern.o exitcode.o \
	helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o physmem.o \
	process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \
	signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o time.o \
	time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o um_arch.o \
	time_kern.o tlb.o trap_kern.o trap_user.o uaccess.o um_arch.o \
	umid.o user_util.o

obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include "uml_uaccess.h"
#include "task.h"
#include "kern_util.h"
#include "os.h"

int __do_copy_from_user(void *to, const void *from, int n,
			void **fault_addr, void **fault_catcher)
+30 −0
Original line number Diff line number Diff line
@@ -4,35 +4,12 @@
 * Licensed under the GPL
 */

#include <setjmp.h>
#include <string.h>

/* 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.
 */

unsigned long __do_user_copy(void *to, const void *from, int n,
			     void **fault_addr, void **fault_catcher,
			     void (*op)(void *to, const void *from,
					int n), int *faulted_out)
{
	unsigned long *faddrp = (unsigned long *) fault_addr, ret;

	sigjmp_buf jbuf;
	*fault_catcher = &jbuf;
	if(sigsetjmp(jbuf, 1) == 0){
		(*op)(to, from, n);
		ret = 0;
		*faulted_out = 0;
	} 
	else {
		ret = *faddrp;
		*faulted_out = 1;
	}
	*fault_addr = NULL;
	*fault_catcher = NULL;
	return ret;
}
#include <linux/string.h>
#include "os.h"

void __do_copy(void *to, const void *from, int n)
{
@@ -51,14 +28,3 @@ int __do_copy_to_user(void *to, const void *from, int n,
	if(!faulted) return(0);
	else return(n - (fault - (unsigned long) to));
}

/*
 * Overrides for Emacs so that we follow Linus's tabbing style.
 * Emacs will notice this stuff at the end of the file and automatically
 * adjust the settings for this buffer only.  This must remain at the end
 * of the file.
 * ---------------------------------------------------------------------------
 * Local variables:
 * c-file-style: "linux"
 * End:
 */
Loading