/* * This decides where the kernel will search for a free chunk of vm * space during mmap's.
*/ #ifdef CONFIG_64BIT #define TASK_UNMAPPED_BASE PAGE_ALIGN((UL(1) << MMAP_MIN_VA_BITS) / 3) #else #define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE / 3) #endif
#ifndef __ASSEMBLY__
struct task_struct; struct pt_regs;
/* * We use a flag to track in-kernel Vector context. Currently the flag has the * following meaning: * * - bit 0: indicates whether the in-kernel Vector context is active. The * activation of this state disables the preemption. On a non-RT kernel, it * also disable bh. * - bits 8: is used for tracking preemptible kernel-mode Vector, when * RISCV_ISA_V_PREEMPTIVE is enabled. Calling kernel_vector_begin() does not * disable the preemption if the thread's kernel_vstate.datap is allocated. * Instead, the kernel set this bit field. Then the trap entry/exit code * knows if we are entering/exiting the context that owns preempt_v. * - 0: the task is not using preempt_v * - 1: the task is actively using preempt_v. But whether does the task own * the preempt_v context is decided by bits in RISCV_V_CTX_DEPTH_MASK. * - bit 16-23 are RISCV_V_CTX_DEPTH_MASK, used by context tracking routine * when preempt_v starts: * - 0: the task is actively using, and own preempt_v context. * - non-zero: the task was using preempt_v, but then took a trap within. * Thus, the task does not own preempt_v. Any use of Vector will have to * save preempt_v, if dirty, and fallback to non-preemptible kernel-mode * Vector. * - bit 29: The thread voluntarily calls schedule() while holding an active * preempt_v. All preempt_v context should be dropped in such case because * V-regs are caller-saved. Only sstatus.VS=ON is persisted across a * schedule() call. * - bit 30: The in-kernel preempt_v context is saved, and requries to be * restored when returning to the context that owns the preempt_v. * - bit 31: The in-kernel preempt_v context is dirty, as signaled by the * trap entry code. Any context switches out-of current task need to save * it to the task's in-kernel V context. Also, any traps nesting on-top-of * preempt_v requesting to use V needs a save.
*/ #define RISCV_V_CTX_DEPTH_MASK 0x00ff0000
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.