int init_fpu(struct task_struct *tsk)
{ if (tsk_used_math(tsk)) { if ((boot_cpu_data.flags & CPU_HAS_FPU) && tsk == current)
unlazy_fpu(tsk, task_pt_regs(tsk)); return 0;
}
/* * Memory allocation at the first usage of the FPU and other state.
*/ if (!tsk->thread.xstate) {
tsk->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
GFP_KERNEL); if (!tsk->thread.xstate) return -ENOMEM;
}
if (unlikely(!user_mode(regs))) {
printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
BUG(); return;
}
if (!tsk_used_math(tsk)) { int ret; /* * does a slab alloc which can sleep
*/
local_irq_enable();
ret = init_fpu(tsk);
local_irq_disable(); if (ret) { /* * ran out of memory!
*/
force_sig(SIGKILL); return;
}
}
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.