osGetCause.3p 2.99 KB
.TH __osGetCause 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
__osGetCause, __osSetCause, __osGetCompare, __osSetCompare,
__osGetConfig, __osSetConfig, __osGetSR, __osSetSR, __osGetFpcCsr, 
__osSetFpcCsr \- internal routines to access various MIPS R4300 registers
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
#include <os_internal.h>
.sp .8v
u32 __osGetCause(void);
.sp .8v
void __osSetCause(u32 value);
.sp .8v
u32 __osGetCompare(void);
.sp .8v
void __osSetCompare(u32 value);
.sp .8v
u32 __osGetConfig(void);
.sp .8v
void __osSetConfig(u32 value);
.sp .8v
u32 __osGetSR(void);
.sp .8v
void __osSetSR(u32 value);
.sp .8v
u32 __osGetFpcCsr(void);
.sp .8v
u32 __osSetFpcCsr(u32 value);
.Op
\f1
.fi
.SH DESCRIPTION
The Nintendo64 operating system contains numerous internal routines that provide
access to various important MIPS R4300 registers. To reduce potential duplicate
effort from developers, these routines are described below. Developers should
use the "Set" routines with extreme caution since they may interfere with
the operations of the Nintendo64 system. Sine these routines were originally
designed for internal use only, their names all have a "__" prefix notation. 
For more information on the use of the R4300 registers, please refer to the 
MIPS R4300 User's Manual. Furthermore, the header file "R4300.h" contains 
various bit definitions that can be used with the R4300 registers.
.PP
The __osGetCause routine returns the current value of the MIPS R4300 Cause 
register that describes the cause of the most recent exception. Its 
counterpart __osSetCause simply sets this register to the new 
.IR value.
.PP
The __osGetCompare routine returns the current value of the R4300 Compare 
register. __osSetCompare simply sets this register to the new 
.IR value.
Developers are discouraged to use __osSetCompare since the Compare register is 
used by the timer functions 
.I osSetTimer(3P)
and 
.I osStopTimer(3P).
.PP
The __osGetConfig routine returns the current value of the R4300 Configuration 
register. Its counterpart __osSetConfig simply sets this register to the new 
.IR value.
.PP
The __osGetSR routine returns the current value of the R4300 Status 
register. Its counterpart __osSetSR simply sets this register to the new 
.IR value.
When creating a thread, 
.IR osCreateThread(3P)
enables the kernel mode, all interrupts, and 
exception level in the thread's Status register, which becomes 
the R4300 Status register during a thread context switch.
.PP
The __osGetFpcCsr routine returns the current value of the R4300 
floating-point control/status register. Its counterpart __osSetFpcCsr simply 
returns the current value of this register before setting it to the new 
.IR value.
Upon system initialization and the creation of a thread, this floating-point
control/status is enabled to flush all denormalized numbers to zero and to
cause an invalid operation exception when Not a Numbers (NaNs) are generated.
These 2 bits are respectively defined as FPCSR_FS and FPCSR_EV in R4300.h.
.PP
.SH "SEE ALSO"
__osGetTLBASID (3P)