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

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

Revision 1.3, Tue Feb 26 16:44:40 2008 UTC (9 years, 7 months ago) by lachlan.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.2: +7 -4 lines

Merge up to 2.6.25-rc3
Merge of 2.6.x-xfs-melb:linux:30555a by kenmcd.

/*
 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 * 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, jmp_buf **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);
}