[BACK]Return to uaccess.c CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / arch / um / os-Linux

File: [Development] / linux-2.6-xfs / arch / um / os-Linux / uaccess.c (download)

Revision 1.6, Mon Dec 3 16:26:37 2007 UTC (9 years, 10 months ago) by lachlan.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.5: +1 -1 lines

Merge up to 2.6.24-rc3
Merge of 2.6.x-xfs-melb:linux:30183b by kenmcd.

/*
 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
 * Licensed under the GPL
 */

#include <stddef.h>
#include "longjmp.h"

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

	jmp_buf jbuf;
	*fault_catcher = &jbuf;
	if(UML_SETJMP(&jbuf) == 0){
		(*op)(to, from, n);
		ret = 0;
		*faulted_out = 0;
	}
	else {
		ret = *faddrp;
		*faulted_out = 1;
	}
	*fault_addr = NULL;
	*fault_catcher = NULL;
	return ret;
}