PROGRAMMER'S GUIDESystem Program User's Manual
Back | ■
SMPC Interface User's Manual

Function specifications



 List
 Title
Function specifications
 Function
To the interrupt vector,
Register an interrupt processing routine
 Function Name
SYS_SETSINT
 No
1.1
Form
void SYS_SETSINT (Uint32 Num, void * Hdr);
input
Num: Vector number (0..7FH)
Hdr: Interrupt handling routine address
(If 0, it is a dummy routine or if Num is an SCU interrupt vector, it is the interrupt processing routine)

output
none
Function value
none
function
Hdr must be a processing routine that always ends with a register save, restore, and RTE instruction (in C, with a #pragma interrupt declaration).
When Hdr is 0, the SCU interrupt routine is re-registered when Num is within the SCU interrupt (40H..4DH, 50H..5FH), and the dummy routine is registered otherwise.
The range is not checked. Do not specify a value outside the limit.
remarks
This routine can be used for both master and slave SH2, and is registered in the vector address based on each VBR.


 List
 Title
Function specifications
 Function
To the SCU interrupt routine,
Register the processing function
 Function Name
SYS_SETUINT
 No
1.2
Form
void SYS_SETUINT (Uint32 Num, void * Hdr);
input
Num: Vector number (SCU vector number)
Hdr: Function routine address (0 means dummy routine)
output
none
Function value
none
function
Hdr must be an SHC function. Routines created in assembler must follow SHC's register storage rules.
Num is limited to SCU interrupt vectors (40H..4DH, 50H..5FH).
If Hdr is 0, register a dummy routine.
The range is not checked. Do not specify a value outside the limit.
remarks
When a routine is registered in a vector with SYS_SETSINT, the SCU interrupt processing routine of that vector becomes invalid and the registration function is not called.
If this routine is called on slave SH2, the result is not guaranteed.


 List
 Title
Function specifications
 Function
Get the registered contents of the interrupt vector
 Function Name
SYS_GETSINT
 No
1.3 1.3
Form
void (*) () SYS_GETSINT (Uint32 Num) ;
input
Num: Vector number (0..7FH)
output
none
Function value
Vector registration details (interrupt processing routine address)
function
Returns the contents of the Num vector as a function value.
The range is not checked. 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.


 List
 Title
Function specifications
 Function
Obtain the registered contents of the SCU interrupt routine
 Function Name
SYS_GETUINT
 No
1.4
Form
void (*) () SYS_GETUINT (Uint32 Num) ;
input
Num: Vector number (SCU vector number)
output
none
Seki numerical value
Registration details (function routine address)
function
Num Returns the registered contents of the corresponding SCU interrupt routine as a function value.
The range is not checked. Do not specify values outside the range.
remarks
If this routine is called on slave SH2, the result is not guaranteed.


 List
 Title
Function specifications
 Function
Set of SCU interrupt masks
 Function Name
SYS_SETSCUIM
 No
2.1
Form
void SYS_SETSCUIM (Uint32 MaskPat);
input
MaskPat: SCU interrupt mask value
output
none
Function value
none
function
Write the MaskPat value to the mask storage memory and 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 in the status register and then the A-Bus interrupt acknowledge register.
remarks
Do not use this routine from interrupt processing (for 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 specification). Avoid that possibility or use it in unfamiliar situations.
If this routine is called on slave SH2, the result is not guaranteed.


 List
 Title
Function specifications
 Function
Change SCU interrupt mask
 Function Name
SYS_CHGSCUIM
 No
2.2
Form
void SYS_CHGSCUIM (Uint32 AndMask, Uint32 OrMask);
input
AndMask: Mask value for permission
OrMask: Mask value for rejection
output
none
Function value
none
function
The contents of the mask storage memory are logically ANDed with AndMask, and the result of ORing with Or-Mask is written to the mask storage memory and the SCU interrupt mask register.
Then write the OR of AndMask and OrMask to the SCU status register. However, if the A-Bus interrupt mask bit is enabled, the upper word in the status register is cleared, and then the A-Bus interrupt acknowledge register is cleared. Perform these operations inseparably.
remarks
Do not use this routine from interrupt processing (for 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 specification). Avoid that possibility or use it in unfamiliar situations.
If this routine is called on slave SH2, the result is not guaranteed.


 List
 Title
Function specifications
 Function
SCU interrupt mask value reference
 Function Name
SYS_GETSCUIM
 No
2.3
Form
Uint32 SYS_GETSCUIM;
input
none
output
none
Function value
Mask storage memory value
function
Reads the value of the 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 / changed by 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 set to the value set by the application using SYS_SETSCUIM () and SYS_CHGSCUIM (). It changes to a logical sum. However, when there are multiple interrupts, the logical sum changes.
Therefore, this value is undefined during SCU interrupt processing. During processing, do not perform processing that depends on the referenced value.


 List
 Title
Function specifications
 Function
Earn a semaphore
 Function Name
SYS_TASSEM
 No
3.1 3.1
Form
Uint32 SYS_TASSEM (Uint32 Num);
input
Num: Semaphore number (0 to FFH)
output
none
Function value
Result (1: Acquired, 0: Already acquired by others)
function
Executes a TAS instruction on the memory (1 byte) associated with the Num number and returns the result as a function value.
The range is not checked. Do not specify values outside the range.
This routine can be used with both master and slave SH2.


 List
 Title
Function specifications
 Function
Release the semaphore
 Function Name
SYS_CLRSEM
 No
3.2
Form
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 Num number.
The range is not checked. Do not specify values outside the range.
This routine can be used with both master and slave SH2.


 List
 Title
Function specifications
 Function
Switch system clock
 Function Name
SYS_CHGSYSCK
 No
4.1
Form
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 and SMPC manual for the devices to be reset and the processing time.
If this routine is called on slave SH2, the system will hang. Be sure to call it on master SH2.


 List
 Title
Function specifications
 Function
Refer to the system clock value
 Function Name
SYS_GETSYSCK
 No
4.2
Form
Uint32 SYS_GETSYSCK;
input
none
output
none
Function value
0 or 1: Last SYS_CHGSYSCK () parameter value
function
Read the system clock value. This is the parameter value when SYS_CHGSYSCK () was called last.
remarks
See this value in master SH2.


 List
 Title
Function specifications
 Function
Change the SCU interrupt routine priority
 Function Name
SYS_CHGUIPR
 No
5.1
Form
void SYS_CHGUIPR (Uint32 * IprTab);
input
IprTab: 32 longword data array
output
none
Function value
none
function
Rewrites the priority table for the SCU interrupt routine of BOOTROM with the value of 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 factor.

The table contents are not checked. Inconsistent priority relationships in table contents can cause the system to hang.

remarks
The table settings are valid until the next rewrite. In the meantime, the application does not need to keep the table specified in the parameter. When resetting, the default value of BOOT ROM is restored.
If this routine is called on slave SH2, the result is not guaranteed.


 List
 Title
Function specifications
 Function
Start and run the CD multiplayer
 Function Name
SYS_EXECDMP
 No
6.1
Form
void SYS_EXECDMP (void);
input
none
output
Will not return to the caller
Function value
none
function
Start and execute the CD multiplayer.
remarks
If this routine is called on slave SH2, the system will hang. Be sure to call it on master SH2.


 List
 Title
Function specifications
 Function
Operate power-on clear memory
 Function Name
SYS_PCLRMEM
 No
7.1
Form
Uint8 * SYS_PCLRMEM
input
Perform normal memory access.
output
Perform normal memory access.
Seki numerical value
none
function
The address of the 8-byte memory managed by the BOOT ROM. This memory is initialized to 0 only at power-on startup, but the contents are retained by the reset button (NMI).
remarks
The range is not checked. Please be careful not to access outside the range.


Back | ■
PROGRAMMER'S GUIDESystem Program User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997