~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/lib/clear_user.S

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  *  linux/arch/arm/lib/clear_user.S
  4  *
  5  *  Copyright (C) 1995, 1996,1997,1998 Russell King
  6  */
  7 #include <linux/linkage.h>
  8 #include <asm/assembler.h>
  9 #include <asm/unwind.h>
 10 
 11                 .text
 12 
 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
 18  */
 19 ENTRY(__clear_user_std)
 20 WEAK(arm_clear_user)
 21 UNWIND(.fnstart)
 22 UNWIND(.save {r1, lr})
 23                 stmfd   sp!, {r1, lr}
 24                 mov     r2, #0
 25                 cmp     r1, #4
 26                 blt     2f
 27                 ands    ip, r0, #3
 28                 beq     1f
 29                 cmp     ip, #2
 30                 strusr  r2, r0, 1
 31                 strusr  r2, r0, 1, le
 32                 strusr  r2, r0, 1, lt
 33                 rsb     ip, ip, #4
 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
 37                 bpl     1b
 38                 adds    r1, r1, #4              @  3  2  1  0 -1 -2 -3
 39                 strusr  r2, r0, 4, pl
 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])
 45                 mov     r0, #0
 46                 ldmfd   sp!, {r1, pc}
 47 UNWIND(.fnend)
 48 ENDPROC(arm_clear_user)
 49 ENDPROC(__clear_user_std)
 50 
 51                 .pushsection .text.fixup,"ax"
 52                 .align  0
 53 9001:           ldmfd   sp!, {r0, pc}
 54                 .popsection
 55 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php