1
2
3
4
5
6
7
8
9
10
11
12#ifndef _XTENSA_CORE_TIE_ASM_H
13#define _XTENSA_CORE_TIE_ASM_H
14
15
16
17#define XTHAL_SAS_TIE 0x0001
18#define XTHAL_SAS_OPT 0x0002
19#define XTHAL_SAS_ANYOT 0x0003
20
21#define XTHAL_SAS_NOCC 0x0004
22#define XTHAL_SAS_CC 0x0008
23#define XTHAL_SAS_ANYCC 0x000C
24
25#define XTHAL_SAS_CALR 0x0010
26#define XTHAL_SAS_CALE 0x0020
27#define XTHAL_SAS_GLOB 0x0040
28#define XTHAL_SAS_ANYABI 0x0070
29
30#define XTHAL_SAS_ALL 0xFFFF
31#define XTHAL_SAS3(optie,ccuse,abi) ( ((optie) & XTHAL_SAS_ANYOT) \
32 | ((ccuse) & XTHAL_SAS_ANYCC) \
33 | ((abi) & XTHAL_SAS_ANYABI) )
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
58 xchal_sa_start \continue, \ofs
59
60 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select)
61 xchal_sa_align \ptr, 0, 1020, 4, 4
62 rur.THREADPTR \at1
63 s32i \at1, \ptr, .Lxchal_ofs_+0
64 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
65 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
66 xchal_sa_align \ptr, 0, 1020, 4, 4
67 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
68 .endif
69
70 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select)
71 xchal_sa_align \ptr, 0, 1016, 4, 4
72 rsr \at1, ACCLO
73 s32i \at1, \ptr, .Lxchal_ofs_+0
74 rsr \at1, ACCHI
75 s32i \at1, \ptr, .Lxchal_ofs_+4
76 .set .Lxchal_ofs_, .Lxchal_ofs_ + 8
77 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
78 xchal_sa_align \ptr, 0, 1016, 4, 4
79 .set .Lxchal_ofs_, .Lxchal_ofs_ + 8
80 .endif
81
82 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)
83 xchal_sa_align \ptr, 0, 1004, 4, 4
84 rsr \at1, M0
85 s32i \at1, \ptr, .Lxchal_ofs_+0
86 rsr \at1, M1
87 s32i \at1, \ptr, .Lxchal_ofs_+4
88 rsr \at1, M2
89 s32i \at1, \ptr, .Lxchal_ofs_+8
90 rsr \at1, M3
91 s32i \at1, \ptr, .Lxchal_ofs_+12
92 rsr \at1, SCOMPARE1
93 s32i \at1, \ptr, .Lxchal_ofs_+16
94 .set .Lxchal_ofs_, .Lxchal_ofs_ + 20
95 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
96 xchal_sa_align \ptr, 0, 1004, 4, 4
97 .set .Lxchal_ofs_, .Lxchal_ofs_ + 20
98 .endif
99 .endm
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0
122 xchal_sa_start \continue, \ofs
123
124 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select)
125 xchal_sa_align \ptr, 0, 1020, 4, 4
126 l32i \at1, \ptr, .Lxchal_ofs_+0
127 wur.THREADPTR \at1
128 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
129 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0
130 xchal_sa_align \ptr, 0, 1020, 4, 4
131 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
132 .endif
133
134 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select)
135 xchal_sa_align \ptr, 0, 1016, 4, 4
136 l32i \at1, \ptr, .Lxchal_ofs_+0
137 wsr \at1, ACCLO
138 l32i \at1, \ptr, .Lxchal_ofs_+4
139 wsr \at1, ACCHI
140 .set .Lxchal_ofs_, .Lxchal_ofs_ + 8
141 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
142 xchal_sa_align \ptr, 0, 1016, 4, 4
143 .set .Lxchal_ofs_, .Lxchal_ofs_ + 8
144 .endif
145
146 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)
147 xchal_sa_align \ptr, 0, 1004, 4, 4
148 l32i \at1, \ptr, .Lxchal_ofs_+0
149 wsr \at1, M0
150 l32i \at1, \ptr, .Lxchal_ofs_+4
151 wsr \at1, M1
152 l32i \at1, \ptr, .Lxchal_ofs_+8
153 wsr \at1, M2
154 l32i \at1, \ptr, .Lxchal_ofs_+12
155 wsr \at1, M3
156 l32i \at1, \ptr, .Lxchal_ofs_+16
157 wsr \at1, SCOMPARE1
158 .set .Lxchal_ofs_, .Lxchal_ofs_ + 20
159 .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0
160 xchal_sa_align \ptr, 0, 1004, 4, 4
161 .set .Lxchal_ofs_, .Lxchal_ofs_ + 20
162 .endif
163 .endm
164
165
166#define XCHAL_NCP_NUM_ATMPS 1
167
168
169
170#define XCHAL_SA_NUM_ATMPS 1
171
172#endif
173
174