Subversion Repositories HelenOS

Rev

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

Rev 399 Rev 403
Line 28... Line 28...
28
 
28
 
29
#ifndef __mips32_TLB_H__
29
#ifndef __mips32_TLB_H__
30
#define __mips32_TLB_H__
30
#define __mips32_TLB_H__
31
 
31
 
32
#include <arch/exception.h>
32
#include <arch/exception.h>
-
 
33
#include <typedefs.h>
33
 
34
 
34
#define TLB_SIZE    48
35
#define TLB_SIZE    48
35
 
36
 
36
#define TLB_WIRED       1
37
#define TLB_WIRED       1
37
#define TLB_KSTACK_WIRED_INDEX  0
38
#define TLB_KSTACK_WIRED_INDEX  0
Line 39... Line 40...
39
#define TLB_PAGE_MASK_16K   (0x3<<13)
40
#define TLB_PAGE_MASK_16K   (0x3<<13)
40
 
41
 
41
#define PAGE_UNCACHED           2
42
#define PAGE_UNCACHED           2
42
#define PAGE_CACHEABLE_EXC_WRITE    5
43
#define PAGE_CACHEABLE_EXC_WRITE    5
43
 
44
 
-
 
45
typedef union entry_lo entry_lo_t;
-
 
46
typedef union entry_hi entry_hi_t;
-
 
47
typedef union page_mask page_mask_t;
-
 
48
typedef union index tlb_index_t;
-
 
49
 
44
union entry_lo {
50
union entry_lo {
45
    struct {
51
    struct {
46
        unsigned g : 1;     /* global bit */
52
        unsigned g : 1;     /* global bit */
47
        unsigned v : 1;     /* valid bit */
53
        unsigned v : 1;     /* valid bit */
48
        unsigned d : 1;     /* dirty/write-protect bit */
54
        unsigned d : 1;     /* dirty/write-protect bit */
Line 51... Line 57...
51
        unsigned : 2;       /* zero */
57
        unsigned : 2;       /* zero */
52
    } __attribute__ ((packed));
58
    } __attribute__ ((packed));
53
    __u32 value;
59
    __u32 value;
54
};
60
};
55
 
61
 
56
struct pte {
62
union pte {
57
    unsigned g : 1;     /* global bit */
63
    entry_lo_t lo;
58
    unsigned v : 1;     /* valid bit */
64
    struct {
59
    unsigned d : 1;     /* dirty/write-protect bit */
-
 
60
    unsigned c : 3;     /* cache coherency attribute */
-
 
61
    unsigned pfn : 24;  /* frame number */
65
        unsigned : 30;
62
    unsigned w : 1;     /* writable */
66
        unsigned w : 1;     /* writable */
63
    unsigned a : 1;     /* accessed */
67
        unsigned a : 1;     /* accessed */
64
} __attribute__ ((packed));
68
    } __attribute__ ((packed));
-
 
69
};
65
 
70
 
66
union entry_hi {
71
union entry_hi {
67
    struct {
72
    struct {
68
        unsigned asid : 8;
73
        unsigned asid : 8;
69
        unsigned : 5;
74
        unsigned : 5;
Line 88... Line 93...
88
        unsigned p : 1;
93
        unsigned p : 1;
89
    } __attribute__ ((packed));
94
    } __attribute__ ((packed));
90
    __u32 value;
95
    __u32 value;
91
};
96
};
92
 
97
 
93
typedef union entry_lo entry_lo_t;
-
 
94
typedef union entry_hi entry_hi_t;
-
 
95
typedef union page_mask page_mask_t;
-
 
96
typedef union index tlb_index_t;
-
 
97
 
-
 
98
/** Probe TLB for Matching Entry
98
/** Probe TLB for Matching Entry
99
 *
99
 *
100
 * Probe TLB for Matching Entry.
100
 * Probe TLB for Matching Entry.
101
 */
101
 */
102
static inline void tlbp(void)
102
static inline void tlbp(void)