• Stefan Agner's avatar
    ARM: trusted_foundations: do not use naked function · 4ea7bdc6
    Stefan Agner authored
    As documented in GCC naked functions should only use basic ASM
    syntax. The extended ASM or mixture of basic ASM and "C" code is
    not guaranteed. Currently this works because it was hard coded
    to follow and check GCC behavior for arguments and register
    placement.
    
    Furthermore with clang using parameters in Extended asm in a
    naked function is not supported:
      arch/arm/firmware/trusted_foundations.c:47:10: error: parameter
              references not allowed in naked functions
                    : "r" (type), "r" (arg1), "r" (arg2)
                           ^
    
    Use a regular function to be more portable. This aligns also with
    the other SMC call implementations e.g. in qcom_scm-32.c and
    bcm_kona_smc.c.
    
    Cc: Dmitry Osipenko <digetx@gmail.com>
    Cc: Stephen Warren <swarren@nvidia.com>
    Cc: Thierry Reding <treding@nvidia.com>
    Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    4ea7bdc6
trusted_foundations.c 2.73 KB