Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2000 14:48:03 +1030
From:      Greg Lehey <grog@lemis.com>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Jake Burkholder <jburkhol@home.com>, smp@FreeBSD.ORG
Subject:   Re: BSD/OS interrupt code
Message-ID:  <20001128144803.C36542@echunga.lemis.com>
In-Reply-To: <XFMail.001127103305.jhb@FreeBSD.org>; from jhb@FreeBSD.ORG on Mon, Nov 27, 2000 at 10:33:05AM -0800
References:  <20001126220749.BFB35BA7A@io.yi.org> <XFMail.001127103305.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 27 November 2000 at 10:33:05 -0800, John Baldwin wrote:
>
> On 26-Nov-00 Jake Burkholder wrote:
>> Hi,
>>
>> If anyone with access to the BSD/OS code is interested, I've written
>> a little program that runs their interrupt stub code generator in
>> userland.  You can then abort(); and disassemble the stub from
>> the core dump to look at the code all in one piece.  Makes it much
>> easier to follow.
>>
>> In case you haven't looked, their interrupt handlers are generated
>> by bcopy-ing various blocks of assembler code into an array at
>> runtime, and then poking in arguments and relocating branches.
>
> Hmm.  The best way to do this probably is to have stubs with psuedo-relocation
> information.  I.e., have 1 stub interrupt handler template for each type (fast,
> threaded, fast apic, threaded apic, etc.), then have a "relocation" table on
> the side that specifies offsets in the code that should receive one of a number
> of things: vector number, vector address, etc.  Alternatively, we could store
> all of that info in a struct (gee, we already do with intrhand :)) and just
> have the code always dereference a pointer to that struct and have the
> relocation entries simply point to places that that pointer should be written.
> Granted, on sparc this could get much uglier (based on my understanding of
> relocation address on sparc since an address can be formed across several
> instructions.  Yuck.)

I assume you're talking about doing this at run time, presumably from
a function like inthand_add.  This is a nice, structured way to do
things.  One of the parameters might be the type of interrupt, so
instead of three stubs for each possible interrupt, we'd only have
one.  Why didn't we do that from the start?  Because it's slower.  No,
I haven't tried to prove this, but I'm pretty sure you'd have
difficulties getting it small enough.

One alternative would be to really create the entire interrupt handler
stub in inthand_add.  It's not as difficult as it probably sounds, but
in general I agree with Bruce that the saving is probably not worth
it.

Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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