Skip to content

Commit

Permalink
Merge pull request torvalds#322 from laijs/host_task_stub
Browse files Browse the repository at this point in the history
use host_task_stub() for host task
  • Loading branch information
tavip authored Feb 20, 2017
2 parents 84f6a9b + 1025f3c commit 5b3fcd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/lkl/include/asm/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ static inline void thread_sched_jb(void)
}

void switch_to_host_task(struct task_struct *);
int host_task_stub(void *unused);

#endif /* _ASM_LKL_SCHED_H */
2 changes: 1 addition & 1 deletion arch/lkl/kernel/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int new_host_task(struct task_struct **task)

switch_to_host_task(host0);

pid = kernel_thread(NULL, NULL, CLONE_FLAGS);
pid = kernel_thread(host_task_stub, NULL, CLONE_FLAGS);
if (pid < 0)
return pid;

Expand Down
7 changes: 6 additions & 1 deletion arch/lkl/kernel/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ struct task_struct *__switch_to(struct task_struct *prev,
return abs_prev;
}

int host_task_stub(void *unused)
{
return 0;
}

void switch_to_host_task(struct task_struct *task)
{
if (current == task)
Expand Down Expand Up @@ -170,7 +175,7 @@ int copy_thread(unsigned long clone_flags, unsigned long esp,
struct thread_info *ti = task_thread_info(p);
struct thread_bootstrap_arg *tba;

if (!esp) {
if ((int (*)(void *))esp == host_task_stub) {
set_ti_thread_flag(ti, TIF_HOST_THREAD);
return 0;
}
Expand Down

0 comments on commit 5b3fcd5

Please sign in to comment.