Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void trap (tf_t *tf)
- {
- // TODO
- uctx_pool[get_curid()] = *tf;
- set_pdir_base(0);
- if(tf->trapno >= T_DIVIDE && tf->trapno <= T_SECEV)
- {
- exception_handler();
- }
- else if(tf->trapno >= T_IRQ0 + IRQ_TIMER && tf->trapno <= T_IRQ0 + IRQ_IDE2)
- {
- interrupt_handler();
- }
- else if(tf->trapno == T_SYSCALL)
- {
- syscall_dispatch();
- }
- // Trap handled: call proc_start_user() to initiate return from trap.
- proc_start_user ();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement