1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/lib/clear_user.S
5 * Copyright (C) 1995, 1996,1997,1998 Russell King
7 #include <linux/linkage.h>
8 #include <asm/assembler.h>
9 #include <asm/unwind.h>
13 /* Prototype: unsigned long arm_clear_user(void *addr, size_t sz)
14 * Purpose : clear some user memory
15 * Params : addr - user memory address to clear
16 * : sz - number of bytes to clear
17 * Returns : number of bytes NOT cleared
19 ENTRY(__clear_user_std)
22 UNWIND(.save {r1, lr})
34 sub r1, r1, ip @ 7 6 5 4 3 2 1
35 1: subs r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -7
36 strusr r2, r0, 4, pl, rept=2
38 adds r1, r1, #4 @ 3 2 1 0 -1 -2 -3
40 2: tst r1, #2 @ 1x 1x 0x 0x 1x 1x 0x
41 strusr r2, r0, 1, ne, rept=2
42 tst r1, #1 @ x1 x0 x1 x0 x1 x0 x1
43 it ne @ explicit IT needed for the label
44 USER( strbtne r2, [r0])
48 ENDPROC(arm_clear_user)
49 ENDPROC(__clear_user_std)
51 .pushsection .text.fixup,"ax"
53 9001: ldmfd sp!, {r0, pc}