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

TOMOYO Linux Cross Reference
Linux/arch/sh/lib/__clear_user.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * __clear_user_page, __clear_user, clear_page implementation of SuperH
  4  *
  5  * Copyright (C) 2001  Kaz Kojima
  6  * Copyright (C) 2001, 2002  Niibe Yutaka
  7  * Copyright (C) 2006  Paul Mundt
  8  */
  9 #include <linux/linkage.h>
 10 #include <asm/page.h>
 11 
 12 ENTRY(__clear_user)
 13         !
 14         mov     #0, r0
 15         mov     #0xffffffe0, r1
 16         !
 17         ! r4..(r4+31)&~32          -------- not aligned [ Area 0 ]
 18         ! (r4+31)&~32..(r4+r5)&~32 -------- aligned     [ Area 1 ]
 19         ! (r4+r5)&~32..r4+r5       -------- not aligned [ Area 2 ]
 20         !
 21         ! Clear area 0
 22         mov     r4, r2
 23         !
 24         tst     r1, r5          ! length < 32
 25         bt      .Larea2         ! skip to remainder
 26         !
 27         add     #31, r2
 28         and     r1, r2
 29         cmp/eq  r4, r2
 30         bt      .Larea1
 31         mov     r2, r3
 32         sub     r4, r3
 33         mov     r3, r7
 34         mov     r4, r2
 35         !
 36 .L0:    dt      r3
 37 0:      mov.b   r0, @r2
 38         bf/s    .L0
 39          add    #1, r2
 40         !
 41         sub     r7, r5
 42         mov     r2, r4
 43 .Larea1:
 44         mov     r4, r3
 45         add     r5, r3
 46         and     r1, r3
 47         cmp/hi  r2, r3
 48         bf      .Larea2
 49         !
 50         ! Clear area 1
 51 #if defined(CONFIG_CPU_SH4)
 52 1:      movca.l r0, @r2
 53 #else
 54 1:      mov.l   r0, @r2
 55 #endif
 56         add     #4, r2
 57 2:      mov.l   r0, @r2
 58         add     #4, r2
 59 3:      mov.l   r0, @r2
 60         add     #4, r2
 61 4:      mov.l   r0, @r2
 62         add     #4, r2
 63 5:      mov.l   r0, @r2
 64         add     #4, r2
 65 6:      mov.l   r0, @r2
 66         add     #4, r2
 67 7:      mov.l   r0, @r2
 68         add     #4, r2
 69 8:      mov.l   r0, @r2
 70         add     #4, r2
 71         cmp/hi  r2, r3
 72         bt/s    1b
 73          nop
 74         !
 75         ! Clear area 2
 76 .Larea2:
 77         mov     r4, r3
 78         add     r5, r3
 79         cmp/hs  r3, r2
 80         bt/s    .Ldone
 81          sub    r2, r3
 82 .L2:    dt      r3
 83 9:      mov.b   r0, @r2
 84         bf/s    .L2
 85          add    #1, r2
 86         !
 87 .Ldone: rts
 88          mov    #0, r0  ! return 0 as normal return
 89 
 90         ! return the number of bytes remained
 91 .Lbad_clear_user:
 92         mov     r4, r0
 93         add     r5, r0
 94         rts
 95          sub    r2, r0
 96 
 97 .section __ex_table,"a"
 98         .align 2
 99         .long   0b, .Lbad_clear_user
100         .long   1b, .Lbad_clear_user
101         .long   2b, .Lbad_clear_user
102         .long   3b, .Lbad_clear_user
103         .long   4b, .Lbad_clear_user
104         .long   5b, .Lbad_clear_user
105         .long   6b, .Lbad_clear_user
106         .long   7b, .Lbad_clear_user
107         .long   8b, .Lbad_clear_user
108         .long   9b, .Lbad_clear_user
109 .previous

~ [ 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