Subversion Repositories HelenOS

Rev

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

Rev 3788 Rev 3790
Line 140... Line 140...
140
 
140
 
141
    instruction_t instr = *(instr_union.instr);
141
    instruction_t instr = *(instr_union.instr);
142
 
142
 
143
    /* undefined instructions */
143
    /* undefined instructions */
144
    if (instr.condition == 0xf) {
144
    if (instr.condition == 0xf) {
145
        panic("page_fault - instruction doesn't access memory "
145
        panic("page_fault - instruction does not access memory "
146
            "(instr_code: %x, badvaddr:%x)", instr, badvaddr);
146
            "(instr_code: %x, badvaddr:%x).", instr, badvaddr);
147
        return PF_ACCESS_EXEC;
147
        return PF_ACCESS_EXEC;
148
    }
148
    }
149
 
149
 
150
    /* load store instructions */
150
    /* load store instructions */
151
    if (is_load_store_instruction(instr)) {
151
    if (is_load_store_instruction(instr)) {
Line 160... Line 160...
160
    if (is_swap_instruction(instr)) {
160
    if (is_swap_instruction(instr)) {
161
        return PF_ACCESS_WRITE;
161
        return PF_ACCESS_WRITE;
162
    }
162
    }
163
 
163
 
164
    panic("page_fault - instruction doesn't access memory "
164
    panic("page_fault - instruction doesn't access memory "
165
        "(instr_code: %x, badvaddr:%x)", instr, badvaddr);
165
        "(instr_code: %x, badvaddr:%x).", instr, badvaddr);
166
 
166
 
167
    return PF_ACCESS_EXEC;
167
    return PF_ACCESS_EXEC;
168
}
168
}
169
 
169
 
170
/** Handles "data abort" exception (load or store at invalid address).
170
/** Handles "data abort" exception (load or store at invalid address).
Line 186... Line 186...
186
        print_istate(istate);
186
        print_istate(istate);
187
        dprintf("page fault - pc: %x, va: %x, status: %x(%x), "
187
        dprintf("page fault - pc: %x, va: %x, status: %x(%x), "
188
            "access:%d\n", istate->pc, badvaddr, fsr.status, fsr,
188
            "access:%d\n", istate->pc, badvaddr, fsr.status, fsr,
189
            access);
189
            access);
190
 
190
 
191
        fault_if_from_uspace(istate, "Page fault: %#x", badvaddr);
191
        fault_if_from_uspace(istate, "Page fault: %#x.", badvaddr);
192
        panic("Page fault\n");
192
        panic("Page fault.");
193
    }
193
    }
194
}
194
}
195
 
195
 
196
/** Handles "prefetch abort" exception (instruction couldn't be executed).
196
/** Handles "prefetch abort" exception (instruction couldn't be executed).
197
 *
197
 *
Line 203... Line 203...
203
    int ret = as_page_fault(istate->pc, PF_ACCESS_EXEC, istate);
203
    int ret = as_page_fault(istate->pc, PF_ACCESS_EXEC, istate);
204
 
204
 
205
    if (ret == AS_PF_FAULT) {
205
    if (ret == AS_PF_FAULT) {
206
        dprintf("prefetch_abort\n");
206
        dprintf("prefetch_abort\n");
207
        print_istate(istate);
207
        print_istate(istate);
208
        panic("page fault - prefetch_abort at address: %x\n",
208
        panic("page fault - prefetch_abort at address: %x.",
209
            istate->pc);
209
            istate->pc);
210
    }
210
    }
211
}
211
}
212
 
212
 
213
/** @}
213
/** @}