]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/asm-frv/thread_info.h
remove unused TIF_NOTIFY_RESUME flag
[net-next-2.6.git] / include / asm-frv / thread_info.h
CommitLineData
1da177e4
LT
1/* thread_info.h: description
2 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 * Derived from include/asm-i386/thread_info.h
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _ASM_THREAD_INFO_H
14#define _ASM_THREAD_INFO_H
15
16#ifdef __KERNEL__
17
18#ifndef __ASSEMBLY__
19#include <asm/processor.h>
20#endif
21
84e8cd6d
DH
22#define THREAD_SIZE 8192
23
1da177e4
LT
24/*
25 * low level task data that entry.S needs immediate access to
26 * - this struct should fit entirely inside of one cache line
27 * - this struct shares the supervisor stack pages
28 * - if the contents of this structure are changed, the assembly constants must also be changed
29 */
30#ifndef __ASSEMBLY__
31
32struct thread_info {
33 struct task_struct *task; /* main task structure */
34 struct exec_domain *exec_domain; /* execution domain */
35 unsigned long flags; /* low level flags */
36 unsigned long status; /* thread-synchronous flags */
37 __u32 cpu; /* current CPU */
dcd497f9 38 int preempt_count; /* 0 => preemptable, <0 => BUG */
1da177e4
LT
39
40 mm_segment_t addr_limit; /* thread address space:
41 0-0xBFFFFFFF for user-thead
42 0-0xFFFFFFFF for kernel-thread
43 */
44 struct restart_block restart_block;
45
46 __u8 supervisor_stack[0];
47};
48
49#else /* !__ASSEMBLY__ */
50
84e8cd6d 51#include <asm/asm-offsets.h>
1da177e4
LT
52
53#endif
54
8080f231 55#define PREEMPT_ACTIVE 0x10000000
1da177e4
LT
56
57/*
58 * macros/functions for gaining access to the thread information structure
59 *
60 * preempt_count needs to be 1 initially, until the scheduler is functional.
61 */
62#ifndef __ASSEMBLY__
63
64#define INIT_THREAD_INFO(tsk) \
65{ \
66 .task = &tsk, \
67 .exec_domain = &default_exec_domain, \
68 .flags = 0, \
69 .cpu = 0, \
70 .preempt_count = 1, \
71 .addr_limit = KERNEL_DS, \
72 .restart_block = { \
73 .fn = do_no_restart_syscall, \
74 }, \
75}
76
77#define init_thread_info (init_thread_union.thread_info)
78#define init_stack (init_thread_union.stack)
79
1da177e4
LT
80/* how to get the thread information struct from C */
81register struct thread_info *__current_thread_info asm("gr15");
82
83#define current_thread_info() ({ __current_thread_info; })
84
85/* thread information allocation */
86#ifdef CONFIG_DEBUG_STACK_USAGE
87#define alloc_thread_info(tsk) \
88 ({ \
89 struct thread_info *ret; \
90 \
91 ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \
92 if (ret) \
93 memset(ret, 0, THREAD_SIZE); \
94 ret; \
95 })
96#else
97#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
98#endif
99
100#define free_thread_info(info) kfree(info)
1da177e4 101
84e8cd6d 102#endif /* __ASSEMBLY__ */
1da177e4
LT
103
104/*
105 * thread information flags
106 * - these are process state flags that various assembly files may need to access
107 * - pending work-to-be-done flags are in LSW
108 * - other flags in MSW
109 */
110#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
a583f1b5
SE
111#define TIF_SIGPENDING 1 /* signal pending */
112#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
113#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
114#define TIF_IRET 4 /* return with iret */
115#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
1da177e4
LT
116#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
117#define TIF_MEMDIE 17 /* OOM killer killed process */
8a102eed 118#define TIF_FREEZE 18 /* freezing for suspend */
1da177e4
LT
119
120#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
1da177e4
LT
121#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
122#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
123#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
124#define _TIF_IRET (1 << TIF_IRET)
a411aee9 125#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
1da177e4 126#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
8a102eed 127#define _TIF_FREEZE (1 << TIF_FREEZE)
1da177e4
LT
128
129#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
130#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
131
132/*
133 * Thread-synchronous status.
134 *
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.
138 */
139#define TS_USEDFPM 0x0001 /* FPU/Media was used by this task this quantum (SMP) */
140
141#endif /* __KERNEL__ */
142
143#endif /* _ASM_THREAD_INFO_H */