Goodbye mips64. 31704 lines of code bite the dust.
[linux-2.6/linux-mips.git] / include / asm-s390 / thread_info.h
blob1e9a320899bb0904ec5d11aef0cd9fd85c9a3a6e
1 /*
2 * include/asm-s390/thread_info.h
4 * S390 version
5 * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
7 */
9 #ifndef _ASM_THREAD_INFO_H
10 #define _ASM_THREAD_INFO_H
12 #ifdef __KERNEL__
14 #ifndef __ASSEMBLY__
15 #include <asm/processor.h>
16 #include <asm/lowcore.h>
19 * low level task data that entry.S needs immediate access to
20 * - this struct should fit entirely inside of one cache line
21 * - this struct shares the supervisor stack pages
22 * - if the contents of this structure are changed, the assembly constants must also be changed
24 struct thread_info {
25 struct task_struct *task; /* main task structure */
26 struct exec_domain *exec_domain; /* execution domain */
27 unsigned long flags; /* low level flags */
28 unsigned int cpu; /* current CPU */
29 unsigned int preempt_count; /* 0 => preemptable */
30 struct restart_block restart_block;
34 * macros/functions for gaining access to the thread information structure
36 #define INIT_THREAD_INFO(tsk) \
37 { \
38 .task = &tsk, \
39 .exec_domain = &default_exec_domain, \
40 .flags = 0, \
41 .cpu = 0, \
42 .restart_block = { \
43 .fn = do_no_restart_syscall, \
44 }, \
47 #define init_thread_info (init_thread_union.thread_info)
48 #define init_stack (init_thread_union.stack)
51 * Size of kernel stack for each process
53 #ifndef __s390x__
54 #define THREAD_ORDER 1
55 #define ASYNC_ORDER 1
56 #else /* __s390x__ */
57 #define THREAD_ORDER 2
58 #define ASYNC_ORDER 2
59 #endif /* __s390x__ */
61 #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
62 #define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER)
64 /* how to get the thread information struct from C */
65 static inline struct thread_info *current_thread_info(void)
67 return (struct thread_info *)((*(unsigned long *) __LC_KERNEL_STACK)-THREAD_SIZE);
70 /* thread information allocation */
71 #define alloc_thread_info(tsk) ((struct thread_info *) \
72 __get_free_pages(GFP_KERNEL,THREAD_ORDER))
73 #define free_thread_info(ti) free_pages((unsigned long) (ti),THREAD_ORDER)
74 #define get_thread_info(ti) get_task_struct((ti)->task)
75 #define put_thread_info(ti) put_task_struct((ti)->task)
77 #endif
80 * thread information flags bit numbers
82 #define TIF_SYSCALL_TRACE 0 /* syscall trace active */
83 #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
84 #define TIF_SIGPENDING 2 /* signal pending */
85 #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
86 #define TIF_RESTART_SVC 4 /* restart svc with new svc number */
87 #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
88 #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
89 TIF_NEED_RESCHED */
90 #define TIF_31BIT 18 /* 32bit process */
92 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
93 #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
94 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
95 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
96 #define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC)
97 #define _TIF_USEDFPU (1<<TIF_USEDFPU)
98 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
99 #define _TIF_31BIT (1<<TIF_31BIT)
101 #endif /* __KERNEL__ */
103 #define PREEMPT_ACTIVE 0x4000000
105 #endif /* _ASM_THREAD_INFO_H */