Subversion Repositories HelenOS-historic

Rev

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

Rev 1270 Rev 1374
Line 106... Line 106...
106
        (1 << PAGE_CACHEABLE_SHIFT) |
106
        (1 << PAGE_CACHEABLE_SHIFT) |
107
        ((!p->p) << PAGE_PRESENT_SHIFT) |
107
        ((!p->p) << PAGE_PRESENT_SHIFT) |
108
        (1 << PAGE_USER_SHIFT) |
108
        (1 << PAGE_USER_SHIFT) |
109
        (1 << PAGE_READ_SHIFT) |
109
        (1 << PAGE_READ_SHIFT) |
110
        (1 << PAGE_WRITE_SHIFT) |
110
        (1 << PAGE_WRITE_SHIFT) |
111
        (1 << PAGE_EXEC_SHIFT)
111
        (1 << PAGE_EXEC_SHIFT) |
-
 
112
        (p->g << PAGE_GLOBAL_SHIFT)
112
    );
113
    );
113
}
114
}
114
 
115
 
115
static inline void set_pt_flags(pte_t *pt, index_t i, int flags)
116
static inline void set_pt_flags(pte_t *pt, index_t i, int flags)
116
{
117
{
117
    pte_t *p = &pt[i];
118
    pte_t *p = &pt[i];
118
   
119
   
119
    p->p = !(flags & PAGE_NOT_PRESENT);
120
    p->p = !(flags & PAGE_NOT_PRESENT);
-
 
121
    p->g = (flags & PAGE_GLOBAL) != 0;
120
    p->valid = 1;
122
    p->valid = 1;
121
}
123
}
122
 
124
 
123
extern void page_arch_init(void);
125
extern void page_arch_init(void);
124
 
126
 
-
 
127
#define PHT_BITS    16
-
 
128
#define PHT_ORDER   4
-
 
129
 
-
 
130
typedef struct {
-
 
131
    unsigned v : 1;          /**< Valid */
-
 
132
    unsigned vsid : 24;      /**< Virtual Segment ID */
-
 
133
    unsigned h : 1;          /**< Primary/secondary hash */
-
 
134
    unsigned api : 6;        /**< Abbreviated Page Index */
-
 
135
    unsigned rpn : 20;       /**< Real Page Number */
-
 
136
    unsigned reserved0 : 3;
-
 
137
    unsigned r : 1;          /**< Reference */
-
 
138
    unsigned c : 1;          /**< Change */
-
 
139
    unsigned wimg : 4;       /**< Access control */
-
 
140
    unsigned reserved1 : 1;
-
 
141
    unsigned pp : 2;         /**< Page protection */
-
 
142
} phte_t;
-
 
143
 
-
 
144
extern void pht_refill(bool data, istate_t *istate);
-
 
145
extern void pht_init(void);
-
 
146
 
125
#endif /* __ASM__ */
147
#endif /* __ASM__ */
126
 
148
 
127
#endif /* KERNEL */
149
#endif /* KERNEL */
128
 
150
 
129
#endif
151
#endif