Lines Matching refs:thread
48 * The pointer to the vfpstate structure of the thread which currently
52 * For UP, this is sufficient to tell which thread owns the VFP context.
59 * Is 'thread's most up to date state stored in this CPUs hardware?
62 static bool vfp_state_in_hw(unsigned int cpu, struct thread_info *thread)
65 if (thread->vfpstate.hard.cpu != cpu)
68 return vfp_current_hw_state[cpu] == &thread->vfpstate;
72 * Force a reload of the VFP context from the thread structure. We do
76 static void vfp_force_reload(unsigned int cpu, struct thread_info *thread)
78 if (vfp_state_in_hw(cpu, thread)) {
83 thread->vfpstate.hard.cpu = NR_CPUS;
88 * Per-thread VFP initialization.
90 static void vfp_thread_flush(struct thread_info *thread)
92 union vfp_state *vfp = &thread->vfpstate;
118 static void vfp_thread_exit(struct thread_info *thread)
120 /* release case: Per-thread VFP cleanup. */
121 union vfp_state *vfp = &thread->vfpstate;
129 static void vfp_thread_copy(struct thread_info *thread)
134 thread->vfpstate = parent->vfpstate;
136 thread->vfpstate.hard.cpu = NR_CPUS;
144 * - the previously running thread will not be scheduled onto another CPU.
145 * - the next thread to be run (v) will not be running on another CPU.
146 * - thread->cpu is the local CPU number
147 * - not preemptible as we're called in the middle of a thread switch
149 * - the thread (v) will be running on the local CPU, so
151 * - thread->cpu is the local CPU number at the time it is accessed,
154 * it is unsafe to use thread->cpu.
157 * it is unsafe to use thread->cpu.
161 struct thread_info *thread = v;
172 cpu = thread->cpu;
176 * case the thread migrates to a different CPU. The
191 vfp_thread_flush(thread);
195 vfp_thread_exit(thread);
199 vfp_thread_copy(thread);
220 current->thread.error_code = 0;
221 current->thread.trap_no = 6;
513 * Ensure that the VFP state stored in 'thread->vfpstate' is up to date
516 void vfp_sync_hwstate(struct thread_info *thread)
520 if (vfp_state_in_hw(cpu, thread)) {
527 vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN);
534 /* Ensure that the thread reloads the hardware VFP state on the next use. */
535 void vfp_flush_hwstate(struct thread_info *thread)
539 vfp_force_reload(cpu, thread);
551 struct thread_info *thread = current_thread_info();
552 struct vfp_hard_struct *hwstate = &thread->vfpstate.hard;
555 vfp_sync_hwstate(thread);
576 vfp_flush_hwstate(thread);
589 struct thread_info *thread = current_thread_info();
590 struct vfp_hard_struct *hwstate = &thread->vfpstate.hard;
593 /* Disable VFP to avoid corrupting the new thread state. */
594 vfp_flush_hwstate(thread);
627 * hardware state at every thread switch. We clear our held state when
716 struct thread_info *thread = current_thread_info();
735 if (vfp_state_in_hw(cpu, thread))
736 vfp_save_state(&thread->vfpstate, fpexc);