From owner-freebsd-smp Mon Nov 27 10:33:10 2000 Delivered-To: freebsd-smp@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id CF70B37B4C5 for ; Mon, 27 Nov 2000 10:32:53 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id eARIWqC39798; Mon, 27 Nov 2000 10:32:52 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20001126220749.BFB35BA7A@io.yi.org> Date: Mon, 27 Nov 2000 10:33:05 -0800 (PST) From: John Baldwin To: Jake Burkholder Subject: RE: BSD/OS interrupt code Cc: smp@FreeBSD.org Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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.) > Jake -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message