Re: exception handling in kernel code

On Monday 14 August 2006 02:46, Stanislav Sedov wrote:

I'm trying to write kernel code where exceptions are unavoidable.
To clarify , I need to recover after GP (general protection) exception
on i386 cpu and return an error in that case.
Unfortunately, looking in trap.c kernel code I can't find any exception
handling mechanism except inserting hooks into trap.c.

So, the question is: how can one recover after exception in kernel
code? AFAIK, linux build special exception table from various __ex_table
sections to allow placing recover code into .fixup section. Does any such
mechanism exists in freebsd?


You can make use of pcb_onfault to recover from a page fault, but that's
about it. Kernel code is expected to not generate exceptions. :)

John Baldwin
freebsd-hackers@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"