Subversion Repositories HelenOS

Rev

Rev 3022 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3022 Rev 4055
Line 45... Line 45...
45
#include <config.h>
45
#include <config.h>
46
#include <panic.h>
46
#include <panic.h>
47
#include <arch/asm.h>
47
#include <arch/asm.h>
48
#include <arch/barrier.h>
48
#include <arch/barrier.h>
49
#include <memstr.h>
49
#include <memstr.h>
-
 
50
#include <align.h>
50
 
51
 
51
static void set_environment(void);
52
static void set_environment(void);
52
 
53
 
53
/** Initialize ia64 virtual address translation subsystem. */
54
/** Initialize ia64 virtual address translation subsystem. */
54
void page_arch_init(void)
55
void page_arch_init(void)
Line 167... Line 168...
167
 * Interrupts must be disabled.
168
 * Interrupts must be disabled.
168
 *
169
 *
169
 * @param page Address of virtual page including VRN bits.
170
 * @param page      Address of virtual page including VRN bits.
170
 * @param asid Address space identifier.
171
 * @param asid      Address space identifier.
171
 *
172
 *
172
 * @return True if page and asid match the page and asid of t, false otherwise.
173
 * @return      True if page and asid match the page and asid of t,
-
 
174
 *          false otherwise.
173
 */
175
 */
174
bool vhpt_compare(uintptr_t page, asid_t asid, vhpt_entry_t *v)
176
bool vhpt_compare(uintptr_t page, asid_t asid, vhpt_entry_t *v)
175
{
177
{
176
    region_register rr_save, rr;   
178
    region_register rr_save, rr;   
177
    index_t vrn;
179
    index_t vrn;
Line 209... Line 211...
209
 
211
 
210
/** Set up one VHPT entry.
212
/** Set up one VHPT entry.
211
 *
213
 *
212
 * @param v VHPT entry to be set up.
214
 * @param v VHPT entry to be set up.
213
 * @param page Virtual address of the page mapped by the entry.
215
 * @param page      Virtual address of the page mapped by the entry.
214
 * @param asid Address space identifier of the address space to which page belongs.
216
 * @param asid      Address space identifier of the address space to which
-
 
217
 *          page belongs.
215
 * @param frame Physical address of the frame to wich page is mapped.
218
 * @param frame     Physical address of the frame to wich page is mapped.
216
 * @param flags Different flags for the mapping.
219
 * @param flags     Different flags for the mapping.
217
 */
220
 */
-
 
221
void
218
void vhpt_set_record(vhpt_entry_t *v, uintptr_t page, asid_t asid, uintptr_t frame, int flags)
222
vhpt_set_record(vhpt_entry_t *v, uintptr_t page, asid_t asid, uintptr_t frame,
-
 
223
    int flags)
219
{
224
{
220
    region_register rr_save, rr;   
225
    region_register rr_save, rr;   
221
    index_t vrn;
226
    index_t vrn;
222
    rid_t rid;
227
    rid_t rid;
223
    uint64_t tag;
228
    uint64_t tag;
Line 247... Line 252...
247
    v->word[1] = 0;
252
    v->word[1] = 0;
248
    v->word[2] = 0;
253
    v->word[2] = 0;
249
    v->word[3] = 0;
254
    v->word[3] = 0;
250
   
255
   
251
    v->present.p = true;
256
    v->present.p = true;
252
    v->present.ma = (flags & PAGE_CACHEABLE) ? MA_WRITEBACK : MA_UNCACHEABLE;
257
    v->present.ma = (flags & PAGE_CACHEABLE) ?
-
 
258
        MA_WRITEBACK : MA_UNCACHEABLE;
253
    v->present.a = false;   /* not accessed */
259
    v->present.a = false;   /* not accessed */
254
    v->present.d = false;   /* not dirty */
260
    v->present.d = false;   /* not dirty */
255
    v->present.pl = (flags & PAGE_USER) ? PL_USER : PL_KERNEL;
261
    v->present.pl = (flags & PAGE_USER) ? PL_USER : PL_KERNEL;
256
    v->present.ar = (flags & PAGE_WRITE) ? AR_WRITE : AR_READ;
262
    v->present.ar = (flags & PAGE_WRITE) ? AR_WRITE : AR_READ;
257
    v->present.ar |= (flags & PAGE_EXEC) ? AR_EXECUTE : 0;
263
    v->present.ar |= (flags & PAGE_EXEC) ? AR_EXECUTE : 0;
Line 260... Line 266...
260
    v->present.ps = PAGE_WIDTH;
266
    v->present.ps = PAGE_WIDTH;
261
    v->present.key = 0;
267
    v->present.key = 0;
262
    v->present.tag.tag_word = tag;
268
    v->present.tag.tag_word = tag;
263
}
269
}
264
 
270
 
-
 
271
uintptr_t hw_map(uintptr_t physaddr, size_t size __attribute__ ((unused)))
-
 
272
{
-
 
273
    /* THIS is a dirty hack. */
-
 
274
    return (uintptr_t)((uint64_t)(PA2KA(physaddr)) + VIO_OFFSET);
-
 
275
}
-
 
276
 
265
/** @}
277
/** @}
266
 */
278
 */