blob: c980a02a52bc0dda0a23b205f59d1d86438553f2 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _ASM_PARISC_THREAD_INFO_H
3#define _ASM_PARISC_THREAD_INFO_H
4
5#ifdef __KERNEL__
6
7#ifndef __ASSEMBLY__
8#include <asm/processor.h>
David Howells527dcdc2012-03-28 18:30:02 +01009#include <asm/special_insns.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11struct thread_info {
12 struct task_struct *task; /* main task structure */
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 unsigned long flags; /* thread_info flags (see TIF_*) */
14 mm_segment_t addr_limit; /* user-level address space limit */
15 __u32 cpu; /* current CPU */
Jesper Juhldcd497f2005-06-23 00:09:07 -070016 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
Linus Torvalds1da177e2005-04-16 15:20:36 -070017};
18
19#define INIT_THREAD_INFO(tsk) \
20{ \
21 .task = &tsk, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 .flags = 0, \
23 .cpu = 0, \
24 .addr_limit = KERNEL_DS, \
Peter Zijlstrac99e6ef2009-07-10 14:57:56 +020025 .preempt_count = INIT_PREEMPT_COUNT, \
Linus Torvalds1da177e2005-04-16 15:20:36 -070026}
27
28#define init_thread_info (init_thread_union.thread_info)
29#define init_stack (init_thread_union.stack)
30
Tim Abbottf32ed392009-09-27 17:25:08 -040031/* how to get the thread information struct from C */
32#define current_thread_info() ((struct thread_info *)mfctl(30))
33
34#endif /* !__ASSEMBLY */
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036/* thread information allocation */
37
Helge Deller8f8201d2017-07-31 08:38:27 +020038#define THREAD_SIZE_ORDER 3 /* PA-RISC requires at least 32k stack */
Linus Torvalds1da177e2005-04-16 15:20:36 -070039/* Be sure to hunt all references to this down when you change the size of
40 * the kernel stack */
FUJITA Tomonorib69c49b2008-07-25 01:45:40 -070041#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
42#define THREAD_SHIFT (PAGE_SHIFT + THREAD_SIZE_ORDER)
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Linus Torvalds1da177e2005-04-16 15:20:36 -070044/*
45 * thread information flags
46 */
47#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
Stephane Eraniana583f1b2007-07-31 00:38:00 -070048#define TIF_SIGPENDING 1 /* signal pending */
49#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
50#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
51#define TIF_32BIT 4 /* 32 bit binary */
Andreas Dilger0ddc9322010-05-14 11:13:27 +020052#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
Helge Deller527973c2013-10-15 19:25:46 +020053#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
David Howellsd0420c82009-09-02 09:14:16 +010054#define TIF_NOTIFY_RESUME 8 /* callback before returning to user */
Kyle McMartinecd3d4b2009-09-27 23:03:02 -040055#define TIF_SINGLESTEP 9 /* single stepping? */
56#define TIF_BLOCKSTEP 10 /* branch stepping? */
Helge Dellerc90f0692014-08-27 14:39:56 +020057#define TIF_SECCOMP 11 /* secure computing */
Helge Dellerfc791682016-04-13 22:44:54 +020058#define TIF_SYSCALL_TRACEPOINT 12 /* syscall tracepoint instrumentation */
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
60#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
62#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
63#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
64#define _TIF_32BIT (1 << TIF_32BIT)
Helge Deller527973c2013-10-15 19:25:46 +020065#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
David Howellsd0420c82009-09-02 09:14:16 +010066#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
Kyle McMartinecd3d4b2009-09-27 23:03:02 -040067#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
68#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
Helge Dellerc90f0692014-08-27 14:39:56 +020069#define _TIF_SECCOMP (1 << TIF_SECCOMP)
Helge Dellerfc791682016-04-13 22:44:54 +020070#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
David Howellsd0420c82009-09-02 09:14:16 +010072#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
Al Viro6fd84c02012-05-23 15:28:58 -040073 _TIF_NEED_RESCHED)
Al Viro64482bd2012-05-20 11:59:03 -040074#define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
Helge Dellerc90f0692014-08-27 14:39:56 +020075 _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \
Helge Dellerfc791682016-04-13 22:44:54 +020076 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Helge Deller9dabf602014-01-31 22:19:52 +010078#ifdef CONFIG_64BIT
79# ifdef CONFIG_COMPAT
80# define is_32bit_task() (test_thread_flag(TIF_32BIT))
81# else
82# define is_32bit_task() (0)
83# endif
84#else
85# define is_32bit_task() (1)
86#endif
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088#endif /* __KERNEL__ */
89
90#endif /* _ASM_PARISC_THREAD_INFO_H */