Commit 4150d4ca authored by Russell King's avatar Russell King

[ARM] Provide hook for FP emulators to know when a new thread is created

This allows FP emulators to take their FP initialisation out of the
hot path.
parent ac2c9c98
......@@ -73,6 +73,7 @@ extern void abort(void);
extern void ret_from_exception(void);
extern void fpundefinstr(void);
extern void fp_enter(void);
extern void fp_init(union fp_state *);
/*
* This has a special calling convention; it doesn't
......@@ -129,6 +130,7 @@ EXPORT_SYMBOL(disable_irq);
EXPORT_SYMBOL(set_irq_type);
EXPORT_SYMBOL(pm_idle);
EXPORT_SYMBOL(pm_power_off);
EXPORT_SYMBOL(fp_init);
/* processor dependencies */
EXPORT_SYMBOL(__machine_arch_type);
......
......@@ -177,9 +177,9 @@ void show_regs(struct pt_regs * regs)
flags & PSR_Z_BIT ? 'Z' : 'z',
flags & PSR_C_BIT ? 'C' : 'c',
flags & PSR_V_BIT ? 'V' : 'v');
printk(" IRQs %s FIQs %s Mode %s%s Segment %s\n",
interrupts_enabled(regs) ? "on" : "off",
fast_interrupts_enabled(regs) ? "on" : "off",
printk(" IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
interrupts_enabled(regs) ? "n" : "ff",
fast_interrupts_enabled(regs) ? "n" : "ff",
processor_modes[processor_mode(regs)],
thumb_mode(regs) ? " (T)" : "",
get_fs() == get_ds() ? "kernel" : "user");
......@@ -293,15 +293,22 @@ void exit_thread(void)
{
}
static void default_fp_init(union fp_state *fp)
{
memset(fp, 0, sizeof(union fp_state));
}
void (*fp_init)(union fp_state *) = default_fp_init;
void flush_thread(void)
{
struct thread_info *thread = current_thread_info();
struct task_struct *tsk = current;
memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
memset(&thread->fpstate, 0, sizeof(union fp_state));
tsk->used_math = 0;
current->used_math = 0;
memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
fp_init(&thread->fpstate);
}
void release_thread(struct task_struct *dead_task)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment