2 # Copyright (c) 2006 Martin Decky
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # - Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 # derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include <arch/asm/regname.h>
30 #include <arch/context_offset.h>
34 .global fpu_context_save
35 .global fpu_context_restore
40 .macro FPU_CONTEXT_STORE r
41 stfd fr14, OFFSET_FR14(\r)
42 stfd fr15, OFFSET_FR15(\r)
43 stfd fr16, OFFSET_FR16(\r)
44 stfd fr17, OFFSET_FR17(\r)
45 stfd fr18, OFFSET_FR18(\r)
46 stfd fr19, OFFSET_FR19(\r)
47 stfd fr20, OFFSET_FR20(\r)
48 stfd fr21, OFFSET_FR21(\r)
49 stfd fr22, OFFSET_FR22(\r)
50 stfd fr23, OFFSET_FR23(\r)
51 stfd fr24, OFFSET_FR24(\r)
52 stfd fr25, OFFSET_FR25(\r)
53 stfd fr26, OFFSET_FR26(\r)
54 stfd fr27, OFFSET_FR27(\r)
55 stfd fr28, OFFSET_FR28(\r)
56 stfd fr29, OFFSET_FR29(\r)
57 stfd fr30, OFFSET_FR30(\r)
58 stfd fr31, OFFSET_FR31(\r)
61 .macro FPU_CONTEXT_LOAD r
62 lfd fr14, OFFSET_FR14(\r)
63 lfd fr15, OFFSET_FR15(\r)
64 lfd fr16, OFFSET_FR16(\r)
65 lfd fr17, OFFSET_FR17(\r)
66 lfd fr18, OFFSET_FR18(\r)
67 lfd fr19, OFFSET_FR19(\r)
68 lfd fr20, OFFSET_FR20(\r)
69 lfd fr21, OFFSET_FR21(\r)
70 lfd fr22, OFFSET_FR22(\r)
71 lfd fr23, OFFSET_FR23(\r)
72 lfd fr24, OFFSET_FR24(\r)
73 lfd fr25, OFFSET_FR25(\r)
74 lfd fr26, OFFSET_FR26(\r)
75 lfd fr27, OFFSET_FR27(\r)
76 lfd fr28, OFFSET_FR28(\r)
77 lfd fr29, OFFSET_FR29(\r)
78 lfd fr30, OFFSET_FR30(\r)
79 lfd fr31, OFFSET_FR31(\r)
83 // FPU_CONTEXT_STORE r3
86 // stfd fr0, OFFSET_FPSCR(r3)
91 // FPU_CONTEXT_LOAD r3
93 // lfd fr0, OFFSET_FPSCR(r3)