Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / score / include / asm / thread_info.h
blobbc4c7c90550fe182ed367bc3c4c95b745b2905b6
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_SCORE_THREAD_INFO_H
3 #define _ASM_SCORE_THREAD_INFO_H
5 #ifdef __KERNEL__
7 #define KU_MASK 0x08
8 #define KU_USER 0x08
9 #define KU_KERN 0x00
11 #include <asm/page.h>
12 #include <linux/const.h>
14 /* thread information allocation */
15 #define THREAD_SIZE_ORDER (1)
16 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
17 #define THREAD_MASK (THREAD_SIZE - _AC(1,UL))
19 #ifndef __ASSEMBLY__
21 #include <asm/processor.h>
24 * low level task data that entry.S needs immediate access to
25 * - this struct should fit entirely inside of one cache line
26 * - this struct shares the supervisor stack pages
27 * - if the contents of this structure are changed, the assembly constants
28 * must also be changed
30 struct thread_info {
31 struct task_struct *task; /* main task structure */
32 unsigned long flags; /* low level flags */
33 unsigned long tp_value; /* thread pointer */
34 __u32 cpu; /* current CPU */
36 /* 0 => preemptable, < 0 => BUG */
37 int preempt_count;
40 * thread address space:
41 * 0-0xBFFFFFFF for user-thead
42 * 0-0xFFFFFFFF for kernel-thread
44 mm_segment_t addr_limit;
45 struct pt_regs *regs;
49 * macros/functions for gaining access to the thread information structure
51 * preempt_count needs to be 1 initially, until the scheduler is functional.
53 #define INIT_THREAD_INFO(tsk) \
54 { \
55 .task = &tsk, \
56 .cpu = 0, \
57 .preempt_count = 1, \
58 .addr_limit = KERNEL_DS, \
61 /* How to get the thread information struct from C. */
62 register struct thread_info *__current_thread_info __asm__("r28");
63 #define current_thread_info() __current_thread_info
65 #endif /* !__ASSEMBLY__ */
68 * thread information flags
69 * - these are process state flags that various assembly files may need to
70 * access
71 * - pending work-to-be-done flags are in LSW
72 * - other flags in MSW
74 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
75 #define TIF_SIGPENDING 1 /* signal pending */
76 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
77 #define TIF_NOTIFY_RESUME 5 /* callback before returning to user */
78 #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
79 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */
81 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
82 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
83 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
84 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
86 #define _TIF_WORK_MASK (0x0000ffff)
88 #endif /* __KERNEL__ */
90 #endif /* _ASM_SCORE_THREAD_INFO_H */