Files
mckernel/executer/include/uti.h
Ken Sato a9973e913d uti: futex call function in mcctrl
Previously, futex code of McKerenl was called by mccontrol,
but there ware some problems with this method.
(Mainly, location of McKernel image on memory)

Call futex code in mcctrl instead of the one in McKernel image,
giving the following benefits:
1. Not relying on shared kernel virtual address space with Linux any more
2. The cpu id store / retrieve is not needed and resulting in the code

Change-Id: Ic40929b64a655b270c435859fa287fedb713ee5c
refe: #1428
2021-02-26 10:24:19 +09:00

62 lines
1.7 KiB
C

#ifndef UTI_H_INCLUDED
#define UTI_H_INCLUDED
struct syscall_struct {
int number;
unsigned long args[6];
unsigned long ret;
unsigned long uti_info; /* reference to data in McKernel */
};
#define UTI_SZ_SYSCALL_STACK 16
/* Variables accessed by mcexec.c and syscall_intercept.c */
struct uti_desc {
char lctx[4096]; /* TODO: Get the size from config.h */
char rctx[4096]; /* TODO: Get the size from config.h */
int mck_tid; /* TODO: Move this out for multiple migrated-to-Linux threads */
unsigned long key; /* struct task_struct* of mcexec thread, used to search struct host_thread */
int pid, tid; /* Used as the id of tracee when issuing MCEXEC_UP_TERMINATE_THREAD */
unsigned long uti_info; /* reference to data in McKernel */
int fd; /* /dev/mcosX */
struct syscall_struct syscall_stack[UTI_SZ_SYSCALL_STACK]; /* stack of system call arguments and return values */
int syscall_stack_top; /* stack-pointer of syscall arguments list */
long syscalls[512], syscalls2[512]; /* Syscall profile counters */
int start_syscall_intercept; /* Used to sync between mcexec.c and syscall_intercept.c */
};
/* Reference to McKernel variables accessed by mcctrl */
struct uti_info {
/* clv info */
unsigned long thread_va;
void *uti_futex_resp;
void *ikc2linux;
unsigned long uti_futex_resp_pa;
unsigned long ikc2linux_pa;
/* thread info */
int tid;
int cpu;
void *status;
void *spin_sleep_lock;
void *spin_sleep;
void *vm;
void *futex_q;
unsigned long status_pa;
unsigned long spin_sleep_lock_pa;
unsigned long spin_sleep_pa;
unsigned long vm_pa;
unsigned long futex_q_pa;
/* global info */
int mc_idle_halt;
void *futex_queue;
void *os; // set by mcctrl
unsigned long futex_queue_pa;
};
#endif