Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * S390 version |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 3 | * Copyright IBM Corp. 2002, 2006 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) |
| 5 | */ |
| 6 | |
| 7 | #ifndef _ASM_THREAD_INFO_H |
| 8 | #define _ASM_THREAD_INFO_H |
| 9 | |
Heiko Carstens | 92778b9 | 2015-10-06 16:23:39 +0200 | [diff] [blame] | 10 | #include <linux/const.h> |
| 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | /* |
| 13 | * Size of kernel stack for each process |
| 14 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #define THREAD_ORDER 2 |
| 16 | #define ASYNC_ORDER 2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
| 18 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) |
| 19 | #define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER) |
| 20 | |
| 21 | #ifndef __ASSEMBLY__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include <asm/lowcore.h> |
Christian Ehrhardt | 25097bf | 2009-04-14 15:36:16 +0200 | [diff] [blame] | 23 | #include <asm/page.h> |
| 24 | #include <asm/processor.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
| 26 | /* |
| 27 | * low level task data that entry.S needs immediate access to |
| 28 | * - this struct should fit entirely inside of one cache line |
| 29 | * - this struct shares the supervisor stack pages |
| 30 | * - if the contents of this structure are changed, the assembly constants must also be changed |
| 31 | */ |
| 32 | struct thread_info { |
| 33 | struct task_struct *task; /* main task structure */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | unsigned long flags; /* low level flags */ |
Martin Schwidefsky | 6164988 | 2013-04-24 12:58:39 +0200 | [diff] [blame] | 35 | unsigned long sys_call_table; /* System call table address */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | unsigned int cpu; /* current CPU */ |
Jesper Juhl | dcd497f | 2005-06-23 00:09:07 -0700 | [diff] [blame] | 37 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
Martin Schwidefsky | 20b40a7 | 2011-10-30 15:16:47 +0100 | [diff] [blame] | 38 | unsigned int system_call; |
Martin Schwidefsky | aa5e97c | 2008-12-31 15:11:39 +0100 | [diff] [blame] | 39 | __u64 user_timer; |
| 40 | __u64 system_timer; |
Martin Schwidefsky | 86f2552 | 2010-05-17 10:00:05 +0200 | [diff] [blame] | 41 | unsigned long last_break; /* last breaking-event-address. */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | /* |
| 45 | * macros/functions for gaining access to the thread information structure |
| 46 | */ |
| 47 | #define INIT_THREAD_INFO(tsk) \ |
| 48 | { \ |
| 49 | .task = &tsk, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | .flags = 0, \ |
| 51 | .cpu = 0, \ |
Peter Zijlstra | c99e6ef | 2009-07-10 14:57:56 +0200 | [diff] [blame] | 52 | .preempt_count = INIT_PREEMPT_COUNT, \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | #define init_thread_info (init_thread_union.thread_info) |
| 56 | #define init_stack (init_thread_union.stack) |
| 57 | |
| 58 | /* how to get the thread information struct from C */ |
| 59 | static inline struct thread_info *current_thread_info(void) |
| 60 | { |
Martin Schwidefsky | 6432c01 | 2011-01-05 12:47:42 +0100 | [diff] [blame] | 61 | return (struct thread_info *) S390_lowcore.thread_info; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | } |
| 63 | |
Heiko Carstens | 2a5e91c | 2015-03-16 12:46:38 +0100 | [diff] [blame] | 64 | void arch_release_task_struct(struct task_struct *tsk); |
Heiko Carstens | 521b00c | 2016-05-07 12:15:21 +0200 | [diff] [blame] | 65 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); |
Heiko Carstens | 2a5e91c | 2015-03-16 12:46:38 +0100 | [diff] [blame] | 66 | |
FUJITA Tomonori | b69c49b | 2008-07-25 01:45:40 -0700 | [diff] [blame] | 67 | #define THREAD_SIZE_ORDER THREAD_ORDER |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
| 69 | #endif |
| 70 | |
| 71 | /* |
| 72 | * thread information flags bit numbers |
| 73 | */ |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 74 | #define TIF_NOTIFY_RESUME 0 /* callback before returning to user */ |
| 75 | #define TIF_SIGPENDING 1 /* signal pending */ |
| 76 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
| 77 | #define TIF_SYSCALL_TRACE 3 /* syscall trace active */ |
| 78 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ |
| 79 | #define TIF_SECCOMP 5 /* secure computing */ |
| 80 | #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */ |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 81 | #define TIF_UPROBE 7 /* breakpointed or single-stepping */ |
Martin Schwidefsky | a1f44e7 | 2018-04-27 07:36:46 +0200 | [diff] [blame] | 82 | #define TIF_ISOLATE_BP 8 /* Run process with isolated BP */ |
| 83 | #define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */ |
Martin Schwidefsky | d3a73ac | 2014-04-15 12:55:07 +0200 | [diff] [blame] | 84 | #define TIF_31BIT 16 /* 32bit process */ |
| 85 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ |
| 86 | #define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal() */ |
| 87 | #define TIF_SINGLE_STEP 19 /* This task is single stepped */ |
| 88 | #define TIF_BLOCK_STEP 20 /* This task is block stepped */ |
Jan Willeke | 2a0a5b2 | 2014-09-22 16:39:06 +0200 | [diff] [blame] | 89 | #define TIF_UPROBE_SINGLESTEP 21 /* This task is uprobe single stepped */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
Heiko Carstens | 92778b9 | 2015-10-06 16:23:39 +0200 | [diff] [blame] | 91 | #define _TIF_NOTIFY_RESUME _BITUL(TIF_NOTIFY_RESUME) |
| 92 | #define _TIF_SIGPENDING _BITUL(TIF_SIGPENDING) |
| 93 | #define _TIF_NEED_RESCHED _BITUL(TIF_NEED_RESCHED) |
| 94 | #define _TIF_SYSCALL_TRACE _BITUL(TIF_SYSCALL_TRACE) |
| 95 | #define _TIF_SYSCALL_AUDIT _BITUL(TIF_SYSCALL_AUDIT) |
| 96 | #define _TIF_SECCOMP _BITUL(TIF_SECCOMP) |
| 97 | #define _TIF_SYSCALL_TRACEPOINT _BITUL(TIF_SYSCALL_TRACEPOINT) |
| 98 | #define _TIF_UPROBE _BITUL(TIF_UPROBE) |
Martin Schwidefsky | a1f44e7 | 2018-04-27 07:36:46 +0200 | [diff] [blame] | 99 | #define _TIF_ISOLATE_BP _BITUL(TIF_ISOLATE_BP) |
| 100 | #define _TIF_ISOLATE_BP_GUEST _BITUL(TIF_ISOLATE_BP_GUEST) |
Heiko Carstens | 92778b9 | 2015-10-06 16:23:39 +0200 | [diff] [blame] | 101 | #define _TIF_31BIT _BITUL(TIF_31BIT) |
| 102 | #define _TIF_SINGLE_STEP _BITUL(TIF_SINGLE_STEP) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | #endif /* _ASM_THREAD_INFO_H */ |