2 * linux/arch/unicore32/lib/clear_user.S
4 * Code specific to PKUnity SoC and UniCore ISA
6 * Copyright (C) 2001-2010 GUAN Xue-tao
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 #include <linux/linkage.h>
13 #include <asm/assembler.h>
17 /* Prototype: int __clear_user(void *addr, size_t sz)
18 * Purpose : clear some user memory
19 * Params : addr - user memory address to clear
20 * : sz - number of bytes to clear
21 * Returns : number of bytes NOT cleared
36 sub r1, r1, ip @ 7 6 5 4 3 2 1
37 1: sub.a r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -7
38 strusr r2, r0, 4, ns, rept=2
40 add.a r1, r1, #4 @ 3 2 1 0 -1 -2 -3
42 2: cand.a r1, #2 @ 1x 1x 0x 0x 1x 1x 0x
43 strusr r2, r0, 1, ne, rept=2
44 cand.a r1, #1 @ x1 x0 x1 x0 x1 x0 x1
52 .pushsection .fixup,"ax"
54 9001: ldm.w (r0), [sp]+