~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/kernel/cpu/sh5/fpu.c

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.11 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.84 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.154 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.201 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.201 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.77 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/sh/kernel/cpu/sh5/fpu.c
  3  *
  4  * Copyright (C) 2001  Manuela Cirronis, Paolo Alberelli
  5  * Copyright (C) 2002  STMicroelectronics Limited
  6  *   Author : Stuart Menefy
  7  *
  8  * Started from SH4 version:
  9  *   Copyright (C) 1999, 2000  Kaz Kojima & Niibe Yutaka
 10  *
 11  * This file is subject to the terms and conditions of the GNU General Public
 12  * License.  See the file "COPYING" in the main directory of this archive
 13  * for more details.
 14  */
 15 #include <linux/sched.h>
 16 #include <linux/signal.h>
 17 #include <asm/processor.h>
 18 
 19 void save_fpu(struct task_struct *tsk)
 20 {
 21         asm volatile("fst.p     %0, (0*8), fp0\n\t"
 22                      "fst.p     %0, (1*8), fp2\n\t"
 23                      "fst.p     %0, (2*8), fp4\n\t"
 24                      "fst.p     %0, (3*8), fp6\n\t"
 25                      "fst.p     %0, (4*8), fp8\n\t"
 26                      "fst.p     %0, (5*8), fp10\n\t"
 27                      "fst.p     %0, (6*8), fp12\n\t"
 28                      "fst.p     %0, (7*8), fp14\n\t"
 29                      "fst.p     %0, (8*8), fp16\n\t"
 30                      "fst.p     %0, (9*8), fp18\n\t"
 31                      "fst.p     %0, (10*8), fp20\n\t"
 32                      "fst.p     %0, (11*8), fp22\n\t"
 33                      "fst.p     %0, (12*8), fp24\n\t"
 34                      "fst.p     %0, (13*8), fp26\n\t"
 35                      "fst.p     %0, (14*8), fp28\n\t"
 36                      "fst.p     %0, (15*8), fp30\n\t"
 37                      "fst.p     %0, (16*8), fp32\n\t"
 38                      "fst.p     %0, (17*8), fp34\n\t"
 39                      "fst.p     %0, (18*8), fp36\n\t"
 40                      "fst.p     %0, (19*8), fp38\n\t"
 41                      "fst.p     %0, (20*8), fp40\n\t"
 42                      "fst.p     %0, (21*8), fp42\n\t"
 43                      "fst.p     %0, (22*8), fp44\n\t"
 44                      "fst.p     %0, (23*8), fp46\n\t"
 45                      "fst.p     %0, (24*8), fp48\n\t"
 46                      "fst.p     %0, (25*8), fp50\n\t"
 47                      "fst.p     %0, (26*8), fp52\n\t"
 48                      "fst.p     %0, (27*8), fp54\n\t"
 49                      "fst.p     %0, (28*8), fp56\n\t"
 50                      "fst.p     %0, (29*8), fp58\n\t"
 51                      "fst.p     %0, (30*8), fp60\n\t"
 52                      "fst.p     %0, (31*8), fp62\n\t"
 53 
 54                      "fgetscr   fr63\n\t"
 55                      "fst.s     %0, (32*8), fr63\n\t"
 56                 : /* no output */
 57                 : "r" (&tsk->thread.xstate->hardfpu)
 58                 : "memory");
 59 }
 60 
 61 void restore_fpu(struct task_struct *tsk)
 62 {
 63         asm volatile("fld.p     %0, (0*8), fp0\n\t"
 64                      "fld.p     %0, (1*8), fp2\n\t"
 65                      "fld.p     %0, (2*8), fp4\n\t"
 66                      "fld.p     %0, (3*8), fp6\n\t"
 67                      "fld.p     %0, (4*8), fp8\n\t"
 68                      "fld.p     %0, (5*8), fp10\n\t"
 69                      "fld.p     %0, (6*8), fp12\n\t"
 70                      "fld.p     %0, (7*8), fp14\n\t"
 71                      "fld.p     %0, (8*8), fp16\n\t"
 72                      "fld.p     %0, (9*8), fp18\n\t"
 73                      "fld.p     %0, (10*8), fp20\n\t"
 74                      "fld.p     %0, (11*8), fp22\n\t"
 75                      "fld.p     %0, (12*8), fp24\n\t"
 76                      "fld.p     %0, (13*8), fp26\n\t"
 77                      "fld.p     %0, (14*8), fp28\n\t"
 78                      "fld.p     %0, (15*8), fp30\n\t"
 79                      "fld.p     %0, (16*8), fp32\n\t"
 80                      "fld.p     %0, (17*8), fp34\n\t"
 81                      "fld.p     %0, (18*8), fp36\n\t"
 82                      "fld.p     %0, (19*8), fp38\n\t"
 83                      "fld.p     %0, (20*8), fp40\n\t"
 84                      "fld.p     %0, (21*8), fp42\n\t"
 85                      "fld.p     %0, (22*8), fp44\n\t"
 86                      "fld.p     %0, (23*8), fp46\n\t"
 87                      "fld.p     %0, (24*8), fp48\n\t"
 88                      "fld.p     %0, (25*8), fp50\n\t"
 89                      "fld.p     %0, (26*8), fp52\n\t"
 90                      "fld.p     %0, (27*8), fp54\n\t"
 91                      "fld.p     %0, (28*8), fp56\n\t"
 92                      "fld.p     %0, (29*8), fp58\n\t"
 93                      "fld.p     %0, (30*8), fp60\n\t"
 94 
 95                      "fld.s     %0, (32*8), fr63\n\t"
 96                      "fputscr   fr63\n\t"
 97 
 98                      "fld.p     %0, (31*8), fp62\n\t"
 99                 : /* no output */
100                 : "r" (&tsk->thread.xstate->hardfpu)
101                 : "memory");
102 }
103 
104 asmlinkage void do_fpu_error(unsigned long ex, struct pt_regs *regs)
105 {
106         struct task_struct *tsk = current;
107 
108         regs->pc += 4;
109 
110         force_sig(SIGFPE, tsk);
111 }
112 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp