Files
mkrtos-real/mkrtos_knl/arch/aarch64/thread_armv8.c
2024-03-31 16:06:11 +00:00

57 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <types.h>
#include <task.h>
#include <thread.h>
umword_t thread_get_pfa(void)
{
umword_t a;
asm volatile("mrs %0, far_el2" : "=r"(a));
return a;
}
void thread_sync_entry(entry_frame_t *regs)
{
umword_t ec = 0;
// umword_t ec = arm_esr_ec(esr_get());
// thread_t *th = thread_current();
// task_t *tk = (task_t *)th->task;
switch (ec)
{
case 0x20:
{
// mword_t addr = thread_get_pfa();
// if (vma_page_fault(&tk->vmam, &tk->mem_dir, MASK_LSB(addr, PAGE_SHIFT)) == NULL) {
// //TODO: 如果是init进程则内核死机否则干掉进程
// MKRTOS_ASSERT(0);
// }
}
return;
case 0x24:
{
// mword_t addr = thread_get_pfa();
// if (vma_page_fault(&tk->vmam, &tk->mem_dir, MASK_LSB(addr, PAGE_SHIFT)) == NULL) {
// //TODO: 如果是init进程则内核死机否则干掉进程
// MKRTOS_ASSERT(0);
// }
}
return;
case 0x12:
case 0x11:
case 0x15:
case 0x16:
// svc_handler(regs);
return;
case 0x00:
return;
case 0x07:
break;
case 0x03:
default:
break;
}
}