Added private_data structure in process
Conflicts: executer/user/mcexec.c kernel/include/process.h kernel/process.c
This commit is contained in:
committed by
Balazs Gerofi
parent
e36abe57e7
commit
8a1d756cb1
@@ -573,6 +573,8 @@ struct process {
|
||||
#endif // PROFILE_ENABLE
|
||||
int nr_processes; /* For partitioned execution */
|
||||
int process_rank; /* Rank in partition */
|
||||
|
||||
void *fd_priv_table[265];
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -138,6 +138,11 @@ init_process(struct process *proc, struct process *parent)
|
||||
INIT_LIST_HEAD(&proc->ptraced_siblings_list);
|
||||
mcs_rwlock_init(&proc->update_lock);
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_63 */
|
||||
}
|
||||
|
||||
// Double check the inheritance from parent
|
||||
memset(proc->fd_priv_table, 0, 256 * sizeof(void *));
|
||||
|
||||
INIT_LIST_HEAD(&proc->threads_list);
|
||||
INIT_LIST_HEAD(&proc->children_list);
|
||||
INIT_LIST_HEAD(&proc->ptraced_children_list);
|
||||
|
||||
@@ -67,6 +67,8 @@
|
||||
#include <lwk/stddef.h>
|
||||
#include <futex.h>
|
||||
|
||||
//#include <hfi1/hfi.h>
|
||||
|
||||
#define SYSCALL_BY_IKC
|
||||
|
||||
//#define DEBUG_PRINT_SC
|
||||
@@ -480,6 +482,7 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
||||
|
||||
if (req->number == __NR_open && rc > 0) {
|
||||
if (res.private_data && !strncmp(req->args[0], "/dev/hfi", 8)) {
|
||||
thread->proc->fd_priv_table[rc] = res.private_data;
|
||||
kprintf("%s: PID: %d, open fd: %d, filename: %s, private_data: 0x%lx\n",
|
||||
__FUNCTION__, thread->proc->pid, rc, req->args[0], res.private_data);
|
||||
}
|
||||
@@ -3086,6 +3089,20 @@ do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYSCALL_DECLARE(writev)
|
||||
{
|
||||
struct process *proc = cpu_local_var(current)->proc;
|
||||
int fd = ihk_mc_syscall_arg0(ctx);
|
||||
int iovcnt = ihk_mc_syscall_arg2(ctx);
|
||||
if (fd < 256) {
|
||||
//struct hfi1_filedata *hf = (struct hfi1_filedata *)proc->fd_priv_table[fd];
|
||||
kprintf("%s: fd[%d], 0x%lx, iovcnt[%d]\n", __FUNCTION__, fd, proc->fd_priv_table[fd], iovcnt);
|
||||
} else {
|
||||
kprintf("%s: fd[%d] > 256\n", __FUNCTION__, fd);
|
||||
}
|
||||
return syscall_generic_forwarding(__NR_writev, ctx);
|
||||
}
|
||||
|
||||
SYSCALL_DECLARE(read)
|
||||
{
|
||||
int fd = ihk_mc_syscall_arg0(ctx);
|
||||
|
||||
Reference in New Issue
Block a user