Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  S390 version
0004  *    Copyright IBM Corp. 2002, 2006
0005  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
0006  */
0007 
0008 #ifndef _ASM_THREAD_INFO_H
0009 #define _ASM_THREAD_INFO_H
0010 
0011 #include <linux/bits.h>
0012 
0013 /*
0014  * General size of kernel stacks
0015  */
0016 #ifdef CONFIG_KASAN
0017 #define THREAD_SIZE_ORDER 4
0018 #else
0019 #define THREAD_SIZE_ORDER 2
0020 #endif
0021 #define BOOT_STACK_SIZE (PAGE_SIZE << 2)
0022 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
0023 
0024 #ifndef __ASSEMBLY__
0025 #include <asm/lowcore.h>
0026 #include <asm/page.h>
0027 
0028 #define STACK_INIT_OFFSET \
0029     (THREAD_SIZE - STACK_FRAME_OVERHEAD - sizeof(struct pt_regs))
0030 
0031 /*
0032  * low level task data that entry.S needs immediate access to
0033  * - this struct should fit entirely inside of one cache line
0034  * - this struct shares the supervisor stack pages
0035  * - if the contents of this structure are changed, the assembly constants must also be changed
0036  */
0037 struct thread_info {
0038     unsigned long       flags;      /* low level flags */
0039     unsigned long       syscall_work;   /* SYSCALL_WORK_ flags */
0040     unsigned int        cpu;        /* current CPU */
0041 };
0042 
0043 /*
0044  * macros/functions for gaining access to the thread information structure
0045  */
0046 #define INIT_THREAD_INFO(tsk)           \
0047 {                       \
0048     .flags      = 0,            \
0049 }
0050 
0051 struct task_struct;
0052 
0053 void arch_release_task_struct(struct task_struct *tsk);
0054 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
0055 
0056 void arch_setup_new_exec(void);
0057 #define arch_setup_new_exec arch_setup_new_exec
0058 
0059 #endif
0060 
0061 /*
0062  * thread information flags bit numbers
0063  */
0064 /* _TIF_WORK bits */
0065 #define TIF_NOTIFY_RESUME   0   /* callback before returning to user */
0066 #define TIF_SIGPENDING      1   /* signal pending */
0067 #define TIF_NEED_RESCHED    2   /* rescheduling necessary */
0068 #define TIF_UPROBE      3   /* breakpointed or single-stepping */
0069 #define TIF_GUARDED_STORAGE 4   /* load guarded storage control block */
0070 #define TIF_PATCH_PENDING   5   /* pending live patching update */
0071 #define TIF_PGSTE       6   /* New mm's will use 4K page tables */
0072 #define TIF_NOTIFY_SIGNAL   7   /* signal notifications exist */
0073 #define TIF_ISOLATE_BP      8   /* Run process with isolated BP */
0074 #define TIF_ISOLATE_BP_GUEST    9   /* Run KVM guests with isolated BP */
0075 #define TIF_PER_TRAP        10  /* Need to handle PER trap on exit to usermode */
0076 
0077 #define TIF_31BIT       16  /* 32bit process */
0078 #define TIF_MEMDIE      17  /* is terminating due to OOM killer */
0079 #define TIF_RESTORE_SIGMASK 18  /* restore signal mask in do_signal() */
0080 #define TIF_SINGLE_STEP     19  /* This task is single stepped */
0081 #define TIF_BLOCK_STEP      20  /* This task is block stepped */
0082 #define TIF_UPROBE_SINGLESTEP   21  /* This task is uprobe single stepped */
0083 
0084 /* _TIF_TRACE bits */
0085 #define TIF_SYSCALL_TRACE   24  /* syscall trace active */
0086 #define TIF_SYSCALL_AUDIT   25  /* syscall auditing active */
0087 #define TIF_SECCOMP     26  /* secure computing */
0088 #define TIF_SYSCALL_TRACEPOINT  27  /* syscall tracepoint instrumentation */
0089 
0090 #define _TIF_NOTIFY_RESUME  BIT(TIF_NOTIFY_RESUME)
0091 #define _TIF_NOTIFY_SIGNAL  BIT(TIF_NOTIFY_SIGNAL)
0092 #define _TIF_SIGPENDING     BIT(TIF_SIGPENDING)
0093 #define _TIF_NEED_RESCHED   BIT(TIF_NEED_RESCHED)
0094 #define _TIF_UPROBE     BIT(TIF_UPROBE)
0095 #define _TIF_GUARDED_STORAGE    BIT(TIF_GUARDED_STORAGE)
0096 #define _TIF_PATCH_PENDING  BIT(TIF_PATCH_PENDING)
0097 #define _TIF_ISOLATE_BP     BIT(TIF_ISOLATE_BP)
0098 #define _TIF_ISOLATE_BP_GUEST   BIT(TIF_ISOLATE_BP_GUEST)
0099 #define _TIF_PER_TRAP       BIT(TIF_PER_TRAP)
0100 
0101 #define _TIF_31BIT      BIT(TIF_31BIT)
0102 #define _TIF_SINGLE_STEP    BIT(TIF_SINGLE_STEP)
0103 
0104 #define _TIF_SYSCALL_TRACE  BIT(TIF_SYSCALL_TRACE)
0105 #define _TIF_SYSCALL_AUDIT  BIT(TIF_SYSCALL_AUDIT)
0106 #define _TIF_SECCOMP        BIT(TIF_SECCOMP)
0107 #define _TIF_SYSCALL_TRACEPOINT BIT(TIF_SYSCALL_TRACEPOINT)
0108 
0109 #endif /* _ASM_THREAD_INFO_H */