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 78a9ef66288ae6cf6195d40906c7df2cfead1474..073acbf02a7c842520eeb42df0df4f2dd3a15480 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 aeafc03e961a822c82772a060350fd7728de1de4..48a3a26eff663589a18c3944eff17d1240f66822 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 ebb3c06cbb5d8d7645b98881bf0ff2db8d9d1aa6..8e25e89ad01fd7daa41065bae7e1c9745dce986b 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 3d8153a1ebce94800bfe25a50bf4a5e247b9cacf..667139013ed171ef4b5de1ba916941060858475c 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 bbb8562396afe011add6ad6b33788ae41e6eacd2..e125a84eb40009c371275b9be7320e690b92d7a8 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 357eae2c18ebb1c7a6485482bf409c9cb2b3ae8a..1a104d0089f3a4036574bb6d1c5ac9796740dc5b 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 e6135f16649b17b256d287907f20894af919c947..243e107e98963b21552ea2cc2ee52e9fc24026e3 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 48a3ab636e4fb1b12cb0db91c74d55b6e0f10b79..edf6b970a2774374ad79a828eaefd645cf7d2f1e 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 b297bdaaf5498ba8a30f228b1f87a583e1a37b7f..c0671e793ea9183e5ddc63696d79c8fa2466c2a6 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 d79f48994dbb2c5564b6387dad106839e9b24796..9f382adfa88a221b481c1ec4bc94ade038e754af 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 784775136480618f9c297116a30fc8bfb05806e3..02cda2e33bde292916830beca52c1d4ef271fd4a 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 9fb97e6bc56025122e2f0e036b5c957944611714..77c3c7ba008423389aff39923e81225fb4082426 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 ca3ec18171a43a9650fc284a3d1336ad931531c0..1f47eae3b0d6d618d24c347db7c2da9ffce98068 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 e9aefbe0b7401091b63747a6d3f28acbcc48c14e..4767540d1b94ed4bacb2903cbf3904d376c4f5d9 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 87b0cb066915fadd7e6b419c01ac8d0a1ed7df82..ee3ed882dd79fbfd4aecdbd6c4b5e1948603011b 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 f571581888fa4ae654f669b9b8232cf78a78ad47..2a7ee949ed4714fd376a0913e6cc66bced6391e5 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 c0bac9493c683e50fcafb25b7c79c1337d731a7a..b72913a990389a22be61fc981a730816e9a427b6 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 794ac49ea43330a38bb5a3fd22958f63eb6df9fa..13132d1ed6d127913883f3215a3c0819cbb5598e 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 047622536535d4d5698cc3e5cd6b16ad91ec749d..a88613834fb07b350031390cb3ecf4595bc877f5 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)