2 * Copy from user space to user space
4 * Copyright (C) 2012 ARM Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <linux/linkage.h>
20 #include <asm/assembler.h>
23 * Copy from user space to user space (alignment handled by the hardware)
30 * x0 - bytes not copied
33 add x4, x0, x2 // upper user buffer boundary
37 USER(9f, ldr x3, [x1], #8 )
39 USER(9f, str x3, [x0], #8 )
43 USER(9f, ldr w3, [x1], #4 )
45 USER(9f, str w3, [x0], #4 )
48 USER(9f, ldrh w3, [x1], #2 )
50 USER(9f, strh w3, [x0], #2 )
53 USER(9f, ldrb w3, [x1] )
54 USER(9f, strb w3, [x0] )
57 ENDPROC(__copy_in_user)
61 9: sub x0, x4, x0 // bytes not copied