PROGRAMMER'S GUIDEInterrupt management library
Back | ■
Interrupt management library / 2. Reference

2.3 Function list


 function
 Function name
 number
 Interrupt register access management
 Get interrupt mask register
 INT_GetMsk
 1
 Interrupt mask register setting
 INT_SetMsk
 2
 Interrupt mask register change
 INT_ChgMsk
 3
 Get interrupt status register
 INT_GetStat
 Four
 Interrupt status register reset
 INT_ResStat
 Five
 A-Bus interrupt ack Norwich setting
 INT_SetAck
 6
 A-Bus interrupt Acknowledge acquisition
 INT_GetAck
 7
 Registration and reference of interrupt processing routines 
 Interrupt function registration
 INT_SetFunc
 8
 SCU function registration
 INT_SetScuFunc
 9
 Interrupt function address acquisition
 INT_GetFunc
 Ten
 Get SCU function address
 INT_GetScuFunc
 11


2.4 Function specifications


[Interrupt register access management]


 List
 Title

Function specifications

 Function

Get interrupt mask register

 Function name

INT_GetMsk

 No

1

Form
Uint32 INT_GetMsk (void)
input
none
output
none
Function value
Interrupt mask bit value
(0: Do not mask, 1: Mask)
function
Acquires the mask storage memory to the interrupt mask bit value.


 List
 Title

Function specifications

 Function

Interrupt mask register setting

 Function name

INT_SetMsk

 No

2

Form
void INT_SetMsk (Uint32 msk_bit)
input
msk_bit: interrupt mask bit value
(0: Do not mask, 1: Mask)
output
none
Function value
none
function
Set the interrupt mask bit value in the interrupt mask register and mask storage memory.


 List
 Title

Function specifications

 Function

Interrupt mask register change

 Function name

INT_ChgMsk

 No

3

Form
void INT_ChgMsk (Uint32 ena_msk_bit, Uint32 dis_msk_bit)
input
 ena_msk_bit
 : Interrupt mask bit value (enabled)
 dis_msk_bit
 : Interrupt mask bit value (disabled)
output
none
Function value
none
function
Changes the interrupt mask register and mask storage memory for only the specified bits. Bits that are not specified hold their values.
Set not to mask 1 bit of the interrupt mask bit value (enabled) and mask 1 bit of the interrupt mask bit value (disabled). Bits for which neither is specified retains their value.
Interrupts are temporarily disabled during this process. It also resets the interrupt status register corresponding to the 1 bit of the interrupt mask bit value (enabled). If you enable the A-Bus interrupt mask, enable the interrupt interrupt register.
remarks
If you do not specify any interrupt mask bits, specify INT_MSK_NULL.

 List
 Title

Function specifications

 Function

Get interrupt status register

 Function name

INT_GetStat

 No

Four

Form
Uint32 INT_GetStat (void)
input
none
output
none
Function value
Interrupt status register value
(0: interrupt not generated, 1: interrupt generated)
function
Gets the interrupt status register.


 List
 Title

Function specifications

 Function

Interrupt status register reset

 Function name

INT_ResStat

 No

Five

Form
void INT_ResStat (Uint32 status_bit)
input
status_bit: interrupt status bit value
(0: reset, 1: retain value)
output
none
Function value
none
function
Resets the 0 bit of the interrupt status bit value.

 List
 Title

Function specifications

 Function

A-Bus interrupt ack Norwich setting

 Function name

INT_SetAck

 No

6

Form
void INT_SetAck (Uint32 ack)
input
ack: Acnorwich value

 Constant name
 explanation
 INT_ACK_ENA
 To enable
 INT_ACK_DIS
 Hold the current state
output
none
Function value
none
function
Sets the specified acknowledgment value in the A-Bus interrupt acknowledge register.

 List
 Title

Function specifications

 Function

A-Bus interrupt Acknowledge acquisition

 Function name

INT_GetAck

 No

7

Form
Uint32 INT_GetAck (void)
input
none
output
none
Function value
Acnorwich value

 Constant name
 explanation
 INT_ACK_ENA
 Enabled
 INT_ACK_DIS
 Is disabled
function
A-Bus interrupt Acquires the acknowledge value of the acknowledgment register.

[Registration and reference of interrupt processing routine]


 List
 Title

Function specifications

 Function

Interrupt function registration

 Function name

INT_SetFunc

 No

8

Form
void INT_SetFunc (Uint32 num, void * hdr)
input
 num
 : Vector number
 hdr
 : Interrupt function address
output
none
Function value
none
function
Register the interrupt function address in the interrupt vector indicated by the vector number.
The registered interrupt function is executed when an interrupt occurs. If the interrupt function address is NULL, the functions registered in the interrupt vector depending on the contents of the vector number are as follows.
remarks
The interrupt functions that can be specified are the functions that end with the register save, restore, and RTE instructions (in C language, the function that uses the #pragma interrupt declaration can be specified).
This function can be used for both master and slave SH2. Execute this function on the CPU you want to register.

 List
 Title

Function specifications

 Function

SCU function registration

 Function name

INT_SetScuFunc

 No

9

Form
void INT_SetScuFunc (Uint32 num, viod * hdr)
input
 num
 : Vector number (only SCU vector number can be specified)
 hdr
 : SCU function address
output
none
Function value
none
function
Registers the SCU function address in the SCU interrupt function with the specified vector number. The registered SCU function is executed when an SCU interrupt occurs.
If the specified interrupt routine address is NULL, register the SCU dummy function. The SCU dummy function is a function that performs only return processing.
remarks
This function can only be used with master SH2. Execute this function on master SH2.
If an interrupt function is registered with INT_SetFunc, the SCU interrupt routine for that vector becomes invalid and the registration function is not called.

 List
 Title

Function specifications

 Function

Interrupt function address acquisition

 Function name

INT_GetFunc

 No

Ten

Form
void * INT_GetFunc (Uint32 num)
input
num: Vector number
output
none
Function value
Interrupt function address
function
Acquires the interrupt function address registered in the specified vector number.
remarks
This function can be used for both master and slave SH2. Execute this function on the CPU you want to get.


 List
 Title

Function specifications

 Function

Get SCU function address

 Function name

INT_GetScuFunc

 No

11

Form
void * INT_GetScuFunc (Uint32 num)
input
num: Vector number
(Only SCU vector number can be specified)
output
none
Function value
SCU function address
function
Acquires the SCU function address registered in the SCU interrupt function with the specified vector number.
remarks
This function can only be used with master SH2. Execute this function on master SH2.

Back | ■
PROGRAMMER'S GUIDEInterrupt management library
Copyright SEGA ENTERPRISES, LTD., 1997