SPARC traps under SunOS


By: Jim Moore, SunSoft, Sun Microsystems Inc
Email: Jim.Moore@UK.Sun.COM
Version: 1.2
Date: 12 September 1997
This page has it's local mirrors at:
SunSITE Colombia, SunSITE Greece, SunSITE Singapore
and is available in text form via anonymous ftp from:
Warwick University


Table of contents

1
1.1
1.2

2
2.1
2.1.1
2.1.2
2.1.3
2.1.4
2.2
2.2.1
2.2.2
2.2.2.1
2.2.2.2
2.2.2.3
2.2.2.4

3
3.1
3.2
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.3
3.4

4
4.1
4.1.1
4.1.2

[A]
[B]
Introduction
Who should read this document?
Copyright/Reproduction Information

What is a trap?
How traps are caused
Precise Traps
Deferred Traps
Disrupt/Interrupt Traps
Software Traps
How traps are dispatched to the kernel
SPARC v7/v8
SPARC v9
Trap Nesting
Processor states, normal and special traps
Normal Trap (Processor in Execute State)
Special Trap (Processor in RED State)

Traps - How SunOS Handles Them
Generic Trap Handling
Register Windows
Register Windows, SPARC v9 State Registers
SPARC v7/v8 Window Overflow Handling
SPARC v7/v8 Window Underflow Handling
SPARC v9 Window Spill Handling
SPARC v9 Window Fill Handling
Interrupts
Text and Data Faults

Debugging Kernel Traps
Finding Out What Went Wrong
Deciphering a BAD TRAP Panic Message
Manually Extracting the Stack Trace

SPARC v7/v8 Trap listing
SPARC v9 Trap listing

Revision History

Version 1.0 - 19 March 1997
First posted

Version 1.01 - 4 April 1997
Rewrote and extended register window descriptions.
Added sections for v7/v8 overflow and underflow handlers.
Added sections for v9 spill and fill handlers.
Added code demonstrating overflow, spill, underflow and fill handlers.
Extended interrupt trap section.
Added appendices for v7/v8 and v9 trap listings.

Version 1.2 - 12 September 1997
Minor corrections
Added section clarifying SPARC v9 nested traps
Added section on text and data faults
Added chapter on debugging kernel traps

Credits and Acknowledgements

Thanks to the following for their invaluable proof reading:

Jon Haslam, SunSoft European Support
Calum Mackay, SunSoft Sustaining Engineering

Thanks to the following for their help in hosting this document in HTML and text formats:

Panos Sikas, SunSITE Greece (who also did the original conversion to an HTML Version)
Rob McMahon, CS Dept, University of Warwick