2 * linux/arch/arm/kernel/iwmmxt-notifier.c
4 * XScale iWMMXt (Concan) context switching and handling
7 * Copyright (c) 2003, Intel Corporation
9 * Full lazy switching support, optimizations and more, by Nicolas Pitre
10 * Copyright (c) 2003-2004, MontaVista Software, Inc.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
17 #include <linux/module.h>
18 #include <linux/types.h>
19 #include <linux/kernel.h>
20 #include <linux/signal.h>
21 #include <linux/sched.h>
22 #include <linux/init.h>
23 #include <asm/thread_notify.h>
26 static int iwmmxt_do(struct notifier_block
*self
, unsigned long cmd
, void *t
)
28 struct thread_info
*thread
= t
;
31 case THREAD_NOTIFY_FLUSH
:
33 * flush_thread() zeroes thread->fpstate, so no need
34 * to do anything here.
36 * FALLTHROUGH: Ensure we don't try to overwrite our newly
37 * initialised state information on the first fault.
40 case THREAD_NOTIFY_RELEASE
:
41 iwmmxt_task_release(thread
);
44 case THREAD_NOTIFY_SWITCH
:
45 iwmmxt_task_switch(thread
);
52 static struct notifier_block iwmmxt_notifier_block
= {
53 .notifier_call
= iwmmxt_do
,
56 static int __init
iwmmxt_init(void)
58 thread_register_notifier(&iwmmxt_notifier_block
);
63 late_initcall(iwmmxt_init
);