Windows use of SPARC registers


Windows & use of SPARC registers

Now that you have an idea of the SPARC processor hardware, let's return to the Integer Unit to talk more about register windows. The concept of windowing is quite important when we discuss stacks, frame, and stack trace backs.

As you know, SPARC processors that comply with the SPARC Version 8 architecture specification can have anywhere between 40 to 520 general-purpose, 32-bit registers. At any one time, however, a routine can only access 32 of these registers, 24 of which are clustered into what is referred to as a "window." The other 8 registers, always the same 8 and referred to as "global registers," are visible at all times.

With up to 520 general-purpose registers available on a SPARC processor, a window provides the executing routine a limited "view" of the hardware's full set of registers, to put it simply.

Note

From this point on, when we use the word "register," we will be referring to a general-purpose register. When we need to refer to another register, such as a floating-point register, we will refer to it with a specific name .


When a save instruction is executed, the window, or limited view of the full set of registers, shifts to a new, adjacent window. Traps cause the same action. When a restore instruction is executed, the view of the registers shifts back to the former window. The interesting detail about these window shifts is that the new view overlaps the old view by eight registers. We'll get back to this in a moment.

The 24 general-purpose registers within a register window view may be addressed in SPARC assembly language as registers %r8 through r31 . However, they are more commonly referred to by other names , as shown below.

Table A-2. SPARC general purpose registers

Window Register Address

r Register Address

Description of Registers

g0 g7

r0 r7

Global registers. Always available to all routines.

o0 o7

r8 r13

Output registers. New window's input registers.

l0 l7

r14 r23

Local registers. Unique to each procedure.

i0 i7

r24 r32

Input registers. Old window's output registers.

As hinted at in the chart above, the input and output registers, or i and o registers, are the ones that overlap from window to window. The local, or l registers, are unique to each window. Together, the i , o , and l registers make up the 24-register window view.

Registers r0 through r7 are actually outside the register window. However, since they are available to all procedures, in addition to the 24 i , o , and l window registers, they are assigned window register address names. These 8 global registers are referred to as g0 through g7 .



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net