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 */
64 struct task_struct *task; /* main task structure */
65 unsigned long flags; /* low level flags */
66 unsigned long status; /* thread-synchronous flags */
67 __u32 cpu; /* current CPU */
68 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
69 mm_segment_t addr_limit; /* thread address space */
71 struct cpu_context cpu_context;
75 * macros/functions for gaining access to the thread information structure
77 #define INIT_THREAD_INFO(tsk) \
82 .preempt_count = INIT_PREEMPT_COUNT, \
83 .addr_limit = KERNEL_DS, \
86 /* how to get the thread information struct from C */
87 static inline struct thread_info *current_thread_info(void)
89 register unsigned long sp asm("r1");
91 return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
94 /* thread information allocation */
95 #endif /* __ASSEMBLY__ */
98 * thread information flags
99 * - these are process state flags that various assembly files may
101 * - pending work-to-be-done flags are in LSW
102 * - other flags in MSW
104 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
105 #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
106 #define TIF_SIGPENDING 2 /* signal pending */
107 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
108 /* restore singlestep on return to user mode */
109 #define TIF_SINGLESTEP 4
110 #define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */
111 #define TIF_MEMDIE 6 /* is terminating due to OOM killer */
112 #define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */
113 #define TIF_SECCOMP 10 /* secure computing */
115 /* true if poll_idle() is polling TIF_NEED_RESCHED */
116 #define TIF_POLLING_NRFLAG 16
118 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
119 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
120 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
121 #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
122 #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
123 #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
124 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
125 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
126 #define _TIF_SECCOMP (1 << TIF_SECCOMP)
128 /* work to do in syscall trace */
129 #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
130 _TIF_SYSCALL_AUDIT | _TIF_SECCOMP)
132 /* work to do on interrupt/exception return */
133 #define _TIF_WORK_MASK 0x0000FFFE
135 /* work to do on any return to u-space */
136 #define _TIF_ALLWORK_MASK 0x0000FFFF
139 * Thread-synchronous status.
141 * This is different from the flags in that nobody else
142 * ever touches our thread-synchronous status, so we don't
143 * have to worry about atomic accesses.
145 /* FPU was used by this task this quantum (SMP) */
146 #define TS_USEDFPU 0x0001
148 #endif /* __KERNEL__ */
149 #endif /* _ASM_MICROBLAZE_THREAD_INFO_H */