forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from tavip/fix-setjmp
lkl: host ops: fix jump buffer API and implementation
- Loading branch information
Showing
8 changed files
with
51 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef _ASM_LKL_SCHED_H | ||
#define _ASM_LKL_SCHED_H | ||
|
||
#include <linux/sched.h> | ||
|
||
static inline void thread_sched_jb(void) | ||
{ | ||
set_ti_thread_flag(current_thread_info(), TIF_SCHED_JB); | ||
|
||
if (test_ti_thread_flag(current_thread_info(), TIF_HOST_THREAD)) { | ||
set_current_state(TASK_UNINTERRUPTIBLE); | ||
lkl_ops->jmp_buf_set(¤t_thread_info()->sched_jb, | ||
schedule); | ||
} else { | ||
lkl_ops->jmp_buf_set(¤t_thread_info()->sched_jb, | ||
lkl_idle_tail_schedule); | ||
} | ||
} | ||
|
||
static inline void thread_set_sched_exit(void) | ||
{ | ||
set_ti_thread_flag(current_thread_info(), TIF_SCHED_EXIT); | ||
} | ||
|
||
void switch_to_host_task(struct task_struct *); | ||
|
||
#endif /* _ASM_LKL_SCHED_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef _LKL_LIB_JMP_BUF_H | ||
#define _LKL_LIB_JMP_BUF_H | ||
|
||
int jmp_buf_set(struct lkl_jmp_buf *jmpb); | ||
void jmp_buf_set(struct lkl_jmp_buf *jmpb, void (*f)(void)); | ||
void jmp_buf_longjmp(struct lkl_jmp_buf *jmpb, int val); | ||
|
||
#endif |