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