| * This file is subject to the terms and conditions of the GNU General Public |
| * License. See the file "COPYING" in the main directory of this archive |
| * Copyright (C) 2009 Wind River Systems, |
| * written by Ralf Baechle <ralf@linux-mips.org> |
| #include <linux/irqflags.h> |
| #include <linux/notifier.h> |
| #include <linux/prefetch.h> |
| #include <asm/mipsregs.h> |
| #include <asm/octeon/octeon.h> |
| static int cnmips_cu2_call(struct notifier_block *nfb, unsigned long action, |
| prefetch(¤t->thread.cp2); |
| KSTK_STATUS(current) |= ST0_CU2; |
| status = read_c0_status(); |
| write_c0_status(status | ST0_CU2); |
| octeon_cop2_restore(&(current->thread.cp2)); |
| write_c0_status(status & ~ST0_CU2); |
| local_irq_restore(flags); |
| return NOTIFY_BAD; /* Don't call default notifier */ |
| return NOTIFY_OK; /* Let default notifier send signals */ |
| static int __init cnmips_cu2_setup(void) |
| return cu2_notifier(cnmips_cu2_call, 0); |
| early_initcall(cnmips_cu2_setup); |