From owner-freebsd-smp Mon Nov 27 11:27:20 2000 Delivered-To: freebsd-smp@freebsd.org Received: from mailhost.iprg.nokia.com (mailhost.iprg.nokia.com [205.226.5.12]) by hub.freebsd.org (Postfix) with ESMTP id D1AA537B479; Mon, 27 Nov 2000 11:27:17 -0800 (PST) Received: from darkstar.iprg.nokia.com (darkstar.iprg.nokia.com [205.226.5.69]) by mailhost.iprg.nokia.com (8.9.3/8.9.3-GLGS) with ESMTP id LAA06709; Mon, 27 Nov 2000 11:27:17 -0800 (PST) Received: (from root@localhost) by darkstar.iprg.nokia.com (8.11.0/8.11.0-DARKSTAR) id eARJREW27393; Mon, 27 Nov 2000 11:27:14 -0800 X-Virus-Scanned: Mon, 27 Nov 2000 11:27:14 -0800 Nokia Silicon Valley Email Exploit Scanner Received: from radio.iprg.nokia.com (205.226.1.150, claiming to be "iprg.nokia.com") by darkstar.iprg.nokia.com(WTS.12.69) smtpdypuZrd; Mon, 27 Nov 2000 11:27:06 PST Message-ID: <3A22B58C.DA0B554B@iprg.nokia.com> Date: Mon, 27 Nov 2000 11:27:08 -0800 From: Joe Eykholt Organization: Nokia IPRG X-Mailer: Mozilla 4.7 [en] (X11; I; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: Jake Burkholder , smp@FreeBSD.ORG Subject: Re: BSD/OS interrupt code References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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.) True, but on SPARC you have more registers to play with in the interrupt handler and you tend not to have to do this sort of code changing at all. All the interrupt vectors can easily jump to one or two common routines. Joe Eykholt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message