arm64: lib: Use modern annotations for assembly functions
authorMark Brown <broonie@kernel.org>
Mon, 6 Jan 2020 19:58:17 +0000 (19:58 +0000)
committerWill Deacon <will@kernel.org>
Wed, 8 Jan 2020 12:23:02 +0000 (12:23 +0000)
In an effort to clarify and simplify the annotation of assembly functions
in the kernel new macros have been introduced. These replace ENTRY and
ENDPROC and also add a new annotation for static functions which previously
had no ENTRY equivalent. Update the annotations in the library code to the
new macros.

Signed-off-by: Mark Brown <broonie@kernel.org>
[will: Use SYM_FUNC_START_WEAK_PI]
Signed-off-by: Will Deacon <will@kernel.org>
19 files changed:
arch/arm64/lib/clear_page.S
arch/arm64/lib/clear_user.S
arch/arm64/lib/copy_from_user.S
arch/arm64/lib/copy_in_user.S
arch/arm64/lib/copy_page.S
arch/arm64/lib/copy_to_user.S
arch/arm64/lib/crc32.S
arch/arm64/lib/memchr.S
arch/arm64/lib/memcmp.S
arch/arm64/lib/memcpy.S
arch/arm64/lib/memmove.S
arch/arm64/lib/memset.S
arch/arm64/lib/strchr.S
arch/arm64/lib/strcmp.S
arch/arm64/lib/strlen.S
arch/arm64/lib/strncmp.S
arch/arm64/lib/strnlen.S
arch/arm64/lib/strrchr.S
arch/arm64/lib/tishift.S

index 78a9ef6..073acbf 100644 (file)
@@ -14,7 +14,7 @@
  * Parameters:
  *     x0 - dest
  */
-ENTRY(clear_page)
+SYM_FUNC_START(clear_page)
        mrs     x1, dczid_el0
        and     w1, w1, #0xf
        mov     x2, #4
@@ -25,5 +25,5 @@ ENTRY(clear_page)
        tst     x0, #(PAGE_SIZE - 1)
        b.ne    1b
        ret
-ENDPROC(clear_page)
+SYM_FUNC_END(clear_page)
 EXPORT_SYMBOL(clear_page)
index aeafc03..48a3a26 100644 (file)
@@ -19,7 +19,7 @@
  *
  * Alignment fixed up by hardware.
  */
-ENTRY(__arch_clear_user)
+SYM_FUNC_START(__arch_clear_user)
        mov     x2, x1                  // save the size for fixup return
        subs    x1, x1, #8
        b.mi    2f
@@ -40,7 +40,7 @@ uao_user_alternative 9f, strh, sttrh, wzr, x0, 2
 uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
 5:     mov     x0, #0
        ret
-ENDPROC(__arch_clear_user)
+SYM_FUNC_END(__arch_clear_user)
 EXPORT_SYMBOL(__arch_clear_user)
 
        .section .fixup,"ax"
index ebb3c06..8e25e89 100644 (file)
        .endm
 
 end    .req    x5
-ENTRY(__arch_copy_from_user)
+SYM_FUNC_START(__arch_copy_from_user)
        add     end, x0, x2
 #include "copy_template.S"
        mov     x0, #0                          // Nothing to copy
        ret
-ENDPROC(__arch_copy_from_user)
+SYM_FUNC_END(__arch_copy_from_user)
 EXPORT_SYMBOL(__arch_copy_from_user)
 
        .section .fixup,"ax"
index 3d8153a..6671390 100644 (file)
 
 end    .req    x5
 
-ENTRY(__arch_copy_in_user)
+SYM_FUNC_START(__arch_copy_in_user)
        add     end, x0, x2
 #include "copy_template.S"
        mov     x0, #0
        ret
-ENDPROC(__arch_copy_in_user)
+SYM_FUNC_END(__arch_copy_in_user)
 EXPORT_SYMBOL(__arch_copy_in_user)
 
        .section .fixup,"ax"
