Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Kevin D. Kissell, kevink@mips and Carsten Langgaard, carstenl@mips.com |
Ralf Baechle | 7034228 | 2013-01-22 12:59:30 +0100 | [diff] [blame] | 3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can distribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License (Version 2) as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | * for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along |
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., |
Ralf Baechle | 3f7cac4 | 2014-04-26 01:49:14 +0200 | [diff] [blame^] | 16 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | * |
| 18 | * Routines corresponding to Linux kernel FP context |
| 19 | * manipulation primitives for the Algorithmics MIPS |
| 20 | * FPU Emulator |
| 21 | */ |
Ralf Baechle | cd8ee34 | 2014-04-16 02:09:53 +0200 | [diff] [blame] | 22 | #include <linux/printk.h> |
| 23 | #include <asm/current.h> |
Dmitri Vorobiev | f028b86 | 2008-07-15 19:57:31 +0300 | [diff] [blame] | 24 | #include <asm/fpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <asm/fpu_emulator.h> |
| 26 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #define SIGNALLING_NAN 0x7ff800007ff80000LL |
| 28 | |
| 29 | void fpu_emulator_init_fpu(void) |
| 30 | { |
| 31 | static int first = 1; |
| 32 | int i; |
| 33 | |
| 34 | if (first) { |
| 35 | first = 0; |
| 36 | printk("Algorithmics/MIPS FPU Emulator v1.5\n"); |
| 37 | } |
| 38 | |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 39 | current->thread.fpu.fcr31 = 0; |
Paul Burton | bbd426f | 2014-02-13 11:26:41 +0000 | [diff] [blame] | 40 | for (i = 0; i < 32; i++) |
| 41 | set_fpr64(¤t->thread.fpu.fpr[i], 0, SIGNALLING_NAN); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | } |