mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
x86: make restore_fpu() use alternative assembler instructions
It's really just a single instruction, conditional on whether the CPU supports FXSR or not, so implement it as such instead of making it a function that queries FXSR dynamically. This means that the instruction just gets automatically rewritten to the correct one at boot-time.
This commit is contained in:
parent
b339a18b81
commit
8ed1383fb7
2 changed files with 12 additions and 12 deletions
|
|
@ -19,10 +19,21 @@
|
|||
|
||||
extern void mxcsr_feature_mask_init(void);
|
||||
extern void init_fpu(struct task_struct *);
|
||||
|
||||
/*
|
||||
* FPU lazy state save handling...
|
||||
*/
|
||||
extern void restore_fpu( struct task_struct *tsk );
|
||||
|
||||
/*
|
||||
* The "nop" is needed to make the instructions the same
|
||||
* length.
|
||||
*/
|
||||
#define restore_fpu(tsk) \
|
||||
alternative_input( \
|
||||
"nop ; frstor %1", \
|
||||
"fxrstor %1", \
|
||||
X86_FEATURE_FXSR, \
|
||||
"m" ((tsk)->thread.i387.fsave))
|
||||
|
||||
extern void kernel_fpu_begin(void);
|
||||
#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue