Japanese
PROGRAMMER'S GUIDESystem program user's manual
Back | ■
SMPC Interface User's Manual

function specification



 one
View
table
 Title
function specification
 Function
to the interrupt vector,
Register interrupt handling routine
 Function name
SYS_SETSINT
 No
1.1
Format
void SYS_SETSINT(Uint32 Num, void* Hdr);
input
Num: Vector number (0..7FH)
Hdr: Interrupt handling routine address
(If 0, it will be a dummy routine or if Num is an SCU interrupt vector, it will be the interrupt handling routine)

output
none
function value
none
function
Hdr must be a processing routine that ends with a register save, restore, and RTE instruction (in C language, it must have a #pragma interrupt declaration).
If Hdr is 0, the SCU interrupt routine will be re-registered if Num is within the SCU interrupt (40H..4DH, 50H..5FH), and a dummy routine will be registered otherwise.
No range checking was performed. Do not specify values outside the limits.
remarks
This routine can be used with both master and slave SH2, and registers to the vector address based on each VBR.


 one
View
table
 Title
function specification
 Function
to the SCU interrupt routine,
Register a processing function
 Function name
SYS_SETUINT
 No
1.2
Format
void SYS_SETUINT(Uint32 Num,void* Hdr);
input
Num: Vector number (SCU vector number)
Hdr: Function routine address (if 0, it becomes a dummy routine)
output
none
function value
none
function
Hdr must be a function by SHC. Routines created in assembler must follow the SHC register saving rules.
Num is limited to SCU interrupt vectors (40H..4DH, 50H..5FH).
If Hdr is 0, register a dummy routine.
No range checking was performed. Do not specify values outside the limits.
remarks
If a routine is registered in a vector using SYS_SETSINT, the SCU interrupt handling routine for that vector will be disabled and the registered function will not be called.
If this routine is called on slave SH2, the results are not guaranteed.


 one
View
table
 Title
function specification
 Function
Get the registered contents of the interrupt vector
 Function name
SYS_GETSINT
 No
1.3
Format
void(*)() SYS_GETSINT(Uint32 Num);
input
Num: Vector number (0..7FH)
output
none
function value
Vector registration contents (interrupt processing routine address)
function
Returns the contents of a vector of Num as a function value.
No range checking was performed. Do not specify values outside the range.
remarks
This routine can be used with both master and slave SH2, and refers to the vector address based on each VBR.


 one
View
table
 Title
function specification
 Function
Get the registered contents of SCU interrupt routine
 Function name
SYS_GETUINT
 No
1.4
Format
void(*)() SYS_GETUINT(Uint32 Num);
input
Num: Vector number (SCU vector number)
output
none
function value
Registration contents (function routine address)
function
NumReturns the registered contents of the corresponding SCU interrupt routine as a function value.
No range checking was performed. Do not specify values outside the range.
remarks
If this routine is called on slave SH2, the results are not guaranteed.


 one
View
table
 Title
function specification
 Function
Setting SCU interrupt mask
 Function name
SYS_SETSCUIM
 No
2.1
Format
void SYS_SETSCUIM(Uint32 MaskPat);
input
MaskPat: SCU interrupt mask value
output
none
function value
none
function
Write the value of MaskPat to the mask storage memory, SCU interrupt mask register, and then write the same value to the SCU interrupt status register. However, if the A-Bus interrupt mask bit is enabled, it clears the upper word of the status register and also clears the A-Bus interrupt acknowledge register.
remarks
This routine must not be used from interrupt processing (of SCU interrupts) (the value of SYS_GETSCUIM is undefined during SCU interrupt processing).
If an SCU interrupt occurs during processing, the interrupt may disappear (SCU specifications). Avoid that possibility or use it in situations you don't care about.
If this routine is called on slave SH2, the results are not guaranteed.


 one
View
table
 Title
function specification
 Function
Changing the SCU interrupt mask
 Function name
SYS_CHGSCUIM
 No
2.2
Format
void SYS_CHGSCUIM(Uint32 AndMask,Uint32 OrMask);
input
AndMask: Mask value for permission
OrMask: Rejection mask value
output
none
function value
none
function
The contents of the mask storage memory are ANDed with AndMask, and the result of ORing with Or-Mask is written to the mask storage memory and the SCU interrupt mask register.
Next, write the logical sum of AndMask and OrMask to the SCU status register. However, if the A-Bus interrupt mask bit is enabled, clear the upper word of the status register and clear the A-Bus interrupt acknowledge register. Perform these operations atomically.
remarks
This routine must not be used from interrupt processing (of SCU interrupts) (the value of SYS_GETSCUIM is undefined during SCU interrupt processing).
If an SCU interrupt occurs during processing, the interrupt may disappear (SCU specifications). Avoid that possibility or use it in situations you don't care about.
If this routine is called on slave SH2, the results are not guaranteed.


 one
View
table
 Title
function specification
 Function
Reference to SCU interrupt mask value
 Function name
SYS_GETSCUIM
 No
2.3
Format
Uint32 SYS_GETSCUIM;
input
none
output
none
function value
Mask storage memory value
function
Reads the value of mask storage memory. This value is the same as the value actually set in the SCU interrupt mask register if the SCU interrupt mask register is set or changed using the above function.
remarks
During SCU interrupt processing, the mask value for each interrupt factor (if the application uses SYS_CHGUIPR(), the corresponding value in the table) is added to the value set by the application using SYS_SETSCUIM() and SYS_CHGSCUIM(). Changes to logical sum. However, when multiple interrupts occur, the result changes further, such as the logical sum of the interrupts.
Therefore, this value becomes undefined during SCU interrupt processing. During processing, do not perform any processing that depends on the referenced value.


 one
View
table
 Title
function specification
 Function
acquire a semaphore
 Function name
SYS_TASSEM
 No
3.1
Format
Uint32 SYS_TASSEM(Uint32 Num);
input
Num: Semaphore number (0 to FFH)
output
none
function value
Result (1: Obtained, 0: Already obtained by others)
function
Execute the TAS instruction on the memory (1 byte) associated with the number Num and return the result as a function value.
No range checking was performed. Do not specify values outside the range.
This routine can be used with both master and slave SH2.


 one
View
table
 Title
function specification
 Function
release a semaphore
 Function name
SYS_CLRSEM
 No
3.2
Format
void SYS_CLRSEM(Uint32 Num);
input
Num: Semaphore number (0 to FFH)
output
none
function value
none
function
Clears the memory (1 byte) associated with the number Num.
No range checking was performed. Do not specify values outside the range.
This routine can be used with both master and slave SH2.


 one
View
table
 Title
function specification
 Function
Switch system clock
 Function name
SYS_CHGSYSCK
 No
4.1
Format
void SYS_CHGSYSCK(Uint32 CkMode);
input
CkMode:
0: CPU 26MHz, 320/640 mode
1: CPU 28MHz, 352/704 mode
output
none
function value
none
function
Switches the system clock to the value specified by CkMode.
remarks
Please refer to the overview or SMPC manual regarding the devices that will be reset and the processing time.
If this routine is called on slave SH2, the system will hang up. Be sure to call it from master SH2.


 one
View
table
 Title
function specification
 Function
See system clock value
 Function name
SYS_GETSYSCK
 No
4.2
Format
Uint32 SYS_GETSYSCK;
input
none
output
none
function value
0 or 1: parameter value of last SYS_CHGSYSCK()
function
Reads the system clock value. This is the parameter value when SYS_CHGSYSCK() was last called.
remarks
Refer to this value on master SH2.


 one
View
table
 Title
function specification
 Function
Change SCU interrupt routine priority
 Function name
SYS_CHGUIPR
 No
5.1
Format
void SYS_CHGUIPR(Uint32 *IprTab);
input
IprTab: 32 longword data array
output
none
function value
none
function
Rewrites the priority table for SCU interrupt routines in BOOTROM with the values from the table specified in IprTab.

Once rewritten, interrupt processing by the SCU interrupt routine will be executed with the priority of the corresponding table value for each cause.

Table contents are not checked. If there is a priority relationship conflict in the table contents, the system may hang.

remarks
The table settings remain valid until the next time they are rewritten. During this time, the application does not need to maintain the table specified in the parameter. Please note that upon resetting, the BOOT ROM default settings will be restored.
If this routine is called on slave SH2, the results are not guaranteed.


 one
View
table
 Title
function specification
 Function
Start and run CD Multiplayer
 Function name
SYS_EXECDMP
 No
6.1
Format
void SYS_EXECDMP(void);
input
none
output
does not return to caller
function value
none
function
Start and run CD Multiplayer.
remarks
If this routine is called on slave SH2, the system will hang. Be sure to call it from master SH2.


 one
View
table
 Title
function specification
 Function
Operating power-on clear memory
 Function name
SYS_PCLRMEM
 No
7.1
Format
Uint8 *SYS_PCLRMEM
input
Please perform normal memory access.
output
Please perform normal memory access.
function value
none
function
This is the address of 8 bytes of memory managed by BOOT ROM. This memory is initialized to 0 only at power-on startup, but the contents are retained when the reset button (NMI) is pressed.
remarks
No range checking was performed. Please be careful not to access outside the scope.


Back |■
PROGRAMMER'S GUIDESystem program user's manual
Copyright SEGA ENTERPRISES, LTD., 1997