1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2006 Atmark Techno, Inc.
6 #ifndef _ASM_MICROBLAZE_THREAD_INFO_H
7 #define _ASM_MICROBLAZE_THREAD_INFO_H
11 /* we have 8k stack */
12 #define THREAD_SHIFT 13
13 #define THREAD_SIZE (1 << THREAD_SHIFT)
14 #define THREAD_SIZE_ORDER 1
17 # include <linux/types.h>
18 # include <asm/processor.h>
21 * low level task data that entry.S needs immediate access to
22 * - this struct should fit entirely inside of one cache line
23 * - this struct shares the supervisor stack pages
24 * - if the contents of this structure are changed, the assembly constants
25 * must also be changed
29 __u32 r1; /* stack pointer */
31 /* dedicated registers */
38 /* non-volatile registers */
51 /* r31 is used as current task pointer */
52 /* special purpose registers */
60 struct task_struct *task; /* main task structure */
61 unsigned long flags; /* low level flags */
62 unsigned long status; /* thread-synchronous flags */
63 __u32 cpu; /* current CPU */
64 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
66 struct cpu_context cpu_context;
70 * macros/functions for gaining access to the thread information structure
72 #define INIT_THREAD_INFO(tsk) \
77 .preempt_count = INIT_PREEMPT_COUNT, \
80 /* how to get the thread information struct from C */
81 static inline struct thread_info *current_thread_info(void)
83 register unsigned long sp asm("r1");
85 return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
88 /* thread information allocation */
89 #endif /* __ASSEMBLY__ */
92 * thread information flags
93 * - these are process state flags that various assembly files may
95 * - pending work-to-be-done flags are in LSW
96 * - other flags in MSW
98 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
99 #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
100 #define TIF_SIGPENDING 2 /* signal pending */
101 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
102 /* restore singlestep on return to user mode */
103 #define TIF_SINGLESTEP 4
104 #define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */
105 #define TIF_MEMDIE 6 /* is terminating due to OOM killer */
106 #define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */
107 #define TIF_SECCOMP 10 /* secure computing */
109 /* true if poll_idle() is polling TIF_NEED_RESCHED */
110 #define TIF_POLLING_NRFLAG 16
112 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
113 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
114 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
115 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
116 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
117 #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
118 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
119 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
120 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
122 /* work to do in syscall trace */
123 #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
124 _TIF_SYSCALL_AUDIT | _TIF_SECCOMP)
126 /* work to do on interrupt/exception return */
127 #define _TIF_WORK_MASK 0x0000FFFE
129 /* work to do on any return to u-space */
130 #define _TIF_ALLWORK_MASK 0x0000FFFF
133 * Thread-synchronous status.
135 * This is different from the flags in that nobody else
136 * ever touches our thread-synchronous status, so we don't
137 * have to worry about atomic accesses.
139 /* FPU was used by this task this quantum (SMP) */
140 #define TS_USEDFPU 0x0001
142 #endif /* __KERNEL__ */
143 #endif /* _ASM_MICROBLAZE_THREAD_INFO_H */