Japanese
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
 4
 Interrupt status register reset
 INT_ResStat
 5
 A-Bus interrupt acknowledge setting
 INT_SetAck
 6
 A-Bus interrupt acknowledge acquisition
 INT_GetAck
 7
 Registering and referencing interrupt handling routines 
 Interrupt function registration
 INT_SetFunc
 8
 SCU function registration
 INT_SetScuFunc
 9
 Get interrupt function address
 INT_GetFunc
 10
 Get SCU function address
 INT_GetScuFunc
 11


2.4 Function specifications


[Interrupt register access management]


 one
View
table
 Title

function specification

 Function

Get interrupt mask register

 Function name

INT_GetMsk

 No

1

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


 one
View
table
 Title

function specification

 Function

Interrupt mask register setting

 Function name

INT_SetMsk

 No

2

Format
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 to the interrupt mask register and mask storage memory.


 one
View
table
 Title

function specification

 Function

Interrupt mask register change

 Function name

INT_ChgMsk

 No

3

Format
void INT_ChgMsk(Uint32 ena_msk_bit, Uint32 dis_msk_bit)
input
 ena_msk_bit
 :Interrupt mask bit value (enable)
 dis_msk_bit
 :Interrupt mask bit value (disable)
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 retain their values.
Set the 1 bit of the interrupt mask bit value (enable) not to be masked, and set the 1 bit of the interrupt mask bit value (disable) to mask. Bits for which neither is specified retain their values.
Interrupts are temporarily disabled during this process. It also resets the interrupt status register corresponding to the 1 bit in the interrupt mask bit value (enable). If you enable A-Bus interrupt masking, enable the interrupt acknowledge register.
remarks
If you do not want to specify any interrupt mask bits, specify INT_MSK_NULL.

 one
View
table
 Title

function specification

 Function

Get interrupt status register

 Function name

INT_GetStat

 No

4

Format
Uint32 INT_GetStat(void)
input
none
output
none
function value
Interrupt status register value
(0: No interrupt occurred, 1: Interrupt occurred)
function
Get the interrupt status register.


 one
View
table
 Title

function specification

 Function

Interrupt status register reset

 Function name

INT_ResStat

 No

5

Format
void INT_ResStat(Uint32 status_bit)
input
status_bit: Interrupt status bit value
(0: Reset, 1: Keep value)
output
none
function value
none
function
Resets the 0 bit in the interrupt status bit value.

 one
View
table
 Title

function specification

 Function

A-Bus interrupt acknowledge setting

 Function name

INT_SetAck

 No

6

Format
void INT_SetAck(Uint32 ack)
input
ack: Acknowledgment value

 constant name
 explanation
 INT_ACK_ENA
 To enable
 INT_ACK_DIS
 maintain current state
output
none
function value
none
function
Sets the specified acknowledge value to the A-Bus interrupt acknowledge register.

 one
View
table
 Title

function specification

 Function

A-Bus interrupt acknowledge acquisition

 Function name

INT_GetAck

 No

7

Format
Uint32 INT_GetAck(void)
input
none
output
none
function value
Acknowledgment value

 constant name
 explanation
 INT_ACK_ENA
 is enabled
 INT_ACK_DIS
 disabled
function
Get the acknowledge value of the A-Bus interrupt acknowledge register.

[Register and reference interrupt handling routine]


 one
View
table
 Title

function specification

 Function

Interrupt function registration

 Function name

INT_SetFunc

 No

8

Format
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 to the interrupt vector indicated by the vector number.
The registered interrupt function will be executed when an interrupt occurs. If the interrupt function address is NULL, the function to be registered in the interrupt vector will be as follows depending on the contents of the vector number.
remarks
The interrupt functions that can be specified are those that end with register save, restore, and RTE instructions (in C language, functions that use the #pragma interrupt declaration can be specified).
This function can be used with both master and slave SH2. Execute this function on the CPU you want to register.

 one
View
table
 Title

function specification

 Function

SCU function registration

 Function name

INT_SetScuFunc

 No

9

Format
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 to the SCU interrupt function of the specified vector number. The registered SCU function will be executed when an SCU interrupt occurs.
If the specified interrupt routine address is NULL, register an SCU dummy function. The SCU dummy function is a function that only performs return processing.
remarks
This function can only be used by master SH2. Execute this function on master SH2.
If you register an interrupt function with INT_SetFunc, the SCU interrupt routine for that vector will be disabled and the registered function will not be called.

 one
View
table
 Title

function specification

 Function

Get interrupt function address

 Function name

INT_GetFunc

 No

10

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


 one
View
table
 Title

function specification

 Function

Get SCU function address

 Function name

INT_GetScuFunc

 No

11

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

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