12 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/kernel.h>
15 #include <linux/signal.h>
16 #include <linux/sched.h>
29 if (crunch_owner == &thread->crunchstate)
34 static int crunch_enabled(
u32 devcfg)
45 crunch_state = &thread->crunchstate;
48 case THREAD_NOTIFY_FLUSH:
49 memset(crunch_state, 0,
sizeof(*crunch_state));
56 case THREAD_NOTIFY_EXIT:
60 case THREAD_NOTIFY_SWITCH:
62 if (crunch_enabled(devcfg) || crunch_owner == crunch_state) {
79 .notifier_call = crunch_do,
84 thread_register_notifier(&crunch_notifier_block);