From owner-freebsd-sparc Sun Dec 21 19:30:40 1997 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA21554 for sparc-outgoing; Sun, 21 Dec 1997 19:30:40 -0800 (PST) (envelope-from owner-freebsd-sparc@FreeBSD.ORG) Received: from quark.ChrisBowman.com (crb.mnsinc.com [206.239.213.225]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA21547 for ; Sun, 21 Dec 1997 19:30:33 -0800 (PST) (envelope-from crb@ChrisBowman.com) Received: from localhost (crb@localhost) by quark.ChrisBowman.com (8.8.8/8.8.7) with SMTP id WAA00428; Sun, 21 Dec 1997 22:30:37 -0500 (EST) (envelope-from crb@ChrisBowman.com) X-Authentication-Warning: quark.ChrisBowman.com: crb owned process doing -bs Date: Sun, 21 Dec 1997 22:30:37 -0500 (EST) From: "Christopher R. Bowman" To: Greg Lehey cc: Ric Flinn , Jason Evans , freebsd-sparc@FreeBSD.ORG Subject: Re: Register windowing In-Reply-To: <19971222101113.50010@lemis.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, 22 Dec 1997, Greg Lehey wrote: >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 I haven't had a chance to wade through my Sparc V9 book, but on page xvii it does say "we've accomplished this by making register windows more flexible than they were in earlier SPARC processors, allowing the kernel to provide a separate register bank to each running process. Thus, the processor can perform a context switch with essentially no overhead ..." and "We've also added eight new registers called 'alternate globals,' so the trap handler has a fresh register set to use immediately upon entry..." Which doesn't really refute what Greg says, but is interesting. --------- Christopher R. Bowman crb@ChrisBowman.com My home page