1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/unicore32/lib/clear_user.S
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
9 #include <linux/linkage.h>
10 #include <asm/assembler.h>
14 /* Prototype: int __clear_user(void *addr, size_t sz)
15 * Purpose : clear some user memory
16 * Params : addr - user memory address to clear
17 * : sz - number of bytes to clear
18 * Returns : number of bytes NOT cleared
33 sub r1, r1, ip @ 7 6 5 4 3 2 1
34 1: sub.a r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -7
35 strusr r2, r0, 4, ns, rept=2
37 add.a r1, r1, #4 @ 3 2 1 0 -1 -2 -3
39 2: cand.a r1, #2 @ 1x 1x 0x 0x 1x 1x 0x
40 strusr r2, r0, 1, ne, rept=2
41 cand.a r1, #1 @ x1 x0 x1 x0 x1 x0 x1
49 .pushsection .fixup,"ax"
51 9001: ldm.w (r0), [sp]+