summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/arch/frv/kernel/uaccess.c
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 12:28:04 +0530
committerSrikant Patnaik2015-01-11 12:28:04 +0530
commit871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch)
tree8718f573808810c2a1e8cb8fb6ac469093ca2784 /ANDROID_3.4.5/arch/frv/kernel/uaccess.c
parent9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff)
downloadFOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure.
Diffstat (limited to 'ANDROID_3.4.5/arch/frv/kernel/uaccess.c')
-rw-r--r--ANDROID_3.4.5/arch/frv/kernel/uaccess.c100
1 files changed, 0 insertions, 100 deletions
diff --git a/ANDROID_3.4.5/arch/frv/kernel/uaccess.c b/ANDROID_3.4.5/arch/frv/kernel/uaccess.c
deleted file mode 100644
index 374f88d6..00000000
--- a/ANDROID_3.4.5/arch/frv/kernel/uaccess.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* uaccess.c: userspace access functions
- *
- * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <asm/uaccess.h>
-
-/*****************************************************************************/
-/*
- * copy a null terminated string from userspace
- */
-long strncpy_from_user(char *dst, const char __user *src, long count)
-{
- unsigned long max;
- char *p, ch;
- long err = -EFAULT;
-
- BUG_ON(count < 0);
-
- p = dst;
-
-#ifndef CONFIG_MMU
- if ((unsigned long) src < memory_start)
- goto error;
-#endif
-
- if ((unsigned long) src >= get_addr_limit())
- goto error;
-
- max = get_addr_limit() - (unsigned long) src;
- if ((unsigned long) count > max) {
- memset(dst + max, 0, count - max);
- count = max;
- }
-
- err = 0;
- for (; count > 0; count--, p++, src++) {
- __get_user_asm(err, ch, src, "ub", "=r");
- if (err < 0)
- goto error;
- if (!ch)
- break;
- *p = ch;
- }
-
- err = p - dst; /* return length excluding NUL */
-
- error:
- if (count > 0)
- memset(p, 0, count); /* clear remainder of buffer [security] */
-
- return err;
-
-} /* end strncpy_from_user() */
-
-EXPORT_SYMBOL(strncpy_from_user);
-
-/*****************************************************************************/
-/*
- * Return the size of a string (including the ending 0)
- *
- * Return 0 on exception, a value greater than N if too long
- */
-long strnlen_user(const char __user *src, long count)
-{
- const char __user *p;
- long err = 0;
- char ch;
-
- BUG_ON(count < 0);
-
-#ifndef CONFIG_MMU
- if ((unsigned long) src < memory_start)
- return 0;
-#endif
-
- if ((unsigned long) src >= get_addr_limit())
- return 0;
-
- for (p = src; count > 0; count--, p++) {
- __get_user_asm(err, ch, p, "ub", "=r");
- if (err < 0)
- return 0;
- if (!ch)
- break;
- }
-
- return p - src + 1; /* return length including NUL */
-
-} /* end strnlen_user() */
-
-EXPORT_SYMBOL(strnlen_user);