Date: Mon, 14 Aug 2006 09:32:57 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: Stanislav Sedov <ssedov@mbsd.msk.ru> Subject: Re: exception handling in kernel code Message-ID: <200608140932.57875.jhb@freebsd.org> In-Reply-To: <20060814124658.1d416cbe@localhost> References: <20060814124658.1d416cbe@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 14 August 2006 02:46, Stanislav Sedov wrote: > Hi! > > 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? > > Thanks! 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608140932.57875.jhb>