Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2297 → Rev 2298

/branches/arm/kernel/arch/arm32/src/mm/page_fault.c
44,11 → 44,13
//TODO: remove in final version
static void print_istate(istate_t* istate);
static void print_istate(istate_t* istate) {
dprintf("\nIstate dump:\n");
dprintf(" r0:%X r1:%X r2:%X r3:%X\n", istate->r0, istate->r1, istate->r2, istate->r3);
dprintf(" r4:%X r5:%X r6:%X r7:%X\n", istate->r4, istate->r5, istate->r6, istate->r7);
dprintf(" r8:%X r8:%X r10:%X r11:%X\n", istate->r8, istate->r9, istate->r10, istate->r11);
dprintf(" r12:%X sp:%X lr:%X spsr:%X\n", istate->r12, istate->sp, istate->lr, istate->spsr);
dprintf("\nIstate dump:\n");
dprintf(" r0:%X r1:%X r2:%X r3:%X\n", istate->r0, istate->r1, istate->r2, istate->r3);
dprintf(" r4:%X r5:%X r6:%X r7:%X\n", istate->r4, istate->r5, istate->r6, istate->r7);
dprintf(" r8:%X r8:%X r10:%X r11:%X\n", istate->r8, istate->r9, istate->r10, istate->r11);
dprintf(" r12:%X sp:%X lr:%X spsr:%X\n", istate->r12, istate->sp, istate->lr, istate->spsr);
dprintf(" pc:%X\n", istate->pc);
}
 
/**
208,10 → 210,10
fault_status_t fsr = read_fault_status_register();
uintptr_t page = read_fault_address_register();
 
pf_access_t access = get_memmory_access_type( istate->lr, page);
pf_access_t access = get_memmory_access_type( istate->pc, page);
 
// print_istate(istate);
dprintf(" page fault : ip:%X, va:%X, status:%x(%x), access:%d\n", istate->lr, page, fsr.status,fsr, access);
dprintf(" page fault : ip:%X, va:%X, status:%x(%x), access:%d\n", istate->pc, page, fsr.status,fsr, access);
 
/* Alf: Will be commented until stack problem will be solved ...
as_page_fault make consequent page faults*/
220,12 → 222,11
dprintf(" as_page_fault ret:%d\n", ret);
if (ret == AS_PF_FAULT) {
fault_if_from_uspace(istate, "Page fault: %#x", page);
 
panic("page fault\n");
panic("page fault\n");
}
 
// TODO: Remove this ... now for testing purposes ... it's bad to test page faults in kernel, where no page faults should occures
panic("page fault ... solved\n");
// panic("page fault ... solved\n");
 
}
 
236,21 → 237,20
* \param n number of exception
*/
void prefetch_abort(int n, istate_t *istate) {
// Prefetch can be made be bkpt instruction
print_istate(istate);
dprintf(" prefetch_abourt ... instruction on adress:%x can't be fetched\n", istate->lr);
dprintf(" prefetch_abourt ... instruction on adress:%x can't be fetched\n", istate->pc);
 
/* Alf: Will be commented until stack problem will be solved ...
as_page_fault make consequent page faults*/
 
int ret = as_page_fault(istate->lr, PF_ACCESS_EXEC, istate);
int ret = as_page_fault(istate->pc, PF_ACCESS_EXEC, istate);
dprintf(" as_page_fault ret:%d\n", ret);
if (ret == AS_PF_FAULT) {
panic("page fault - instruction fetch at addr:%X\n", istate->lr);
panic("page fault - instruction fetch at addr:%X\n", istate->pc);
}
 
 
panic("Prefetch abourt ... solved");
// panic("Prefetch abourt ... solved");
}
 
/** @}