source: rtems/c/src/lib/libcpu/sparc/access/access.S @ 2f8704b6

5
Last change on this file since 2f8704b6 was 2f8704b6, checked in by Daniel Cederman <cederman@…>, on Jul 13, 2017 at 7:26:50 AM

sparc: Add assembly workaround for LEON3FT B2BST errata

This patch adds NOP instructions to prevent instruction sequences
that are sensitive to the LEON3FT B2BST errata. See GRLIB-TN-0009:
"LEON3FT Stale Cache Entry After Store with Data Tag Parity Error"
for more information.

The sequences are only modified if FIX_LEON3FT_B2BST is defined.

The patch works in conjunction with the -mfix-ut700, -mfix-gr712rc,
and -mfix-ut699 GCC flags that prevents the sensitive sequences from
being generated.

Update #3057.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 *  Optimized access routines for SPARC.
3 *
4 *  Note the difference between byteorder.h (inlined functions) and access.S
5 *  where the functions will be declared in the library archive librtemscpu.a.
6 *  Function names starting with _ are in library and can be referenced by
7 *  function pointers.
8 *
9 *  _ldN, _stN          standard machine endianess access (SPARC: big-endian)
10 *  _ld_beN, _st_beN    forced big-endian
11 *  _ld_leN, _st_leN    forced little-endian (defined in access_le.C)
12 *
13 *  This file is written in assembly because the big-endian functions maps to
14 *  machine dependant access methods, i.e. same function has two names.
15 *
16 *  COPYRIGHT (c) 2011
17 *  Aeroflex Gaisler.
18 *
19 *  The license and distribution terms for this file may be
20 *  found in the file LICENSE in this distribution or at
21 *  http://www.rtems.org/license/LICENSE.
22 */
23
24#include <rtems/asm.h>
25
26        .align 4
27        .section ".text"
28        PUBLIC(_ld8)
29        PUBLIC(_ld16)
30        PUBLIC(_ld32)
31        PUBLIC(_ld64)
32        PUBLIC(_st8)
33        PUBLIC(_st16)
34        PUBLIC(_st32)
35        PUBLIC(_st64)
36        PUBLIC(_ld_be16)
37        PUBLIC(_ld_be32)
38        PUBLIC(_ld_be64)
39        PUBLIC(_st_be16)
40        PUBLIC(_st_be32)
41        PUBLIC(_st_be64)
42
43SYM(_ld8):
44        retl
45         ldub [%o0], %o0
46
47SYM(_ld_be16):
48SYM(_ld16):
49        retl
50         lduh [%o0], %o0
51
52SYM(_ld_be32):
53SYM(_ld32):
54        retl
55         ld [%o0], %o0
56
57SYM(_ld_be64):
58SYM(_ld64):
59        retl
60         ldd [%o0], %o0
61
62#if defined(__FIX_LEON3FT_B2BST)
63
64SYM(_st8):
65        stub %o1, [%o0]
66        retl
67         nop
68
69SYM(_st_be16):
70SYM(_st16):
71        stuh %o1, [%o0]
72        retl
73         nop
74
75SYM(_st_be32):
76SYM(_st32):
77        st %o1, [%o0]
78        retl
79         nop
80
81SYM(_st_be64):
82SYM(_st64):
83        std %o1, [%o0]
84        retl
85         nop
86
87#else
88
89SYM(_st8):
90        retl
91         stb %o1, [%o0]
92
93SYM(_st_be16):
94SYM(_st16):
95        retl
96         sth %o1, [%o0]
97
98SYM(_st_be32):
99SYM(_st32):
100        retl
101         st %o1, [%o0]
102
103SYM(_st_be64):
104SYM(_st64):
105        mov %o2, %o3
106        mov %o1, %o2
107        retl
108         std %o2, [%o0]
109#endif
Note: See TracBrowser for help on using the repository browser.