1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 * Linux architectural port borrowing liberally from similar works of
6 * others. All original copyrights apply as per the original source
9 * Modifications for the OpenRISC architecture:
10 * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
11 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
14 #include <linux/linkage.h>
15 #include <asm/errno.h>
18 * this can be optimized by doing gcc inline assemlby with
19 * proper constraints (no need to save args registers...)
26 * int __copy_tofrom_user(void *to, const void *from, unsigned long size);
28 * NOTE: it returns number of bytes NOT copied !!!
31 .global __copy_tofrom_user
48 l.addi r11,r11,1 // r11 holds the return value
62 .section __ex_table, "a"
63 .long 8b, 99b // read fault
64 .long 9b, 99b // write fault
68 * unsigned long clear_user(void *addr, unsigned long size) ;
70 * NOTE: it returns number of bytes NOT cleared !!!
99 .section __ex_table, "a"
100 .long 9b, 99b // write fault