1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Thread support for the Hexagon architecture
5 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
8 #ifndef _ASM_THREAD_INFO_H
9 #define _ASM_THREAD_INFO_H
14 #include <asm/processor.h>
15 #include <asm/registers.h>
19 #define THREAD_SHIFT 12
20 #define THREAD_SIZE (1<<THREAD_SHIFT)
21 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
30 * This is union'd with the "bottom" of the kernel stack.
31 * It keeps track of thread info which is handy for routines
36 struct task_struct
*task
; /* main task structure */
37 unsigned long flags
; /* low level flags */
38 __u32 cpu
; /* current cpu */
39 int preempt_count
; /* 0=>preemptible,<0=>BUG */
40 mm_segment_t addr_limit
; /* segmentation sux */
42 * used for syscalls somehow;
43 * seems to have a function pointer and four arguments
45 /* Points to the current pt_regs frame */
48 * saved kernel sp at switch_to time;
49 * not sure if this is used (it's not in the VM model it seems;
55 #else /* !__ASSEMBLY__ */
57 #include <asm/asm-offsets.h>
59 #endif /* __ASSEMBLY__ */
63 #define INIT_THREAD_INFO(tsk) \
69 .addr_limit = KERNEL_DS, \
74 /* Tacky preprocessor trickery */
75 #define qqstr(s) qstr(s)
77 #define QUOTED_THREADINFO_REG qqstr(THREADINFO_REG)
79 register struct thread_info
*__current_thread_info
asm(QUOTED_THREADINFO_REG
);
80 #define current_thread_info() __current_thread_info
82 #endif /* __ASSEMBLY__ */
85 * thread information flags
86 * - these are process state flags that various assembly files
88 * - pending work-to-be-done flags are in LSW
89 * - other flags in MSW
92 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
93 #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
94 #define TIF_SIGPENDING 2 /* signal pending */
95 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
96 #define TIF_SINGLESTEP 4 /* restore ss @ return to usr mode */
97 #define TIF_RESTORE_SIGMASK 6 /* restore sig mask in do_signal() */
98 /* true if poll_idle() is polling TIF_NEED_RESCHED */
99 #define TIF_MEMDIE 17 /* OOM killer killed process */
101 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
102 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
103 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
104 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
105 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
107 /* work to do on interrupt/exception return - All but TIF_SYSCALL_TRACE */
108 #define _TIF_WORK_MASK (0x0000FFFF & ~_TIF_SYSCALL_TRACE)
110 /* work to do on any return to u-space */
111 #define _TIF_ALLWORK_MASK 0x0000FFFF
113 #endif /* __KERNEL__ */