osGetCause.3p
2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.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)