Subversion Repositories HelenOS

Rev

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

Rev 873 Rev 877
Line 29... Line 29...
29
#include <arch/mm/tlb.h>
29
#include <arch/mm/tlb.h>
30
#include <mm/tlb.h>
30
#include <mm/tlb.h>
31
#include <arch/mm/frame.h>
31
#include <arch/mm/frame.h>
32
#include <arch/mm/page.h>
32
#include <arch/mm/page.h>
33
#include <arch/mm/mmu.h>
33
#include <arch/mm/mmu.h>
-
 
34
#include <mm/asid.h>
34
#include <print.h>
35
#include <print.h>
35
#include <arch/types.h>
36
#include <arch/types.h>
36
#include <typedefs.h>
37
#include <typedefs.h>
37
#include <config.h>
38
#include <config.h>
38
#include <arch/trap/trap.h>
39
#include <arch/trap/trap.h>
Line 72... Line 73...
72
    dmmu_disable();
73
    dmmu_disable();
73
   
74
   
74
    /*
75
    /*
75
     * We do identity mapping of 4M-page at 4M.
76
     * We do identity mapping of 4M-page at 4M.
76
     */
77
     */
77
    tag.value = 0;
78
    tag.value = ASID_KERNEL;
78
    tag.vpn = pg.vpn;
79
    tag.vpn = pg.vpn;
79
 
80
 
80
    itlb_tag_access_write(tag.value);
81
    itlb_tag_access_write(tag.value);
81
    dtlb_tag_access_write(tag.value);
82
    dtlb_tag_access_write(tag.value);
82
 
83
 
Line 110... Line 111...
110
     * Quick hack: map frame buffer
111
     * Quick hack: map frame buffer
111
     */
112
     */
112
    fr.address = 0x1C901000000ULL;
113
    fr.address = 0x1C901000000ULL;
113
    pg.address = 0xc0000000;
114
    pg.address = 0xc0000000;
114
 
115
 
115
    tag.value = 0;
116
    tag.value = ASID_KERNEL;
116
    tag.vpn = pg.vpn;
117
    tag.vpn = pg.vpn;
117
 
118
 
118
    dtlb_tag_access_write(tag.value);
119
    dtlb_tag_access_write(tag.value);
119
 
120
 
120
    data.value = 0;
121
    data.value = 0;
Line 139... Line 140...
139
}
140
}
140
 
141
 
141
/** DTLB miss handler. */
142
/** DTLB miss handler. */
142
void fast_data_access_mmu_miss(void)
143
void fast_data_access_mmu_miss(void)
143
{
144
{
144
    tlb_sfsr_reg_t status;
145
    tlb_tag_access_reg_t tag;
-
 
146
    tlb_data_t data;
145
    __address address, tpc;
147
    __address tpc;
146
    char *tpc_str;
148
    char *tpc_str;
147
   
149
   
148
    status.value = dtlb_sfsr_read();
150
    tag.value = dtlb_tag_access_read();
149
    address = dtlb_sfar_read();
151
    if (tag.context != ASID_KERNEL || tag.vpn == 0) {
150
    tpc = tpc_read();
152
        tpc = tpc_read();
151
    tpc_str = get_symtab_entry(tpc);
153
        tpc_str = get_symtab_entry(tpc);
152
 
154
 
153
    printf("ASI=%B, Context=%s\n", status.asi, context_encoding[status.ct]);
-
 
154
    printf("Faulting address: %P\n", dtlb_sfar_read());
155
        printf("Faulting page: %P, ASID=%d\n", tag.vpn * PAGE_SIZE, tag.context);
155
    printf("TPC=%P, (%s)\n", tpc, tpc_str ? tpc_str : "?");
156
        printf("TPC=%P, (%s)\n", tpc, tpc_str ? tpc_str : "?");
156
    panic("%s\n", __FUNCTION__);
157
        panic("%s\n", __FUNCTION__);
-
 
158
    }
-
 
159
 
-
 
160
    /*
-
 
161
     * Identity map piece of faulting kernel address space.
-
 
162
     */
-
 
163
    data.value = 0;
-
 
164
    data.v = true;
-
 
165
    data.size = PAGESIZE_8K;
-
 
166
    data.pfn = tag.vpn;
-
 
167
    data.l = false;
-
 
168
    data.cp = 1;
-
 
169
    data.cv = 1;
-
 
170
    data.p = true;
-
 
171
    data.w = true;
-
 
172
    data.g = true;
-
 
173
 
-
 
174
    dtlb_data_in_write(data.value);
157
}
175
}
158
 
176
 
159
/** DTLB protection fault handler. */
177
/** DTLB protection fault handler. */
160
void fast_data_access_protection(void)
178
void fast_data_access_protection(void)
161
{
179
{