1 | /*
|
---|
2 | * Copyright (c) 2013 Jan Vesely
|
---|
3 | * All rights reserved.
|
---|
4 | *
|
---|
5 | * Redistribution and use in source and binary forms, with or without
|
---|
6 | * modification, are permitted provided that the following conditions
|
---|
7 | * are met:
|
---|
8 | *
|
---|
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.
|
---|
16 | *
|
---|
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.
|
---|
27 | */
|
---|
28 |
|
---|
29 | #include <abi/asmtool.h>
|
---|
30 |
|
---|
31 | .text
|
---|
32 |
|
---|
33 | FUNCTION_BEGIN(fpsid_read)
|
---|
34 | vmrs r0, fpsid
|
---|
35 | mov pc, lr
|
---|
36 | FUNCTION_END(fpsid_read)
|
---|
37 |
|
---|
38 | FUNCTION_BEGIN(mvfr0_read)
|
---|
39 | vmrs r0, mvfr0
|
---|
40 | mov pc, lr
|
---|
41 | FUNCTION_END(mvfr0_read)
|
---|
42 |
|
---|
43 | FUNCTION_BEGIN(fpscr_read)
|
---|
44 | vmrs r0, fpscr
|
---|
45 | mov pc, lr
|
---|
46 | FUNCTION_END(fpscr_read)
|
---|
47 |
|
---|
48 | FUNCTION_BEGIN(fpscr_write)
|
---|
49 | vmsr fpscr, r0
|
---|
50 | mov pc, lr
|
---|
51 | FUNCTION_END(fpscr_write)
|
---|
52 |
|
---|
53 | FUNCTION_BEGIN(fpexc_read)
|
---|
54 | vmrs r0, fpexc
|
---|
55 | mov pc, lr
|
---|
56 | FUNCTION_END(fpexc_read)
|
---|
57 |
|
---|
58 | FUNCTION_BEGIN(fpexc_write)
|
---|
59 | vmsr fpexc, r0
|
---|
60 | mov pc, lr
|
---|
61 | FUNCTION_END(fpexc_write)
|
---|
62 |
|
---|
63 | FUNCTION_BEGIN(fpu_context_save_s32)
|
---|
64 | vmrs r1, fpexc
|
---|
65 | vmrs r2, fpscr
|
---|
66 | stmia r0!, {r1, r2}
|
---|
67 | vstmia r0!, {s0-s31}
|
---|
68 | mov pc, lr
|
---|
69 | FUNCTION_END(fpu_context_save_s32)
|
---|
70 |
|
---|
71 | FUNCTION_BEGIN(fpu_context_restore_s32)
|
---|
72 | ldmia r0!, {r1, r2}
|
---|
73 | vmsr fpexc, r1
|
---|
74 | vmsr fpscr, r2
|
---|
75 | vldmia r0!, {s0-s31}
|
---|
76 | mov pc, lr
|
---|
77 | FUNCTION_END(fpu_context_restore_s32)
|
---|
78 |
|
---|
79 | FUNCTION_BEGIN(fpu_context_save_d16)
|
---|
80 | vmrs r1, fpexc
|
---|
81 | vmrs r2, fpscr
|
---|
82 | stmia r0!, {r1, r2}
|
---|
83 | vstmia r0!, {d0-d15}
|
---|
84 | mov pc, lr
|
---|
85 | FUNCTION_END(fpu_context_save_d16)
|
---|
86 |
|
---|
87 | FUNCTION_BEGIN(fpu_context_restore_d16)
|
---|
88 | ldmia r0!, {r1, r2}
|
---|
89 | vmsr fpexc, r1
|
---|
90 | vmsr fpscr, r2
|
---|
91 | vldmia r0!, {d0-d15}
|
---|
92 | mov pc, lr
|
---|
93 | FUNCTION_END(fpu_context_restore_d16)
|
---|
94 |
|
---|
95 | FUNCTION_BEGIN(fpu_context_save_d32)
|
---|
96 | vmrs r1, fpexc
|
---|
97 | stmia r0!, {r1}
|
---|
98 | vmrs r1, fpscr
|
---|
99 | stmia r0!, {r1}
|
---|
100 | vstmia r0!, {d0-d15}
|
---|
101 | vstmia r0!, {d16-d31}
|
---|
102 | mov pc, lr
|
---|
103 | FUNCTION_END(fpu_context_save_d32)
|
---|
104 |
|
---|
105 | FUNCTION_BEGIN(fpu_context_restore_d32)
|
---|
106 | ldmia r0!, {r1, r2}
|
---|
107 | vmsr fpexc, r1
|
---|
108 | vmsr fpscr, r2
|
---|
109 | vldmia r0!, {d0-d15}
|
---|
110 | vldmia r0!, {d16-d31}
|
---|
111 | mov pc, lr
|
---|
112 | FUNCTION_END(fpu_context_restore_d32)
|
---|
113 |
|
---|