uti: rename x86-specific 'fs' to 'tls' + arm implem

Note: the original fujitsu implementation didn't rename the various
save_fs function/desc to save_tls for some reason, might as well go all
the way though...

Change-Id: Ic362c15c8b320c4d258d2ead8c5fd4eafd9d0ae9
Fujitsu: POSTK_DEBUG_ARCH_DEP_91
This commit is contained in:
Shiratori, Takehiro
2019-03-12 14:35:27 +09:00
committed by Masamichi Takagi
parent 8356ef6c96
commit c32edff2bb
8 changed files with 79 additions and 46 deletions

View File

@@ -18,7 +18,7 @@ Syscam call convention:
rsi: cmd
rdx: param
Save and switch the context including FS.
Save and switch the context including TLS.
*/
.global switch_ctx

View File

@@ -1,6 +1,8 @@
#include "../include/uprotocol.h"
extern int switch_ctx(int fd, unsigned long cmd, struct uti_save_fs_desc *desc, void *lctx, void *rctx);
extern int switch_ctx(int fd, unsigned long cmd,
struct uti_switch_ctx_desc *desc, void *lctx,
void *rctx);
extern unsigned long compare_and_swap(unsigned long *addr, unsigned long old, unsigned long new);
extern unsigned int compare_and_swap_int(unsigned int *addr, unsigned int old, unsigned int new);
extern int archdep_syscall(struct syscall_wait_desc *w, long *ret);

View File

@@ -2814,7 +2814,7 @@ static void kill_thread(unsigned long tid, int sig,
static long util_thread(struct thread_data_s *my_thread, unsigned long rp_rctx, int remote_tid, unsigned long pattr, unsigned long uti_clv, unsigned long _uti_desc)
{
struct uti_get_ctx_desc get_ctx_desc;
struct uti_save_fs_desc save_fs_desc;
struct uti_switch_ctx_desc switch_ctx_desc;
int rc = 0;
struct thread_data_s *tp;
@@ -2891,10 +2891,10 @@ static long util_thread(struct thread_data_s *my_thread, unsigned long rp_rctx,
uti_desc->start_syscall_intercept = 1;
/* Save remote and local FS and then contex-switch */
save_fs_desc.rctx = uti_desc->rctx;
save_fs_desc.lctx = uti_desc->lctx;
switch_ctx_desc.rctx = uti_desc->rctx;
switch_ctx_desc.lctx = uti_desc->lctx;
if ((rc = switch_ctx(fd, MCEXEC_UP_UTI_SWITCH_CTX, &save_fs_desc,
if ((rc = switch_ctx(fd, MCEXEC_UP_UTI_SWITCH_CTX, &switch_ctx_desc,
uti_desc->lctx, uti_desc->rctx))
< 0) {
fprintf(stderr, "%s: ERROR switch_ctx failed (%d)\n", __FUNCTION__, rc);