/* * By aligning VMAP'd stacks to 2 * THREAD_SIZE, we can detect overflow by * checking sp & (1 << THREAD_SHIFT), which we can do cheaply in the entry * assembly.
*/ #ifdef CONFIG_VMAP_STACK #define THREAD_ALIGN (2 * THREAD_SIZE) #else #define THREAD_ALIGN THREAD_SIZE #endif
/* * low level task data that entry.S needs immediate access to * - this struct should fit entirely inside of one cache line * - if the members of this struct changes, the assembly constants * in asm-offsets.c must be updated accordingly * - thread_info is included in task_struct at an offset of 0. This means that * tp points to both thread_info and task_struct.
*/ struct thread_info { unsignedlong flags; /* low level flags */ int preempt_count; /* 0=>preemptible, <0=>BUG */ /* * These stack pointers are overwritten on every system call or * exception. SP is also saved to the stack it can be recovered when * overwritten.
*/ long kernel_sp; /* Kernel stack pointer */ long user_sp; /* User stack pointer */ int cpu; unsignedlong syscall_work; /* SYSCALL_WORK_ flags */ #ifdef CONFIG_SHADOW_CALL_STACK void *scs_base; void *scs_sp; #endif #ifdef CONFIG_64BIT /* * Used in handle_exception() to save a0, a1 and a2 before knowing if we * can access the kernel stack.
*/ unsignedlong a0, a1, a2; #endif
};
/* * macros/functions for gaining access to the thread information structure * * preempt_count needs to be 1 initially, until the scheduler is functional.
*/ #define INIT_THREAD_INFO(tsk) \
{ \
.flags = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
INIT_SCS \
}
/* * thread information flags * - these are process state flags that various assembly files may need to * access * - pending work-to-be-done flags are in lowest half-word * - other flags in upper half-word(s)
*/ #define TIF_NEED_RESCHED 0 /* rescheduling necessary */ #define TIF_NEED_RESCHED_LAZY 1 /* Lazy rescheduling needed */ #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ #define TIF_SIGPENDING 3 /* signal pending */ #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ #define TIF_NOTIFY_SIGNAL 9 /* signal notifications exist */ #define TIF_UPROBE 10 /* uprobe breakpoint or singlestep */ #define TIF_32BIT 11 /* compat-mode 32bit process */ #define TIF_RISCV_V_DEFER_RESTORE 12 /* restore Vector before returing to user */
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.