Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 1998 07:14:47 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        grog@lemis.com (Greg Lehey)
Cc:        tlambert@primenet.com, hackers@FreeBSD.ORG
Subject:   Re: Why no sys/setjmp.h?
Message-ID:  <199801170714.AAA26193@usr01.primenet.com>
In-Reply-To: <19980116123904.45753@lemis.com> from "Greg Lehey" at Jan 16, 98 12:39:04 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > In general, setjmp()/longjmp() prevent all sorts of optimizations
> > from being used.
> 
> In the kernel?

Anywhere.  It means that register variables can't be reused.  Specifically,
I can't assume a variable in a register won't be reused.

The best place to see the problem is in the gcc treatment of the
comment "/* NOTREACHED*/".

> I can't see a way of using them in this environment.  I'm in the top
> half of a driver, where things are more like in user space.

You can't use them between top half and bottom half.  That's the point.


> > Finally, the purpose of these functions is to allow the throwing of
> > exceptions, and the kernel has it's own exception mechanisms.
> 
> Which are?  That was my question.

I thought I answered this... tsleep/wakeup.


> So what are kernel setjmp and longjmp there for?

Mostly, to annoy the compiler.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801170714.AAA26193>