2019-08-25 10:49:19 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2008-02-04 22:30:54 -08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
2005-04-16 15:20:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UM_THREAD_INFO_H
|
|
|
|
#define __UM_THREAD_INFO_H
|
|
|
|
|
2018-01-02 15:12:01 +00:00
|
|
|
#define THREAD_SIZE_ORDER CONFIG_KERNEL_STACK_ORDER
|
|
|
|
#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)
|
|
|
|
|
2025-03-14 08:10:06 +01:00
|
|
|
#ifndef __ASSEMBLER__
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
#include <asm/types.h>
|
uml: header untangling
Untangle UML headers somewhat and add some includes where they were
needed explicitly, but gotten accidentally via some other header.
arch/um/include/um_uaccess.h loses asm/fixmap.h because it uses no
fixmap stuff and gains elf.h, because it needs FIXADDR_USER_*, and
archsetjmp.h, because it needs jmp_buf.
pmd_alloc_one is uninlined because it needs mm_struct, and that's
inconvenient to provide in asm-um/pgtable-3level.h.
elf_core_copy_fpregs is also uninlined from elf-i386.h and
elf-x86_64.h, which duplicated the code anyway, to
arch/um/kernel/process.c, so that the reference to current_thread
doesn't pull sched.h or anything related into asm/elf.h.
arch/um/sys-i386/ldt.c, arch/um/kernel/tlb.c and
arch/um/kernel/skas/uaccess.c got sched.h because they dereference
task_structs. Its includes of linux and asm headers got turned from
"" to <>.
arch/um/sys-i386/bug.c gets asm/errno.h because it needs errno
constants.
asm/elf-i386 gets asm/user.h because it needs user_regs_struct.
asm/fixmap.h gets page.h because it needs PAGE_SIZE and PAGE_MASK and
system.h for BUG_ON.
asm/pgtable doesn't need sched.h.
asm/processor-generic.h defined mm_segment_t, but didn't use it. So,
that definition is moved to uaccess.h, which defines a bunch of
mm_segment_t-related stuff. thread_info.h uses mm_segment_t, and
includes uaccess.h, which causes a recursion. So, the definition is
placed above the include of thread_info. in uaccess.h. thread_info.h
also gets page.h because it needs PAGE_SIZE.
ObCheckpatchViolationJustification - I'm not adding a typedef; I'm
moving mm_segment_t from one place to another.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-04 22:30:53 -08:00
|
|
|
#include <asm/page.h>
|
2015-05-12 00:17:28 +02:00
|
|
|
#include <asm/segment.h>
|
2017-07-29 17:03:23 +02:00
|
|
|
#include <sysdep/ptrace_user.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
struct thread_info {
|
|
|
|
unsigned long flags; /* low level flags */
|
|
|
|
__u32 cpu; /* current CPU */
|
2005-06-23 00:09:07 -07:00
|
|
|
int preempt_count; /* 0 => preemptable,
|
2005-04-16 15:20:36 -07:00
|
|
|
<0 => BUG */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define INIT_THREAD_INFO(tsk) \
|
|
|
|
{ \
|
2006-03-31 02:30:15 -08:00
|
|
|
.flags = 0, \
|
|
|
|
.cpu = 0, \
|
2009-07-10 14:57:56 +02:00
|
|
|
.preempt_count = INIT_PREEMPT_COUNT, \
|
2005-04-16 15:20:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
|
|
|
|
#define TIF_SIGPENDING 1 /* signal pending */
|
|
|
|
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
|
2020-10-09 15:47:28 -06:00
|
|
|
#define TIF_NOTIFY_SIGNAL 3 /* signal notifications exist */
|
2010-05-14 11:13:27 +02:00
|
|
|
#define TIF_RESTART_BLOCK 4
|
|
|
|
#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
|
2005-05-03 07:54:51 +01:00
|
|
|
#define TIF_SYSCALL_AUDIT 6
|
2006-01-18 17:44:02 -08:00
|
|
|
#define TIF_RESTORE_SIGMASK 7
|
2012-04-24 02:37:07 -04:00
|
|
|
#define TIF_NOTIFY_RESUME 8
|
2015-12-29 21:35:47 +01:00
|
|
|
#define TIF_SECCOMP 9 /* secure computing */
|
2022-04-26 16:30:17 -05:00
|
|
|
#define TIF_SINGLESTEP 10 /* single stepping userspace */
|
2025-07-03 14:38:55 +02:00
|
|
|
#define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
|
|
|
|
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
|
|
|
|
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
|
2020-10-09 15:47:28 -06:00
|
|
|
#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
|
2005-05-03 07:54:51 +01:00
|
|
|
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
|
|
|
|
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
|
2025-07-04 14:34:47 +02:00
|
|
|
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
2015-12-29 21:35:47 +01:00
|
|
|
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
|
2022-04-26 16:30:17 -05:00
|
|
|
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2025-07-04 14:34:47 +02:00
|
|
|
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL | \
|
|
|
|
_TIF_NOTIFY_RESUME)
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
#endif
|