Skip to content

Commit 5b3fcd5

Browse files
authored
Merge pull request #322 from laijs/host_task_stub
use host_task_stub() for host task
2 parents 84f6a9b + 1025f3c commit 5b3fcd5

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

arch/lkl/include/asm/sched.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ static inline void thread_sched_jb(void)
1818
}
1919

2020
void switch_to_host_task(struct task_struct *);
21+
int host_task_stub(void *unused);
2122

2223
#endif /* _ASM_LKL_SCHED_H */

arch/lkl/kernel/syscalls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static int new_host_task(struct task_struct **task)
6161

6262
switch_to_host_task(host0);
6363

64-
pid = kernel_thread(NULL, NULL, CLONE_FLAGS);
64+
pid = kernel_thread(host_task_stub, NULL, CLONE_FLAGS);
6565
if (pid < 0)
6666
return pid;
6767

arch/lkl/kernel/threads.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ struct task_struct *__switch_to(struct task_struct *prev,
126126
return abs_prev;
127127
}
128128

129+
int host_task_stub(void *unused)
130+
{
131+
return 0;
132+
}
133+
129134
void switch_to_host_task(struct task_struct *task)
130135
{
131136
if (current == task)
@@ -170,7 +175,7 @@ int copy_thread(unsigned long clone_flags, unsigned long esp,
170175
struct thread_info *ti = task_thread_info(p);
171176
struct thread_bootstrap_arg *tba;
172177

173-
if (!esp) {
178+
if ((int (*)(void *))esp == host_task_stub) {
174179
set_ti_thread_flag(ti, TIF_HOST_THREAD);
175180
return 0;
176181
}

0 commit comments

Comments
 (0)