index bbb8562..e125a84 100644 (file)
@@ -17,7 +17,7 @@
  *     x0 - dest
  *     x1 - src
  */
-ENTRY(copy_page)
+SYM_FUNC_START(copy_page)
 alternative_if ARM64_HAS_NO_HW_PREFETCH
        // Prefetch three cache lines ahead.
        prfm    pldl1strm, [x1, #128]
@@ -75,5 +75,5 @@ alternative_else_nop_endif
        stnp    x16, x17, [x0, #112]
 
        ret
-ENDPROC(copy_page)
+SYM_FUNC_END(copy_page)
 EXPORT_SYMBOL(copy_page)
index 357eae2..1a104d0 100644 (file)
        .endm
 
 end    .req    x5
-ENTRY(__arch_copy_to_user)
+SYM_FUNC_START(__arch_copy_to_user)
        add     end, x0, x2
 #include "copy_template.S"
        mov     x0, #0
        ret
-ENDPROC(__arch_copy_to_user)
+SYM_FUNC_END(__arch_copy_to_user)
 EXPORT_SYMBOL(__arch_copy_to_user)
 
        .section .fixup,"ax"
index e6135f1..243e107 100644 (file)
@@ -85,17 +85,17 @@ CPU_BE(     rev16           w3, w3          )
        .endm
 
        .align          5
-ENTRY(crc32_le)
+SYM_FUNC_START(crc32_le)
 alternative_if_not ARM64_HAS_CRC32
        b               crc32_le_base
 alternative_else_nop_endif
        __crc32
-ENDPROC(crc32_le)
+SYM_FUNC_END(crc32_le)
 
        .align          5
-ENTRY(__crc32c_le)
+SYM_FUNC_START(__crc32c_le)
 alternative_if_not ARM64_HAS_CRC32
        b               __crc32c_le_base
 alternative_else_nop_endif
        __crc32         c
-ENDPROC(__crc32c_le)
+SYM_FUNC_END(__crc32c_le)
index 48a3ab6..edf6b97 100644 (file)
@@ -19,7 +19,7 @@
  * Returns:
  *     x0 - address of first occurrence of 'c' or 0
  */
-WEAK(memchr)
+SYM_FUNC_START_WEAK_PI(memchr)
        and     w1, w1, #0xff
 1:     subs    x2, x2, #1
        b.mi    2f
@@ -30,5 +30,5 @@ WEAK(memchr)
        ret
 2:     mov     x0, #0
        ret
-ENDPIPROC(memchr)
+SYM_FUNC_END_PI(memchr)
 EXPORT_SYMBOL_NOKASAN(memchr)
index b297bda..c0671e7 100644 (file)
@@ -46,7 +46,7 @@ pos           .req    x11
 limit_wd       .req    x12
 mask           .req    x13
 
-WEAK(memcmp)
+SYM_FUNC_START_WEAK_PI(memcmp)
        cbz     limit, .Lret0
        eor     tmp1, src1, src2
        tst     tmp1, #7
@@ -243,5 +243,5 @@ CPU_LE( rev data2, data2 )
 .Lret0:
        mov     result, #0
        ret
-ENDPIPROC(memcmp)
+SYM_FUNC_END_PI(memcmp)
 EXPORT_SYMBOL_NOKASAN(memcmp)
index d79f489..9f382ad 100644 (file)
        .endm
 
        .weak memcpy
-ENTRY(__memcpy)
-ENTRY(memcpy)
+SYM_FUNC_START_ALIAS(__memcpy)
+SYM_FUNC_START_PI(memcpy)
 #include "copy_template.S"
        ret
-ENDPIPROC(memcpy)
+SYM_FUNC_END_PI(memcpy)
 EXPORT_SYMBOL(memcpy)
-ENDPROC(__memcpy)
+SYM_FUNC_END_ALIAS(__memcpy)
 EXPORT_SYMBOL(__memcpy)
index 7847751..02cda2e 100644 (file)
@@ -46,8 +46,8 @@ D_l   .req    x13
 D_h    .req    x14
 
        .weak memmove
-ENTRY(__memmove)
-ENTRY(memmove)
+SYM_FUNC_START_ALIAS(__memmove)
+SYM_FUNC_START_PI(memmove)
        cmp     dstin, src
        b.lo    __memcpy
        add     tmp1, src, count
@@ -184,7 +184,7 @@ ENTRY(memmove)
        tst     count, #0x3f
        b.ne    .Ltail63
        ret
-ENDPIPROC(memmove)
+SYM_FUNC_END_PI(memmove)
 EXPORT_SYMBOL(memmove)
-ENDPROC(__memmove)
+SYM_FUNC_END_ALIAS(__memmove)
 EXPORT_SYMBOL(__memmove)
index 9fb97e6..77c3c7b 100644 (file)
@@ -43,8 +43,8 @@ tmp3w         .req    w9
 tmp3           .req    x9
 
        .weak memset
-ENTRY(__memset)
-ENTRY(memset)
+SYM_FUNC_START_ALIAS(__memset)
+SYM_FUNC_START_PI(memset)
        mov     dst, dstin      /* Preserve return value.  */
        and     A_lw, val, #255
        orr     A_lw, A_lw, A_lw, lsl #8
@@ -203,7 +203,7 @@ ENTRY(memset)
        ands    count, count, zva_bits_x
        b.ne    .Ltail_maybe_long
        ret
-ENDPIPROC(memset)
+SYM_FUNC_END_PI(memset)
 EXPORT_SYMBOL(memset)
-ENDPROC(__memset)
+SYM_FUNC_END_ALIAS(__memset)
 EXPORT_SYMBOL(__memset)
index ca3ec18..1f47eae 100644 (file)
@@ -18,7 +18,7 @@
  * Returns:
  *     x0 - address of first occurrence of 'c' or 0
  */
-WEAK(strchr)
+SYM_FUNC_START_WEAK(strchr)
        and     w1, w1, #0xff
 1:     ldrb    w2, [x0], #1
        cmp     w2, w1
@@ -28,5 +28,5 @@ WEAK(strchr)
        cmp     w2, w1
        csel    x0, x0, xzr, eq
        ret
-ENDPROC(strchr)
+SYM_FUNC_END(strchr)
 EXPORT_SYMBOL_NOKASAN(strchr)
index e9aefbe..4767540 100644 (file)
@@ -48,7 +48,7 @@ tmp3          .req    x9
 zeroones       .req    x10
 pos            .req    x11
 
-WEAK(strcmp)
+SYM_FUNC_START_WEAK_PI(strcmp)
        eor     tmp1, src1, src2
        mov     zeroones, #REP8_01
        tst     tmp1, #7
@@ -219,5 +219,5 @@ CPU_BE(     orr     syndrome, diff, has_nul )
        lsr     data1, data1, #56
        sub     result, data1, data2, lsr #56
        ret
-ENDPIPROC(strcmp)
+SYM_FUNC_END_PI(strcmp)
 EXPORT_SYMBOL_NOKASAN(strcmp)
index 87b0cb0..ee3ed88 100644 (file)
@@ -44,7 +44,7 @@ pos           .req    x12
 #define REP8_7f 0x7f7f7f7f7f7f7f7f
 #define REP8_80 0x8080808080808080
 
-WEAK(strlen)
+SYM_FUNC_START_WEAK_PI(strlen)
        mov     zeroones, #REP8_01
        bic     src, srcin, #15
        ands    tmp1, srcin, #15
@@ -111,5 +111,5 @@ CPU_LE( lsr tmp2, tmp2, tmp1 )      /* Shift (tmp1 & 63).  */
        csinv   data1, data1, xzr, le
        csel    data2, data2, data2a, le
        b       .Lrealigned
-ENDPIPROC(strlen)
+SYM_FUNC_END_PI(strlen)
 EXPORT_SYMBOL_NOKASAN(strlen)
index f571581..2a7ee94 100644 (file)
@@ -52,7 +52,7 @@ limit_wd      .req    x13
 mask           .req    x14
 endloop                .req    x15
 
-WEAK(strncmp)
+SYM_FUNC_START_WEAK_PI(strncmp)
        cbz     limit, .Lret0
        eor     tmp1, src1, src2
        mov     zeroones, #REP8_01
@@ -295,5 +295,5 @@ CPU_BE( orr syndrome, diff, has_nul )
 .Lret0:
        mov     result, #0
        ret
-ENDPIPROC(strncmp)
+SYM_FUNC_END_PI(strncmp)
 EXPORT_SYMBOL_NOKASAN(strncmp)
index c0bac94..b72913a 100644 (file)
@@ -47,7 +47,7 @@ limit_wd      .req    x14
 #define REP8_7f 0x7f7f7f7f7f7f7f7f
 #define REP8_80 0x8080808080808080
 
-WEAK(strnlen)
+SYM_FUNC_START_WEAK_PI(strnlen)
        cbz     limit, .Lhit_limit
        mov     zeroones, #REP8_01
        bic     src, srcin, #15
@@ -156,5 +156,5 @@ CPU_LE( lsr tmp2, tmp2, tmp4 )      /* Shift (tmp1 & 63).  */
 .Lhit_limit:
        mov     len, limit
        ret
-ENDPIPROC(strnlen)
+SYM_FUNC_END_PI(strnlen)
 EXPORT_SYMBOL_NOKASAN(strnlen)
index 794ac49..13132d1 100644 (file)
@@ -18,7 +18,7 @@
  * Returns:
  *     x0 - address of last occurrence of 'c' or 0
  */
-WEAK(strrchr)
+SYM_FUNC_START_WEAK_PI(strrchr)
        mov     x3, #0
        and     w1, w1, #0xff
 1:     ldrb    w2, [x0], #1
@@ -29,5 +29,5 @@ WEAK(strrchr)
        b       1b
 2:     mov     x0, x3
        ret
-ENDPIPROC(strrchr)
+SYM_FUNC_END_PI(strrchr)
 EXPORT_SYMBOL_NOKASAN(strrchr)
index 0476225..a886138 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <asm/assembler.h>
 
-ENTRY(__ashlti3)
+SYM_FUNC_START(__ashlti3)
        cbz     x2, 1f
        mov     x3, #64
        sub     x3, x3, x2
@@ -26,10 +26,10 @@ ENTRY(__ashlti3)
        lsl     x1, x0, x1
        mov     x0, x2
        ret
-ENDPROC(__ashlti3)
+SYM_FUNC_END(__ashlti3)
 EXPORT_SYMBOL(__ashlti3)
 
-ENTRY(__ashrti3)
+SYM_FUNC_START(__ashrti3)
        cbz     x2, 1f
        mov     x3, #64
        sub     x3, x3, x2
@@ -48,10 +48,10 @@ ENTRY(__ashrti3)
        asr     x0, x1, x0
        mov     x1, x2
        ret
-ENDPROC(__ashrti3)
+SYM_FUNC_END(__ashrti3)
 EXPORT_SYMBOL(__ashrti3)
 
-ENTRY(__lshrti3)
+SYM_FUNC_START(__lshrti3)
        cbz     x2, 1f
        mov     x3, #64
        sub     x3, x3, x2
@@ -70,5 +70,5 @@ ENTRY(__lshrti3)
        lsr     x0, x1, x0
        mov     x1, x2
        ret
-ENDPROC(__lshrti3)
+SYM_FUNC_END(__lshrti3)
 EXPORT_SYMBOL(__lshrti3)