arch/arm: replace SYS_syscall_return hardcode from syscall

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-02-22 15:25:56 +08:00 committed by Xiang Xiao
parent 6a1a7bf455
commit e0fabbfdd6
5 changed files with 15 additions and 10 deletions

View File

@ -95,8 +95,9 @@ static void dispatch_syscall(void)
" add sp, sp, #12\n" /* Destroy the stack frame */
" pop {r4, r5}\n" /* Recover R4 and R5 */
" mov r2, r0\n" /* R2=Save return value in R2 */
" mov r0, #3\n" /* R0=SYS_syscall_return */
" svc %0\n"::"i"(SYS_syscall) /* Return from the SYSCALL */
" mov r0, %0\n" /* R0=SYS_syscall_return */
" svc %1\n"::"i"(SYS_syscall_return),
"i"(SYS_syscall) /* Return from the SYSCALL */
);
}
#endif

View File

@ -96,8 +96,9 @@ static void dispatch_syscall(void)
" ldr lr, [sp, #12]\n" /* Restore lr */
" add sp, sp, #16\n" /* Destroy the stack frame */
" mov r2, r0\n" /* R2=Save return value in R2 */
" mov r0, #0\n" /* R0=SYS_syscall_return */
" svc %0\n"::"i"(SYS_syscall) /* Return from the SYSCALL */
" mov r0, %0\n" /* R0=SYS_syscall_return */
" svc %1\n"::"i"(SYS_syscall_return),
"i"(SYS_syscall) /* Return from the SYSCALL */
);
}
#endif

View File

@ -103,8 +103,9 @@ static void dispatch_syscall(void)
" ldr r2, [sp, #16]\n" /* Restore (orig_SP - new_SP) value */
" add sp, sp, r2\n" /* Restore SP */
" mov r2, r0\n" /* R2=Save return value in R2 */
" mov r0, #3\n" /* R0=SYS_syscall_return */
" svc %0\n"::"i"(SYS_syscall) /* Return from the SYSCALL */
" mov r0, %0\n" /* R0=SYS_syscall_return */
" svc %1\n"::"i"(SYS_syscall_return),
"i"(SYS_syscall) /* Return from the SYSCALL */
);
}
#endif

View File

@ -93,8 +93,9 @@ static void dispatch_syscall(void)
" ldr lr, [sp, #12]\n" /* Restore lr */
" add sp, sp, #16\n" /* Destroy the stack frame */
" mov r2, r0\n" /* R2=Save return value in R2 */
" mov r0, #0\n" /* R0=SYS_syscall_return */
" svc %0\n"::"i"(SYS_syscall) /* Return from the SYSCALL */
" mov r0, %0\n" /* R0=SYS_syscall_return */
" svc %1\n"::"i"(SYS_syscall_return),
"i"(SYS_syscall) /* Return from the SYSCALL */
);
}
#endif

View File

@ -102,8 +102,9 @@ static void dispatch_syscall(void)
" ldr r2, [sp, #16]\n" /* Restore (orig_SP - new_SP) value */
" add sp, sp, r2\n" /* Restore SP */
" mov r2, r0\n" /* R2=Save return value in R2 */
" mov r0, #3\n" /* R0=SYS_syscall_return */
" svc %0\n"::"i"(SYS_syscall) /* Return from the SYSCALL */
" mov r0, %0\n" /* R0=SYS_syscall_return */
" svc %1\n"::"i"(SYS_syscall_return),
"i"(SYS_syscall) /* Return from the SYSCALL */
);
}
#endif