source: trunk/libs/newlib/src/libgloss/sparc_leon/nocache.S @ 612

Last change on this file since 612 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 3.3 KB
Line 
1/*
2 * Copyright (c) 2011 Aeroflex Gaisler
3 *
4 * BSD license:
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24
25
26#include <asm-leon/elfmacro.h>
27#include <asm-leon/leon.h>
28#include <asm-leon/leonstack.h>
29#include <asm-leon/contextswitch.h>
30#include <asm-leon/winmacros.h>
31#include <asm-leon/leonbare_kernel.h>
32
33        FUNC_EXPORT(leonbare_leon23_loadnocache)
34        FUNC_EXPORT(leonbare_leon23_loadnocache16)
35        FUNC_EXPORT(leonbare_leon23_loadnocache8)
36
37        FUNC_EXPORT(leonbare_leon3_loadnocache)
38        FUNC_EXPORT(leonbare_leon3_loadnocache16)
39        FUNC_EXPORT(leonbare_leon3_loadnocache8)
40
41       
42        FUNC_EXPORT(leonbare_leon23_storenocache)
43        FUNC_EXPORT(leonbare_leon23_storenocache16)
44        FUNC_EXPORT(leonbare_leon23_storenocache8)
45       
46        FUNC_IMPORT(_leon_version)
47
48        .text
49
50/* =================================== */       
51/* LEON2 / 3 */
52/* load with forceing cache miss */     
53FUNC_BEGIN(leonbare_leon23_loadnocache)         /* use only %o0,%o1,%o7 */     
54        lda     [%o0] ASI_LEON3_CACHEMISS, %o0
55        retl
56         nop
57FUNC_END(leonbare_leon23_loadnocache)
58
59/* load with forceing cache miss */     
60FUNC_BEGIN(leonbare_leon23_loadnocache16)
61        lduha   [%o0] ASI_LEON3_CACHEMISS, %o0
62        retl
63         nop
64FUNC_END(leonbare_leon23_loadnocache16)
65
66/* load with forceing cache miss */     
67FUNC_BEGIN(leonbare_leon23_loadnocache8)
68        lduba   [%o0] ASI_LEON3_CACHEMISS, %o0
69        retl
70         nop
71FUNC_END(leonbare_leon23_loadnocache8)
72
73/* write through cache */
74FUNC_BEGIN(leonbare_leon23_storenocache)                /* use only %o0,%o1,%o7 */     
75        st      %o1, [%o0]
76        retl
77         mov    %o1,%o0
78FUNC_END(leonbare_leon23_storenocache)
79               
80/* write through cache */
81FUNC_BEGIN(leonbare_leon23_storenocache16)
82        sth     %o1, [%o0]
83        retl
84         mov    %o1,%o0
85FUNC_END(leonbare_leon23_storenocache16)
86
87/* write through cache */
88FUNC_BEGIN(leonbare_leon23_storenocache8)
89        stb     %o1, [%o0]
90        retl
91         mov    %o1,%o0
92FUNC_END(leonbare_leon23_storenocache8)
93
94
95
96/* =================================== */       
97/* LEON3 only */
98/* load with forceing cache miss */     
99FUNC_BEGIN(leonbare_leon3_loadnocache)          /* use only %o0,%o1,%o7 */     
100        retl
101         lda    [%o0] ASI_LEON3_CACHEMISS, %o0
102FUNC_END(leonbare_leon3_loadnocache)
103
104/* load with forceing cache miss */     
105FUNC_BEGIN(leonbare_leon3_loadnocache16)
106        retl
107         lduha  [%o0] ASI_LEON3_CACHEMISS, %o0
108FUNC_END(leonbare_leon3_loadnocache16)
109
110/* load with forceing cache miss */     
111FUNC_BEGIN(leonbare_leon3_loadnocache8)
112        retl
113         lduba  [%o0] ASI_LEON3_CACHEMISS, %o0
114FUNC_END(leonbare_leon3_loadnocache8)
115       
116
117       
Note: See TracBrowser for help on using the repository browser.