Merge with Linux 2.5.74.
[linux-2.6/linux-mips.git] / include / asm-ppc / thread_info.h
blobb3800b0cd2cb28fde4b4d4ffd26c324f00de0a4f
1 /* thread_info.h: PPC low-level thread information
2 * adapted from the i386 version by Paul Mackerras
4 * Copyright (C) 2002 David Howells (dhowells@redhat.com)
5 * - Incorporating suggestions made by Linus Torvalds and Dave Miller
6 */
8 #ifndef _ASM_THREAD_INFO_H
9 #define _ASM_THREAD_INFO_H
11 #ifdef __KERNEL__
13 #include <asm/processor.h>
15 #ifndef __ASSEMBLY__
17 * low level task data.
18 * If you change this, change the TI_* offsets below to match.
20 struct thread_info {
21 struct task_struct *task; /* main task structure */
22 struct exec_domain *exec_domain; /* execution domain */
23 unsigned long flags; /* low level flags */
24 int cpu; /* cpu we're on */
25 int preempt_count;
26 struct restart_block restart_block;
29 #define INIT_THREAD_INFO(tsk) \
30 { \
31 .task = &tsk, \
32 .exec_domain = &default_exec_domain, \
33 .flags = 0, \
34 .cpu = 0, \
35 .preempt_count = 1, \
36 .restart_block = { \
37 .fn = do_no_restart_syscall, \
38 }, \
41 #define init_thread_info (init_thread_union.thread_info)
42 #define init_stack (init_thread_union.stack)
45 * macros/functions for gaining access to the thread information structure
48 /* how to get the thread information struct from C */
49 static inline struct thread_info *current_thread_info(void)
51 struct thread_info *ti;
52 __asm__("rlwinm %0,1,0,0,18" : "=r"(ti));
53 return ti;
56 /* thread information allocation */
57 #define alloc_thread_info(tsk) ((struct thread_info *) \
58 __get_free_pages(GFP_KERNEL, 1))
59 #define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
60 #define get_thread_info(ti) get_task_struct((ti)->task)
61 #define put_thread_info(ti) put_task_struct((ti)->task)
62 #endif /* __ASSEMBLY__ */
65 * Size of kernel stack for each process.
67 #define THREAD_SIZE 8192 /* 2 pages */
70 * Offsets in thread_info structure, used in assembly code
72 #define TI_TASK 0
73 #define TI_EXECDOMAIN 4
74 #define TI_FLAGS 8
75 #define TI_CPU 12
76 #define TI_PREEMPT 16
78 #define PREEMPT_ACTIVE 0x4000000
81 * thread information flag bit numbers
83 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
84 #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
85 #define TIF_SIGPENDING 2 /* signal pending */
86 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
87 #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
88 TIF_NEED_RESCHED */
89 #define TIF_FORCE_NOERROR 5 /* don't return error from current
90 syscall even if result < 0 */
92 /* as above, but as bit values */
93 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
94 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
95 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
96 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
97 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
98 #define _TIF_FORCE_NOERROR (1<<TIF_FORCE_NOERROR)
100 #endif /* __KERNEL__ */
102 #endif /* _ASM_THREAD_INFO_H */