/* SPDX-License-Identifier: GPL-2.0 */ /* thread_info.h: MIPS low-level thread information * * Copyright (C) 2002 David Howells (dhowells@redhat.com) * - Incorporating suggestions made by Linus Torvalds and Dave Miller
*/
/* * low level task data that entry.S needs immediate access to * - this struct should fit entirely inside of one cache line * - this struct shares the supervisor stack pages * - if the contents of this structure are changed, the assembly constants * must also be changed
*/ struct thread_info { struct task_struct *task; /* main task structure */ unsignedlong flags; /* low level flags */ unsignedlong tp_value; /* thread pointer */
__u32 cpu; /* current CPU */ int preempt_count; /* 0 => preemptible, <0 => BUG */ struct pt_regs *regs; long syscall; /* syscall number */
};
/* * macros/functions for gaining access to the thread information structure
*/ #define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
.flags = _TIF_FIXADE, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
}
/* * A pointer to the struct thread_info for the currently executing thread is * held in register $28/$gp. * * We declare __current_thread_info as a global register variable rather than a * local register variable within current_thread_info() because clang doesn't * support explicit local register variables. * * When building the VDSO we take care not to declare the global register * variable because this causes GCC to not preserve the value of $28/$gp in * functions that change its value (which is common in the PIC VDSO when * accessing the GOT). Since the VDSO shouldn't be accessing * __current_thread_info anyway we declare it extern in order to cause a link * failure if it's referenced.
*/ #ifdef __VDSO__ externstruct thread_info *__current_thread_info; #else registerstruct thread_info *__current_thread_info __asm__("$28"); #endif
/* work to do in syscall_trace_leave() */ #define _TIF_WORK_SYSCALL_EXIT (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \
_TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT)
/* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \
(_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_NOTIFY_RESUME | \
_TIF_UPROBE | _TIF_NOTIFY_SIGNAL) /* work to do on any return to u-space */ #define _TIF_ALLWORK_MASK (_TIF_NOHZ | _TIF_WORK_MASK | \
_TIF_WORK_SYSCALL_EXIT | \
_TIF_SYSCALL_TRACEPOINT)
/* * We stash processor id into a COP0 register to retrieve it fast * at kernel exception entry.
*/ #ifdefined(CONFIG_MIPS_PGD_C0_CONTEXT) #define SMP_CPUID_REG 20, 0 /* XCONTEXT */ #define ASM_SMP_CPUID_REG $20 #define SMP_CPUID_PTRSHIFT 48 #else #define SMP_CPUID_REG 4, 0 /* CONTEXT */ #define ASM_SMP_CPUID_REG $4 #define SMP_CPUID_PTRSHIFT 23 #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.