11 #include <linux/types.h>
12 #include <linux/kernel.h>
13 #include <linux/signal.h>
14 #include <linux/sched.h>
22 "mrrc p0, 0, %0, %1, c0\n"
23 :
"=r" (state[0]),
"=r" (state[1]));
26 static inline void dsp_load_state(
u32 *state)
29 "mcrr p0, 0, %0, %1, c0\n"
30 : :
"r" (state[0]),
"r" (state[1]));
38 case THREAD_NOTIFY_FLUSH:
39 thread->cpu_context.extra[0] = 0;
40 thread->cpu_context.extra[1] = 0;
43 case THREAD_NOTIFY_SWITCH:
45 dsp_load_state(thread->cpu_context.extra);
53 .notifier_call = dsp_do,
58 static int iwmmxt_do(
struct notifier_block *
self,
unsigned long cmd,
void *t)
63 case THREAD_NOTIFY_FLUSH:
72 case THREAD_NOTIFY_EXIT:
73 iwmmxt_task_release(thread);
76 case THREAD_NOTIFY_SWITCH:
77 iwmmxt_task_switch(thread);
90 static u32 __init xscale_cp_access_read(
void)
95 "mrc p15, 0, %0, c15, c1, 0\n\t"
101 static void __init xscale_cp_access_write(
u32 value)
106 "mcr p15, 0, %1, c15, c1, 0\n\t"
107 "mrc p15, 0, %0, c15, c1, 0\n\t"
110 :
"=r" (temp) :
"r" (value));
119 static int __init cpu_has_iwmmxt(
void)
134 "mcrr p0, 0, %2, %3, c0\n"
135 "mrrc p0, 0, %0, %1, c0\n"
136 :
"=r" (lo),
"=r" (hi)
137 :
"r" (0),
"r" (0x100));
151 static int __init xscale_cp0_init(
void)
155 cp_access = xscale_cp_access_read() & ~3;
156 xscale_cp_access_write(cp_access | 1);
158 if (cpu_has_iwmmxt()) {
159 #ifndef CONFIG_IWMMXT
161 "detected, but kernel support is missing.\n");
165 thread_register_notifier(&iwmmxt_notifier_block);
169 thread_register_notifier(&dsp_notifier_block);
173 xscale_cp_access_write(cp_access);