Subversion Repositories HelenOS-historic

Rev

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

Rev 534 Rev 569
Line 28... Line 28...
28
 
28
 
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>
-
 
34
#include <arch/types.h>
-
 
35
#include <typedefs.h>
-
 
36
 
-
 
37
#define ITLB_ENTRY_COUNT        64
-
 
38
#define DTLB_ENTRY_COUNT        64
33
 
39
 
34
/** I-MMU ASIs. */
40
/** I-MMU ASIs. */
35
#define ASI_IMMU            0x50
41
#define ASI_IMMU            0x50
36
#define ASI_IMMU_TSB_8KB_PTR_REG    0x51    
42
#define ASI_IMMU_TSB_8KB_PTR_REG    0x51    
37
#define ASI_IMMU_TSB_64KB_PTR_REG   0x52
43
#define ASI_IMMU_TSB_64KB_PTR_REG   0x52
Line 68... Line 74...
68
#define VA_DMMU_PA_WATCHPOINT_REG   0x40    /**< DMMU PA data watchpoint register. */
74
#define VA_DMMU_PA_WATCHPOINT_REG   0x40    /**< DMMU PA data watchpoint register. */
69
 
75
 
70
/** I-/D-TLB Data In/Access Register type. */
76
/** I-/D-TLB Data In/Access Register type. */
71
typedef tte_data_t tlb_data_t;
77
typedef tte_data_t tlb_data_t;
72
 
78
 
-
 
79
/** I-/D-TLB Data Access Address in Alternate Space. */
-
 
80
union tlb_data_access_addr {
-
 
81
    __u64 value;
-
 
82
    struct {
-
 
83
        __u64 : 55;
73
#define tlb_init_arch()
84
        unsigned tlb_entry : 6;
-
 
85
        unsigned : 3;
-
 
86
    } __attribute__ ((packed));
-
 
87
};
-
 
88
typedef union tlb_data_access_addr tlb_data_access_addr_t;
-
 
89
typedef union tlb_data_access_addr tlb_tag_read_addr_t;
-
 
90
 
-
 
91
/** I-/D-TLB Tag Read Register. */
-
 
92
union tlb_tag_read_reg {
-
 
93
    __u64 value;
-
 
94
    struct {
-
 
95
        __u64 va : 51;      /**< Virtual Address. */
-
 
96
        unsigned context : 13;  /**< Context identifier. */
-
 
97
    } __attribute__ ((packed));
-
 
98
};
-
 
99
typedef union tlb_tag_read_reg tlb_tag_read_reg_t;
-
 
100
 
-
 
101
/** Read IMMU TLB Data Access Register.
-
 
102
 *
-
 
103
 * @param entry TLB Entry index.
-
 
104
 *
-
 
105
 * @return Current value of specified IMMU TLB Data Access Register.
-
 
106
 */
-
 
107
static inline __u64 itlb_data_access_read(index_t entry)
-
 
108
{
-
 
109
    tlb_data_access_addr_t reg;
-
 
110
   
-
 
111
    reg.value = 0;
-
 
112
    reg.tlb_entry = entry;
-
 
113
    return asi_u64_read(ASI_ITLB_DATA_ACCESS_REG, reg.value);
-
 
114
}
-
 
115
 
-
 
116
/** Read DMMU TLB Data Access Register.
-
 
117
 *
-
 
118
 * @param entry TLB Entry index.
-
 
119
 *
-
 
120
 * @return Current value of specified DMMU TLB Data Access Register.
-
 
121
 */
-
 
122
static inline __u64 dtlb_data_access_read(index_t entry)
-
 
123
{
-
 
124
    tlb_data_access_addr_t reg;
-
 
125
   
-
 
126
    reg.value = 0;
-
 
127
    reg.tlb_entry = entry;
-
 
128
    return asi_u64_read(ASI_DTLB_DATA_ACCESS_REG, reg.value);
-
 
129
}
-
 
130
 
-
 
131
/** Read IMMU TLB Tag Read Register.
-
 
132
 *
-
 
133
 * @param entry TLB Entry index.
-
 
134
 *
-
 
135
 * @return Current value of specified IMMU TLB Tag Read Register.
-
 
136
 */
-
 
137
static inline __u64 itlb_tag_read(index_t entry)
-
 
138
{
-
 
139
    tlb_tag_read_addr_t tag;
-
 
140
 
-
 
141
    tag.value = 0;
-
 
142
    tag.tlb_entry = entry;
-
 
143
    return asi_u64_read(ASI_ITLB_TAG_READ_REG, tag.value);
-
 
144
}
-
 
145
 
-
 
146
/** Read DMMU TLB Tag Read Register.
-
 
147
 *
-
 
148
 * @param entry TLB Entry index.
-
 
149
 *
-
 
150
 * @return Current value of specified DMMU TLB Tag Read Register.
-
 
151
 */
-
 
152
static inline __u64 dtlb_tag_read(index_t entry)
-
 
153
{
-
 
154
    tlb_tag_read_addr_t tag;
-
 
155
 
-
 
156
    tag.value = 0;
-
 
157
    tag.tlb_entry = entry;
-
 
158
    return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value);
-
 
159
}
74
 
160
 
75
#endif
161
#endif