1 
   2 
   3 
   4 
   5 
   6 
   7 #include <linux/linkage.h>
   8 
   9 #include <asm/asm-uaccess.h>
  10 #include <asm/assembler.h>
  11 
  12         .text
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 ENTRY(__arch_clear_user)
  23         mov     x2, x1                  
  24         subs    x1, x1, #8
  25         b.mi    2f
  26 1:
  27 uao_user_alternative 9f, str, sttr, xzr, x0, 8
  28         subs    x1, x1, #8
  29         b.pl    1b
  30 2:      adds    x1, x1, #4
  31         b.mi    3f
  32 uao_user_alternative 9f, str, sttr, wzr, x0, 4
  33         sub     x1, x1, #4
  34 3:      adds    x1, x1, #2
  35         b.mi    4f
  36 uao_user_alternative 9f, strh, sttrh, wzr, x0, 2
  37         sub     x1, x1, #2
  38 4:      adds    x1, x1, #1
  39         b.mi    5f
  40 uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
  41 5:      mov     x0, #0
  42         ret
  43 ENDPROC(__arch_clear_user)
  44 EXPORT_SYMBOL(__arch_clear_user)
  45 
  46         .section .fixup,"ax"
  47         .align  2
  48 9:      mov     x0, x2                  
  49         ret
  50         .previous