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 guarantee. Currently
this works because it was hard coded to follow and check GCC behavior for
arguments and register placement.
By replacing the naked function with an inline one it is possible to have the
same result in a more portable and reliable way. Register placement checks
are not needed since there is no hard code.
Not-signed-off-by: Behan Webster <behanw@converseincode.com>
Not-signed-off-by: VinÃcius Tinti <viniciustinti@gmail.com>
static unsigned long cpu_boot_addr;
-static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2)
+static inline void tf_generic_smc(u32 type, u32 arg1, u32 arg2)
{
asm volatile(
".arch_extension sec\n\t"
"stmfd sp!, {r4 - r11, lr}\n\t"
- __asmeq("%0", "r0")
- __asmeq("%1", "r1")
- __asmeq("%2", "r2")
"mov r3, #0\n\t"
"mov r4, #0\n\t"
"smc #0\n\t"