arm64: uti: Add arch-dependent helper for context switch

arm64 performs context-switch in kernel space instead of user space as in
x86_64.

Change-Id: Ib119b9ff014effb970183ee86cfac67fab773cba
Futjitsu: POSTK_DEBUG_ARCH_DEP_99
This commit is contained in:
Shiratori, Takehiro
2019-03-12 14:19:18 +09:00
committed by Masamichi Takagi
parent 63d500515a
commit 8356ef6c96
9 changed files with 91 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
/* archdep.S COPYRIGHT FUJITSU LIMITED 2017-2018 */
/* archdep.S COPYRIGHT FUJITSU LIMITED 2017-2019 */
#include <sys/syscall.h>
@@ -11,6 +11,8 @@
* x2 : void **param
* x3 : void *lctx
* x4 : void *rctx
*
* Save and switch the context including TLS.
*/
.global switch_ctx
switch_ctx:

View File

@@ -17,6 +17,8 @@ Syscam call convention:
rdi: fd
rsi: cmd
rdx: param
Save and switch the context including FS.
*/
.global switch_ctx

View File

@@ -2894,7 +2894,8 @@ static long util_thread(struct thread_data_s *my_thread, unsigned long rp_rctx,
save_fs_desc.rctx = uti_desc->rctx;
save_fs_desc.lctx = uti_desc->lctx;
if ((rc = switch_ctx(fd, MCEXEC_UP_UTI_SAVE_FS, &save_fs_desc, uti_desc->lctx, uti_desc->rctx))
if ((rc = switch_ctx(fd, MCEXEC_UP_UTI_SWITCH_CTX, &save_fs_desc,
uti_desc->lctx, uti_desc->rctx))
< 0) {
fprintf(stderr, "%s: ERROR switch_ctx failed (%d)\n", __FUNCTION__, rc);
goto out;