[okl4-developer] Exception handling in L4
Jorge Torres
jorge.torres.maldonado at gmail.com
Tue Oct 23 23:53:27 EST 2007
Hi,
You can fix that send_excemption_ipc() hack like this:
static void send_exception_ipc(ia32_exceptionframe_t * frame, word_t
exception, continuation_t continuation)
{
tcb_t * current = get_current_tcb();
if (current->get_exception_handler().is_nilthread())
ACTIVATE_CONTINUATION(continuation);
current->arch.exception_ipc_continuation = continuation;
TRACEPOINT_TB (EXCEPTION_IPC,
printf ("exception ipc at %x, %T (%p) -> %T \n",
frame->eip, current->get_global_id().get_raw(),
current, current->get_exception_handler().get_raw()),
"exception_ipc at %x (current=%p)", frame->eip,
(u32_t)current);
/* setup exception IPC */
msg_tag_t tag;
// save message registers
for (int i = 0; i < 13; i++)
current->arch.saved_mr[i] = current->get_mr(i);
current->misc.ipc_copy.saved_notify_mask = current->get_notify_mask ();
current->set_saved_partner (current->get_partner());
current->set_saved_state (current->get_state());
tag.set(12, -5 << 4, true, true);
current->set_mr(0, tag.raw);
current->set_mr(1, frame->eip);
current->set_mr(2, frame->eflags);
current->set_mr(3, exception);
current->set_mr(4, frame->error);
current->set_mr(5, frame->edi);
current->set_mr(6, frame->esi);
current->set_mr(7, frame->ebp);
current->set_mr(8, frame->esp);
current->set_mr(9, frame->ebx);
current->set_mr(10, frame->edx);
current->set_mr(11, frame->ecx);
current->set_mr(12, frame->eax);
current->do_ipc(current->get_exception_handler(),
current->get_exception_handler(), finish_exception_ipc);
}
On 10/23/07, Geoffrey Lee <glee at ok-labs.com> wrote:
>
> On Tue, Oct 23, 2007 at 05:03:35PM +0530, Kalamkar, Dhiraj D wrote:
> > Hi,
> >
> >
> >
> > I am wondering why exception messages are sent to scheduler thread than
> > an exception handler thread in L4 microkernel (exception.cc).
>
> Hi
>
> are you working on the ia-32 release?
>
> Carl's explanation for this is given here:
>
> http://lists.okl4.org/pipermail/developer/2007-July/000246.html
>
> >
> > Also, as scheduler is set to thread's own thread id, isn't there any way
> > to handle exceptions for iguana threads?
> >
>
> Yes, if the scheduler is used then it is a problem.
>
> - gl
> >
> >
> > Thanks,
> >
> > Dhiraj Kalamkar
> >
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20071023/ca0d2f9b/attachment.htm
More information about the Developer
mailing list