/*1* linux/arch/arm/lib/clear_user.S2*3* Copyright (C) 1995, 1996,1997,1998 Russell King4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 2 as7* published by the Free Software Foundation.8*/9#include <linux/linkage.h>10#include <asm/assembler.h>1112.text1314/* Prototype: int __clear_user(void *addr, size_t sz)15* Purpose : clear some user memory16* Params : addr - user memory address to clear17* : sz - number of bytes to clear18* Returns : number of bytes NOT cleared19*/20ENTRY(__clear_user_std)21WEAK(__clear_user)22stmfd sp!, {r1, lr}23mov r2, #024cmp r1, #425blt 2f26ands ip, r0, #327beq 1f28cmp ip, #229strusr r2, r0, 130strusr r2, r0, 1, le31strusr r2, r0, 1, lt32rsb ip, ip, #433sub r1, r1, ip @ 7 6 5 4 3 2 1341: subs r1, r1, #8 @ -1 -2 -3 -4 -5 -6 -735strusr r2, r0, 4, pl, rept=236bpl 1b37adds r1, r1, #4 @ 3 2 1 0 -1 -2 -338strusr r2, r0, 4, pl392: tst r1, #2 @ 1x 1x 0x 0x 1x 1x 0x40strusr r2, r0, 1, ne, rept=241tst r1, #1 @ x1 x0 x1 x0 x1 x0 x142it ne @ explicit IT needed for the label43USER( strnebt r2, [r0])44mov r0, #045ldmfd sp!, {r1, pc}46ENDPROC(__clear_user)47ENDPROC(__clear_user_std)4849.pushsection .fixup,"ax"50.align 0519001: ldmfd sp!, {r0, pc}52.popsection53545556