From owner-freebsd-sparc Sun Dec 21 15:42:07 1997 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA06434 for sparc-outgoing; Sun, 21 Dec 1997 15:42:07 -0800 (PST) (envelope-from owner-freebsd-sparc@FreeBSD.ORG) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA06416 for ; Sun, 21 Dec 1997 15:41:46 -0800 (PST) (envelope-from grog@lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id KAA03067; Mon, 22 Dec 1997 10:11:13 +1030 (CST) (envelope-from grog) Message-ID: <19971222101113.50010@lemis.com> Date: Mon, 22 Dec 1997 10:11:13 +1030 From: Greg Lehey To: Ric Flinn Cc: Jason Evans , freebsd-sparc@FreeBSD.ORG Subject: Re: Register windowing References: <349D746C.85A2D84F@radiks.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <349D746C.85A2D84F@radiks.net>; from Ric Flinn on Sun, Dec 21, 1997 at 07:56:28PM +0000 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, Dec 21, 1997 at 07:56:28PM +0000, Ric Flinn wrote: > There are other ways for an OS to deal with register windows; consider > the following: Instead of different register windows being used for > function calls, have different windows available for different OS > functions, such as interrupts and system calls. This way, when an > interrupt occurs, you don't save the user program's registers, but just > switch to a differnent (non-adjacent) window, which reduces a bit of > overhead. Same with system calls, just switch to the kernel's register > window. I think you're misunderstanding the Sparc hardware. The Sparc has a register file (we'll discuss the terminology when I find my Sparc books, which are still in the shed since moving house) which is addressed something like a stack. At any time, 24 registers are addressable, organized as 8 input, 8 local, and 8 output registers. These registers are called the register window. Each function call moves the pointer on by 16 registers, so the output registers of the calling function become the input registers of the called function. Jason went into more detail about this in an earlier posting. There is no question of using the register file for anything but local data storage in an individual program. Greg