source: rtems/cpukit/score/cpu/sparc/cpu_asm.S @ a400d06f

5
Last change on this file since a400d06f was a400d06f, checked in by Sebastian Huber <sebastian.huber@…>, on Jul 18, 2017 at 1:11:41 PM

sparc: Rename SPARC_USE_SAFE_FP_SUPPORT

Rename SPARC_USE_SAFE_FP_SUPPORT in SPARC_USE_SYNCHRONOUS_FP_SWITCH.
Update comment.

Update #3077.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/*  cpu_asm.s
2 *
3 *  This file contains the basic algorithms for all assembly code used
4 *  in an specific CPU port of RTEMS.  These algorithms must be implemented
5 *  in assembly language.
6 *
7 *  COPYRIGHT (c) 1989-2011.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.org/license/LICENSE.
13 *
14 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
15 *  Research Corporation (OAR) under contract to the European Space
16 *  Agency (ESA).
17 *
18 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
19 *  European Space Agency.
20 */
21
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <rtems/asm.h>
27#include <rtems/system.h>
28
29#if (SPARC_HAS_FPU == 1) && !defined(SPARC_USE_SYNCHRONOUS_FP_SWITCH)
30
31/*
32 *  void _CPU_Context_save_fp(
33 *    void **fp_context_ptr
34 *  )
35 *
36 *  This routine is responsible for saving the FP context
37 *  at *fp_context_ptr.  If the point to load the FP context
38 *  from is changed then the pointer is modified by this routine.
39 *
40 *  NOTE: See the README in this directory for information on the
41 *        management of the "EF" bit in the PSR.
42 */
43
44        .align 4
45        PUBLIC(_CPU_Context_save_fp)
46SYM(_CPU_Context_save_fp):
47        ld      [%o0], %o1
48        std     %f0, [%o1 + FO_F1_OFFSET]
49        SPARC_LEON3FT_B2BST_NOP
50        std     %f2, [%o1 + F2_F3_OFFSET]
51        SPARC_LEON3FT_B2BST_NOP
52        std     %f4, [%o1 + F4_F5_OFFSET]
53        SPARC_LEON3FT_B2BST_NOP
54        std     %f6, [%o1 + F6_F7_OFFSET]
55        SPARC_LEON3FT_B2BST_NOP
56        std     %f8, [%o1 + F8_F9_OFFSET]
57        SPARC_LEON3FT_B2BST_NOP
58        std     %f10, [%o1 + F1O_F11_OFFSET]
59        SPARC_LEON3FT_B2BST_NOP
60        std     %f12, [%o1 + F12_F13_OFFSET]
61        SPARC_LEON3FT_B2BST_NOP
62        std     %f14, [%o1 + F14_F15_OFFSET]
63        SPARC_LEON3FT_B2BST_NOP
64        std     %f16, [%o1 + F16_F17_OFFSET]
65        SPARC_LEON3FT_B2BST_NOP
66        std     %f18, [%o1 + F18_F19_OFFSET]
67        SPARC_LEON3FT_B2BST_NOP
68        std     %f20, [%o1 + F2O_F21_OFFSET]
69        SPARC_LEON3FT_B2BST_NOP
70        std     %f22, [%o1 + F22_F23_OFFSET]
71        SPARC_LEON3FT_B2BST_NOP
72        std     %f24, [%o1 + F24_F25_OFFSET]
73        SPARC_LEON3FT_B2BST_NOP
74        std     %f26, [%o1 + F26_F27_OFFSET]
75        SPARC_LEON3FT_B2BST_NOP
76        std     %f28, [%o1 + F28_F29_OFFSET]
77        SPARC_LEON3FT_B2BST_NOP
78        std     %f30, [%o1 + F3O_F31_OFFSET]
79        SPARC_LEON3FT_B2BST_NOP
80#if defined(__FIX_LEON3FT_B2BST)
81        st     %fsr, [%o1 + FSR_OFFSET]
82        jmp     %o7 + 8
83         nop
84#else
85        jmp     %o7 + 8
86         st     %fsr, [%o1 + FSR_OFFSET]
87#endif
88
89/*
90 *  void _CPU_Context_restore_fp(
91 *    void **fp_context_ptr
92 *  )
93 *
94 *  This routine is responsible for restoring the FP context
95 *  at *fp_context_ptr.  If the point to load the FP context
96 *  from is changed then the pointer is modified by this routine.
97 *
98 *  NOTE: See the README in this directory for information on the
99 *        management of the "EF" bit in the PSR.
100 */
101
102        .align 4
103        PUBLIC(_CPU_Context_restore_fp)
104SYM(_CPU_Context_restore_fp):
105        ld      [%o0], %o1
106        ldd     [%o1 + FO_F1_OFFSET], %f0
107        ldd     [%o1 + F2_F3_OFFSET], %f2
108        ldd     [%o1 + F4_F5_OFFSET], %f4
109        ldd     [%o1 + F6_F7_OFFSET], %f6
110        ldd     [%o1 + F8_F9_OFFSET], %f8
111        ldd     [%o1 + F1O_F11_OFFSET], %f10
112        ldd     [%o1 + F12_F13_OFFSET], %f12
113        ldd     [%o1 + F14_F15_OFFSET], %f14
114        ldd     [%o1 + F16_F17_OFFSET], %f16
115        ldd     [%o1 + F18_F19_OFFSET], %f18
116        ldd     [%o1 + F2O_F21_OFFSET], %f20
117        ldd     [%o1 + F22_F23_OFFSET], %f22
118        ldd     [%o1 + F24_F25_OFFSET], %f24
119        ldd     [%o1 + F26_F27_OFFSET], %f26
120        ldd     [%o1 + F28_F29_OFFSET], %f28
121        ldd     [%o1 + F3O_F31_OFFSET], %f30
122        jmp     %o7 + 8
123         ld     [%o1 + FSR_OFFSET], %fsr
124
125#endif /* SPARC_HAS_FPU */
126
127/* end of file */
Note: See TracBrowser for help on using the repository browser.