forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththread_info.h
More file actions
72 lines (58 loc) · 1.7 KB
/
thread_info.h
File metadata and controls
72 lines (58 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef _ASM_LKL_THREAD_INFO_H
#define _ASM_LKL_THREAD_INFO_H
#define THREAD_SIZE (4096)
#ifndef __ASSEMBLY__
#include <asm/types.h>
#include <asm/processor.h>
#include <asm/host_ops.h>
typedef struct {
unsigned long seg;
} mm_segment_t;
struct thread_info {
struct task_struct *task;
unsigned long flags;
int preempt_count;
mm_segment_t addr_limit;
struct lkl_sem *sched_sem;
struct lkl_jmp_buf sched_jb;
bool dead;
lkl_thread_t tid;
struct task_struct *prev_sched;
unsigned long stackend;
};
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
.preempt_count = INIT_PREEMPT_COUNT, \
.flags = 0, \
.addr_limit = KERNEL_DS, \
}
#define init_thread_info (init_thread_union.thread_info)
#define init_stack (init_thread_union.stack)
/* how to get the thread information struct from C */
extern struct thread_info *_current_thread_info;
static inline struct thread_info *current_thread_info(void)
{
return _current_thread_info;
}
/* thread information allocation */
unsigned long *alloc_thread_stack_node(struct task_struct *, int node);
void free_thread_stack(struct task_struct *tsk);
void threads_init(void);
void threads_cleanup(void);
#define TIF_SYSCALL_TRACE 0
#define TIF_NOTIFY_RESUME 1
#define TIF_SIGPENDING 2
#define TIF_NEED_RESCHED 3
#define TIF_RESTORE_SIGMASK 4
#define TIF_MEMDIE 5
#define TIF_NOHZ 6
#define TIF_SCHED_JB 7
#define TIF_HOST_THREAD 8
#define __HAVE_THREAD_FUNCTIONS
#define task_thread_info(task) ((struct thread_info *)(task)->stack)
#define task_stack_page(task) ((task)->stack)
void setup_thread_stack(struct task_struct *p, struct task_struct *org);
#define end_of_stack(p) (&task_thread_info(p)->stackend)
#endif /* __ASSEMBLY__ */
#endif