source: mainline/kernel/arch/arm32/src/fpu.S

Last change on this file was 73b3ecd, checked in by Jakub Jermar <jakub@…>, 9 years ago

arm32: use asmtool.h macros for defining symbols

  • Property mode set to 100644
File size: 3.0 KB
Line 
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
33FUNCTION_BEGIN(fpsid_read)
34 vmrs r0, fpsid
35 mov pc, lr
36FUNCTION_END(fpsid_read)
37
38FUNCTION_BEGIN(mvfr0_read)
39 vmrs r0, mvfr0
40 mov pc, lr
41FUNCTION_END(mvfr0_read)
42
43FUNCTION_BEGIN(fpscr_read)
44 vmrs r0, fpscr
45 mov pc, lr
46FUNCTION_END(fpscr_read)
47
48FUNCTION_BEGIN(fpscr_write)
49 vmsr fpscr, r0
50 mov pc, lr
51FUNCTION_END(fpscr_write)
52
53FUNCTION_BEGIN(fpexc_read)
54 vmrs r0, fpexc
55 mov pc, lr
56FUNCTION_END(fpexc_read)
57
58FUNCTION_BEGIN(fpexc_write)
59 vmsr fpexc, r0
60 mov pc, lr
61FUNCTION_END(fpexc_write)
62
63FUNCTION_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
69FUNCTION_END(fpu_context_save_s32)
70
71FUNCTION_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
77FUNCTION_END(fpu_context_restore_s32)
78
79FUNCTION_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
85FUNCTION_END(fpu_context_save_d16)
86
87FUNCTION_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
93FUNCTION_END(fpu_context_restore_d16)
94
95FUNCTION_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
103FUNCTION_END(fpu_context_save_d32)
104
105FUNCTION_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
112FUNCTION_END(fpu_context_restore_d32)
113
Note: See TracBrowser for help on using the repository browser.