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
RevLine 
[de36fdd]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
[73b3ecd]29#include <abi/asmtool.h>
[de36fdd]30
[73b3ecd]31.text
[de36fdd]32
[73b3ecd]33FUNCTION_BEGIN(fpsid_read)
[de36fdd]34 vmrs r0, fpsid
35 mov pc, lr
[73b3ecd]36FUNCTION_END(fpsid_read)
[de36fdd]37
[73b3ecd]38FUNCTION_BEGIN(mvfr0_read)
[de36fdd]39 vmrs r0, mvfr0
40 mov pc, lr
[73b3ecd]41FUNCTION_END(mvfr0_read)
[de36fdd]42
[73b3ecd]43FUNCTION_BEGIN(fpscr_read)
[de36fdd]44 vmrs r0, fpscr
45 mov pc, lr
[73b3ecd]46FUNCTION_END(fpscr_read)
[de36fdd]47
[73b3ecd]48FUNCTION_BEGIN(fpscr_write)
[de36fdd]49 vmsr fpscr, r0
50 mov pc, lr
[73b3ecd]51FUNCTION_END(fpscr_write)
[de36fdd]52
[73b3ecd]53FUNCTION_BEGIN(fpexc_read)
[de36fdd]54 vmrs r0, fpexc
55 mov pc, lr
[73b3ecd]56FUNCTION_END(fpexc_read)
[de36fdd]57
[73b3ecd]58FUNCTION_BEGIN(fpexc_write)
[de36fdd]59 vmsr fpexc, r0
60 mov pc, lr
[73b3ecd]61FUNCTION_END(fpexc_write)
[de36fdd]62
[73b3ecd]63FUNCTION_BEGIN(fpu_context_save_s32)
[de36fdd]64 vmrs r1, fpexc
65 vmrs r2, fpscr
66 stmia r0!, {r1, r2}
67 vstmia r0!, {s0-s31}
68 mov pc, lr
[73b3ecd]69FUNCTION_END(fpu_context_save_s32)
[de36fdd]70
[73b3ecd]71FUNCTION_BEGIN(fpu_context_restore_s32)
[de36fdd]72 ldmia r0!, {r1, r2}
73 vmsr fpexc, r1
74 vmsr fpscr, r2
75 vldmia r0!, {s0-s31}
76 mov pc, lr
[73b3ecd]77FUNCTION_END(fpu_context_restore_s32)
[de36fdd]78
[73b3ecd]79FUNCTION_BEGIN(fpu_context_save_d16)
[de36fdd]80 vmrs r1, fpexc
81 vmrs r2, fpscr
82 stmia r0!, {r1, r2}
83 vstmia r0!, {d0-d15}
84 mov pc, lr
[73b3ecd]85FUNCTION_END(fpu_context_save_d16)
[de36fdd]86
[73b3ecd]87FUNCTION_BEGIN(fpu_context_restore_d16)
[de36fdd]88 ldmia r0!, {r1, r2}
89 vmsr fpexc, r1
90 vmsr fpscr, r2
91 vldmia r0!, {d0-d15}
92 mov pc, lr
[73b3ecd]93FUNCTION_END(fpu_context_restore_d16)
[de36fdd]94
[73b3ecd]95FUNCTION_BEGIN(fpu_context_save_d32)
[de36fdd]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
[73b3ecd]103FUNCTION_END(fpu_context_save_d32)
[de36fdd]104
[73b3ecd]105FUNCTION_BEGIN(fpu_context_restore_d32)
[de36fdd]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
[73b3ecd]112FUNCTION_END(fpu_context_restore_d32)
[de36fdd]113
Note: See TracBrowser for help on using the repository browser.