blob: bee94196a569650e1c8abc04778f01ecc4b141b4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Kevin D. Kissell, kevink@mips and Carsten Langgaard, carstenl@mips.com
Ralf Baechle70342282013-01-22 12:59:30 +01003 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
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 Baechle3f7cac42014-04-26 01:49:14 +020016 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 *
18 * Routines corresponding to Linux kernel FP context
19 * manipulation primitives for the Algorithmics MIPS
20 * FPU Emulator
21 */
Ralf Baechlecd8ee342014-04-16 02:09:53 +020022#include <linux/printk.h>
23#include <asm/current.h>
Dmitri Vorobievf028b862008-07-15 19:57:31 +030024#include <asm/fpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <asm/fpu_emulator.h>
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#define SIGNALLING_NAN 0x7ff800007ff80000LL
28
29void 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 Nemotoeae89072006-05-16 01:26:03 +090039 current->thread.fpu.fcr31 = 0;
Paul Burtonbbd426f2014-02-13 11:26:41 +000040 for (i = 0; i < 32; i++)
41 set_fpr64(&current->thread.fpu.fpr[i], 0, SIGNALLING_NAN);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042}