Subversion Repositories HelenOS

Rev

Rev 569 | Rev 617 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 569 Rev 613
Line 29... Line 29...
29
#ifndef __sparc64_TLB_H__
29
#ifndef __sparc64_TLB_H__
30
#define __sparc64_TLB_H__
30
#define __sparc64_TLB_H__
31
 
31
 
32
#include <arch/mm/tte.h>
32
#include <arch/mm/tte.h>
33
#include <arch/asm.h>
33
#include <arch/asm.h>
-
 
34
#include <arch/barrier.h>
34
#include <arch/types.h>
35
#include <arch/types.h>
35
#include <typedefs.h>
36
#include <typedefs.h>
36
 
37
 
37
#define ITLB_ENTRY_COUNT        64
38
#define ITLB_ENTRY_COUNT        64
38
#define DTLB_ENTRY_COUNT        64
39
#define DTLB_ENTRY_COUNT        64
Line 95... Line 96...
95
        __u64 va : 51;      /**< Virtual Address. */
96
        __u64 va : 51;      /**< Virtual Address. */
96
        unsigned context : 13;  /**< Context identifier. */
97
        unsigned context : 13;  /**< Context identifier. */
97
    } __attribute__ ((packed));
98
    } __attribute__ ((packed));
98
};
99
};
99
typedef union tlb_tag_read_reg tlb_tag_read_reg_t;
100
typedef union tlb_tag_read_reg tlb_tag_read_reg_t;
-
 
101
typedef union tlb_tag_read_reg tlb_tag_access_reg_t;
100
 
102
 
101
/** Read IMMU TLB Data Access Register.
103
/** Read IMMU TLB Data Access Register.
102
 *
104
 *
103
 * @param entry TLB Entry index.
105
 * @param entry TLB Entry index.
104
 *
106
 *
Line 132... Line 134...
132
 *
134
 *
133
 * @param entry TLB Entry index.
135
 * @param entry TLB Entry index.
134
 *
136
 *
135
 * @return Current value of specified IMMU TLB Tag Read Register.
137
 * @return Current value of specified IMMU TLB Tag Read Register.
136
 */
138
 */
137
static inline __u64 itlb_tag_read(index_t entry)
139
static inline __u64 itlb_tag_read_read(index_t entry)
138
{
140
{
139
    tlb_tag_read_addr_t tag;
141
    tlb_tag_read_addr_t tag;
140
 
142
 
141
    tag.value = 0;
143
    tag.value = 0;
142
    tag.tlb_entry = entry;
144
    tag.tlb_entry = entry;
Line 147... Line 149...
147
 *
149
 *
148
 * @param entry TLB Entry index.
150
 * @param entry TLB Entry index.
149
 *
151
 *
150
 * @return Current value of specified DMMU TLB Tag Read Register.
152
 * @return Current value of specified DMMU TLB Tag Read Register.
151
 */
153
 */
152
static inline __u64 dtlb_tag_read(index_t entry)
154
static inline __u64 dtlb_tag_read_read(index_t entry)
153
{
155
{
154
    tlb_tag_read_addr_t tag;
156
    tlb_tag_read_addr_t tag;
155
 
157
 
156
    tag.value = 0;
158
    tag.value = 0;
157
    tag.tlb_entry = entry;
159
    tag.tlb_entry = entry;
158
    return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value);
160
    return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value);
159
}
161
}
160
 
162
 
-
 
163
/** Write IMMU TLB Tag Access Register.
-
 
164
 *
-
 
165
 * @param v Value to be written.
-
 
166
 */
-
 
167
static inline void itlb_tag_access_write(__u64 v)
-
 
168
{
-
 
169
    asi_u64_write(ASI_IMMU, VA_IMMU_TAG_ACCESS, v);
-
 
170
    flush();
-
 
171
}
-
 
172
 
-
 
173
/** Write DMMU TLB Tag Access Register.
-
 
174
 *
-
 
175
 * @param v Value to be written.
-
 
176
 */
-
 
177
static inline void dtlb_tag_access_write(__u64 v)
-
 
178
{
-
 
179
    asi_u64_write(ASI_DMMU, VA_DMMU_TAG_ACCESS, v);
-
 
180
    flush();
-
 
181
}
-
 
182
 
-
 
183
/** Write IMMU TLB Data in Register.
-
 
184
 *
-
 
185
 * @param v Value to be written.
-
 
186
 */
-
 
187
static inline void itlb_data_in_write(__u64 v)
-
 
188
{
-
 
189
    asi_u64_write(ASI_ITLB_DATA_IN_REG, 0, v);
-
 
190
    flush();
-
 
191
}
-
 
192
 
-
 
193
/** Write DMMU TLB Data in Register.
-
 
194
 *
-
 
195
 * @param v Value to be written.
-
 
196
 */
-
 
197
static inline void dtlb_data_in_write(__u64 v)
-
 
198
{
-
 
199
    asi_u64_write(ASI_DTLB_DATA_IN_REG, 0, v);
-
 
200
    flush();
-
 
201
}
-
 
202
 
161
#endif
203
#endif