Lines Matching +full:current +full:-
1 // SPDX-License-Identifier: GPL-2.0-or-later
18 #include <asm/asm-prototypes.h>
23 WRITE_ONCE(current->thread.riscv_v_flags, flags); in riscv_v_flags_set()
86 return ¤t->thread.riscv_v_flags; in riscv_v_flags_ptr()
106 *riscv_v_flags_ptr() -= RISCV_V_CTX_UNIT_DEPTH; in riscv_v_ctx_depth_dec()
116 if (riscv_v_ctx_get_depth() != 0 || !riscv_preempt_v_started(current)) in riscv_v_stop_kernel_context()
119 riscv_preempt_v_clear_dirty(current); in riscv_v_stop_kernel_context()
128 kvstate = ¤t->thread.kernel_vstate; in riscv_v_start_kernel_context()
129 if (!kvstate->datap) in riscv_v_start_kernel_context()
130 return -ENOENT; in riscv_v_start_kernel_context()
132 if (riscv_preempt_v_started(current)) { in riscv_v_start_kernel_context()
136 if (riscv_preempt_v_dirty(current)) { in riscv_v_start_kernel_context()
137 __riscv_v_vstate_save(kvstate, kvstate->datap); in riscv_v_start_kernel_context()
138 riscv_preempt_v_clear_dirty(current); in riscv_v_start_kernel_context()
140 riscv_preempt_v_set_restore(current); in riscv_v_start_kernel_context()
146 if (__riscv_v_vstate_check(task_pt_regs(current)->status, DIRTY)) { in riscv_v_start_kernel_context()
147 uvstate = ¤t->thread.vstate; in riscv_v_start_kernel_context()
148 __riscv_v_vstate_save(uvstate, uvstate->datap); in riscv_v_start_kernel_context()
150 riscv_preempt_v_clear_dirty(current); in riscv_v_start_kernel_context()
154 /* low-level V context handling code, called with irq disabled */
159 if (!riscv_preempt_v_started(current)) in riscv_v_context_nesting_start()
163 if (depth == 0 && __riscv_v_vstate_check(regs->status, DIRTY)) in riscv_v_context_nesting_start()
171 struct __riscv_v_ext_state *vstate = ¤t->thread.kernel_vstate; in riscv_v_context_nesting_end()
176 if (!riscv_preempt_v_started(current)) in riscv_v_context_nesting_end()
182 if (riscv_preempt_v_restore(current)) { in riscv_v_context_nesting_end()
183 __riscv_v_vstate_restore(vstate, vstate->datap); in riscv_v_context_nesting_end()
190 #define riscv_v_start_kernel_context(nested) (-ENOENT)
191 #define riscv_v_stop_kernel_context() (-ENOENT)
218 riscv_v_vstate_save(¤t->thread.vstate, task_pt_regs(current)); in kernel_vector_begin()
222 riscv_v_vstate_set_restore(current, task_pt_regs(current)); in kernel_vector_begin()
229 * kernel_vector_end(): give the CPU vector registers back to the current task