割り込みヘッダファイルのマージ。

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@130 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
nakasima 2008-12-19 06:59:07 +00:00
parent 9931af3768
commit 310209847d
5 changed files with 317 additions and 493 deletions

View File

@ -110,84 +110,6 @@ asm void i_osIrqVeneer( void )
//================================================================================ //================================================================================
// InterruptMask // InterruptMask
//================================================================================ //================================================================================
/*---------------------------------------------------------------------------*
Name: osSetInterruptMask
Description: set interrupt factor
Arguments: mask interrupt factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osSetInterruptMask( OSIntrMask mask )
{
OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_IE_ALL;
reg_OS_IDR_CLR_IE[0] = HW_IDR_WORD_MASK;
reg_OS_IDR_CLR_IE[1] = HW_IDR_WORD_MASK;
reg_OS_IDR_CLR_IE[2] = HW_IDR_WORD_MASK;
reg_OS_IDR_CLR_IE[3] = HW_IDR_WORD_MASK;
reg_OS_IDR_SET_IE_ALL = mask;
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IE;
reg_OS_IE = mask;
#endif // SDK_ARM9
(void)osRestoreInterrupts( enabled );
return prep;
}
/*---------------------------------------------------------------------------*
Name: osEnableInterruptMask
Description: set specified interrupt factor
Arguments: mask interrupt factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osEnableInterruptMask( OSIntrMask mask )
{
OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_IE_ALL;
reg_OS_IDR_SET_IE_ALL = mask;
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IE;
reg_OS_IE = prep | mask;
#endif // SDK_ARM9
(void)osRestoreInterrupts( enabled );
return prep;
}
/*---------------------------------------------------------------------------*
Name: osDisableInterruptMask
Description: unset specified interrupt factor
Arguments: mask interrupt factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osDisableInterruptMask( OSIntrMask mask )
{
OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_IE_ALL;
reg_OS_IDR_CLR_IE_ALL = mask;
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IE;
reg_OS_IE = prep & ~mask;
#endif // SDK_ARM9
(void)osRestoreInterrupts( enabled );
return prep;
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osEnableInterruptID Name: osEnableInterruptID
@ -220,6 +142,31 @@ BOOL osEnableInterruptID( OSIntrID id )
return retval; return retval;
} }
/*---------------------------------------------------------------------------*
Name: osEnableInterruptMask
Description: set specified interrupt factor
Arguments: mask interrupt factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osEnableInterruptMask( OSIntrMask mask )
{
OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_IE_ALL;
reg_OS_IDR_SET_IE_ALL = mask;
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IE;
reg_OS_IE = prep | mask;
#endif // SDK_ARM9
(void)osRestoreInterrupts( enabled );
return prep;
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osDisableInterruptID Name: osDisableInterruptID
@ -252,6 +199,31 @@ BOOL osDisableInterruptID( OSIntrID id )
return retval; return retval;
} }
/*---------------------------------------------------------------------------*
Name: osDisableInterruptMask
Description: unset specified interrupt factor
Arguments: mask interrupt factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osDisableInterruptMask( OSIntrMask mask )
{
OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_IE_ALL;
reg_OS_IDR_CLR_IE_ALL = mask;
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IE;
reg_OS_IE = prep & ~mask;
#endif // SDK_ARM9
(void)osRestoreInterrupts( enabled );
return prep;
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osRestoreInterruptID Name: osRestoreInterruptID
@ -299,35 +271,37 @@ BOOL osRestoreInterruptID( OSIntrID id, BOOL state )
return retval; return retval;
} }
//================================================================================
// INTERRUPT PENDING
//================================================================================
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osClearInterruptPendingMask Name: osSetInterruptMask
Description: reset IF bit Description: set interrupt factor
(setting bit causes to clear bit for interrupt)
Arguments: mask interrupt factor Arguments: mask interrupt factor
Returns: previous factors Returns: previous factors
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
OSIntrMask osSetInterruptMask( OSIntrMask mask )
OSIntrMask osClearInterruptPendingMask( OSIntrMask mask )
{ {
OSIntrMode enabled = osDisableInterrupts(); OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11 #ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_PND_ALL; OSIntrMask prep = reg_OS_IDR_SET_IE_ALL;
reg_OS_IDR_CLR_PND_ALL = mask; reg_OS_IDR_CLR_IE[0] = HW_IDR_WORD_MASK;
reg_OS_IDR_CLR_IE[1] = HW_IDR_WORD_MASK;
reg_OS_IDR_CLR_IE[2] = HW_IDR_WORD_MASK;
reg_OS_IDR_CLR_IE[3] = HW_IDR_WORD_MASK;
reg_OS_IDR_SET_IE_ALL = mask;
#else // SDK_ARM9 #else // SDK_ARM9
OSIntrMask prep = reg_OS_IF; OSIntrMask prep = reg_OS_IE;
reg_OS_IF = mask; reg_OS_IE = mask;
#endif // SDK_ARM9 #endif // SDK_ARM9
(void)osRestoreInterrupts( enabled ); (void)osRestoreInterrupts( enabled );
return prep; return prep;
} }
//================================================================================
// INTERRUPT PENDING
//================================================================================
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osClearInterruptPendingID Name: osClearInterruptPendingID
@ -360,6 +334,32 @@ BOOL osClearInterruptPendingID( OSIntrID id )
return retval; return retval;
} }
/*---------------------------------------------------------------------------*
Name: osClearInterruptPendingMask
Description: reset IF bit
(setting bit causes to clear bit for interrupt)
Arguments: mask interrupt factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osClearInterruptPendingMask( OSIntrMask mask )
{
OSIntrMode enabled = osDisableInterrupts();
#ifdef SDK_ARM11
OSIntrMask prep = reg_OS_IDR_SET_PND_ALL;
reg_OS_IDR_CLR_PND_ALL = mask;
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IF;
reg_OS_IF = mask;
#endif // SDK_ARM9
(void)osRestoreInterrupts( enabled );
return prep;
}
#ifdef SDK_ARM11 #ifdef SDK_ARM11
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
@ -468,6 +468,30 @@ OSIntrID i_osReadInterruptAcknowledgeRegister( void )
#endif // SDK_ARM11 #endif // SDK_ARM11
/*---------------------------------------------------------------------------*
Name: osIsInterruptPendingID
Description: set Interrupt Clear Pending Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osIsInterruptPendingID( OSIntrID id )
{
BOOL retval;
#ifdef SDK_ARM11
u32 ofs = id/32;
u32 sft = id%32;
retval = TRUE & (reg_OS_IDR_SET_PND[ofs] >> sft);
#else // SDK_ARM9
retval = TRUE & (BOOL)(reg_OS_IF >> id);
#endif // SDK_ARM9
return retval;
}
//================================================================================ //================================================================================
// IRQ CHEKE BUFFER // IRQ CHEKE BUFFER

View File

@ -161,7 +161,7 @@ u64 osGetTick(void)
countH = i_osTickCounter; countH = i_osTickCounter;
//---- check if timer interrupt bit is on //---- check if timer interrupt bit is on
if (osIsInterruptPending(OSi_TICK_IE_TIMER_ID) && if (osIsInterruptPendingID(OSi_TICK_IE_TIMER_ID) &&
// countLが0xFFFFで直後に割り込み要求が来た場合の対策 // countLが0xFFFFで直後に割り込み要求が来た場合の対策
#ifdef SDK_ARM11 #ifdef SDK_ARM11
// ダウンカウンタなので // ダウンカウンタなので

View File

@ -36,11 +36,7 @@ extern "C" {
#include <brom/os/common/mutex.h> #include <brom/os/common/mutex.h>
#include <brom/os/common/thread.h> #include <brom/os/common/thread.h>
#include <brom/os/common/timer.h> #include <brom/os/common/timer.h>
#ifdef SDK_ARM11
#include <brom/os/ARM11/interrupt.h>
#else // SDK_ARM9
#include <brom/os/common/interrupt.h> #include <brom/os/common/interrupt.h>
#endif // SDK_ARM9
#if 0 #if 0
#include <brom/os/common/systemWork.h> #include <brom/os/common/systemWork.h>
#include <brom/os/common/exception.h> #include <brom/os/common/exception.h>

View File

@ -1,238 +0,0 @@
/*---------------------------------------------------------------------------*
Project: CtrBrom - OS - include
File: interrupt.h
Copyright 2008 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef BROM_OS_INTERRUPT_H_
#define BROM_OS_INTERRUPT_H_
#include <brom/os/common/interrupt_common.h>
#ifdef __cplusplus
extern "C" {
#endif
#define OS_IDR_CPU0_TARGET_ENABLE HW_IDR_CPU0_TARGET_ENABLE
#define OS_IDR_INTR_PRIO_DEFAULT 8 // Interrupt priority default (0-15)
OSIntrID i_osReadHighestPendingInterruptRegister( void );
OSIntrID i_osReadInterruptAcknowledgeRegister( void );
/*---------------------------------------------------------------------------*
Name: osInitInterrupts
Description: Initialize Interrupts
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void osInitInterrupt( void );
/*---------------------------------------------------------------------------*
Name: osEnableInterruptID
Description: set Interrupt Set Enable Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osEnableInterruptID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osDisableInterruptID
Description: set Interrupt Clear Enable Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osDisableInterruptID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osRestoreInterruptID
Description: set Interrupt Clear Enable Register
Arguments: id : Interrupt Distributor ID
state : state whether interrupt is enabled
Returns: TRUE if last state is enabled
*---------------------------------------------------------------------------*/
BOOL osRestoreInterruptID( OSIntrID id, BOOL state );
/*---------------------------------------------------------------------------*
Name: osIsInterruptIDPending
Description: set Interrupt Clear Pending Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
static inline BOOL osIsInterruptPending( OSIntrID id )
{
#ifdef SDK_ARM11
u32 ofs = id/32;
u32 sft = id%32;
BOOL retval;
retval = TRUE & (reg_OS_IDR_SET_PND[ofs] >> sft);
#else // SDK_ARM9
OSIntrMask prep = reg_OS_IF;
BOOL retval;
retval = TRUE & (BOOL)(prep >> id);
#endif // SDK_ARM9
return retval;
}
/*---------------------------------------------------------------------------*
Name: osSetInterruptPendingID
Description: set Interrupt Set Pending Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osSetInterruptPendingID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osClearInterruptPendingID
Description: set Interrupt Clear Pending Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osClearInterruptPendingID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osRestoreInterruptPendingID
Description: restore Interrupt Pending
Arguments: id : Interrupt Distributor ID
state : state whether interrupt is enabled
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osRestoreInterruptPendingID( OSIntrID id, BOOL state );
/*---------------------------------------------------------------------------*
Name: osSetEndOfInterruptRegister
Description: set ID to End of Interrupt Register
change state to Inactive.
Arguments: Interrupt Distributor ID
Returns: None
*---------------------------------------------------------------------------*/
void osSetEndOfInterruptRegister( OSIntrID id );
//================================================================================
// WAIT FOR INTERRUPT
//================================================================================
/*---------------------------------------------------------------------------*
Name: osWaitInterruptID
Description: wait specifiled interrupt.
OS_WaitInterrupt doesn't switch thread.
OS_WaitInterrupt wait by using OS_Halt().
Arguments: clear TRUE if want to clear interrupt flag before wait.
FALSE if not.
irqFlags bit of interrupts to wait for
Returns: None
*---------------------------------------------------------------------------*/
void osWaitInterruptID( BOOL clear, OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osWaitInterruptMask
Description: wait specifiled interrupt.
OS_WaitInterrupt doesn't switch thread.
OS_WaitInterrupt wait by using OS_Halt().
Arguments: clear TRUE if want to clear interrupt flag before wait.
FALSE if not.
irqFlags bit of interrupts to wait for
Returns: None
*---------------------------------------------------------------------------*/
void osWaitInterruptMask( BOOL clear, OSIntrMask irqFlags );
//================================================================================
// INTERRUPT FLAG (INCLUDING TO WAIT FOR INTERRUPT)
//================================================================================
/*---------------------------------------------------------------------------*
Name: osSetInterruptCheckID
Description: set irq flag to check being called
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osSetInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osClearInterruptCheckID
Description: clear irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osClearInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckID
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckMask
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be cleared
Returns: TRUE if irq flag exists
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckMask( OSIntrMask mask );
#ifdef __cplusplus
} // extern "C"
#endif
#endif // BROM_OS_INTERRUPT_H_

View File

@ -23,34 +23,41 @@
extern "C" { extern "C" {
#endif #endif
#ifdef SDK_ARM11
#define OS_IDR_CPU0_TARGET_ENABLE HW_IDR_CPU0_TARGET_ENABLE
#define OS_IDR_INTR_PRIO_DEFAULT 8 // Interrupt priority default (0-15)
OSIntrID i_osReadHighestPendingInterruptRegister( void );
OSIntrID i_osReadInterruptAcknowledgeRegister( void );
#endif // SDK_ARM11
/*---------------------------------------------------------------------------*
Name: osInitInterrupts
Description: Initialize Interrupts
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void osInitInterrupt( void );
//================================================================================ //================================================================================
// INTERRUPT MASK // INTERRUPT MASK
//================================================================================ //================================================================================
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osSetInterruptMask Name: osEnableInterruptID
Description: set irq factor Description: set Interrupt Set Enable Register
Arguments: mask irq factor Arguments: Interrupt Distributor ID
Returns: previous factors Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
OSIntrMask osSetInterruptMask( OSIntrMask mask ); BOOL osEnableInterruptID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osGetInterruptMask
Description: get irq factor
Arguments: None
Returns: irq factor which is set now
*---------------------------------------------------------------------------*/
static inline OSIntrMask osGetInterruptMask(void)
{
return reg_OS_IE;
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osEnableInterruptMask Name: osEnableInterruptMask
@ -63,6 +70,17 @@ static inline OSIntrMask osGetInterruptMask(void)
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
OSIntrMask osEnableInterruptMask( OSIntrMask mask ); OSIntrMask osEnableInterruptMask( OSIntrMask mask );
/*---------------------------------------------------------------------------*
Name: osDisableInterruptID
Description: set Interrupt Clear Enable Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osDisableInterruptID( OSIntrID id );
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osDisableInterruptMask Name: osDisableInterruptMask
@ -74,6 +92,29 @@ OSIntrMask osEnableInterruptMask( OSIntrMask mask );
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
OSIntrMask osDisableInterruptMask( OSIntrMask mask ); OSIntrMask osDisableInterruptMask( OSIntrMask mask );
/*---------------------------------------------------------------------------*
Name: osRestoreInterruptID
Description: set Interrupt Clear Enable Register
Arguments: id : Interrupt Distributor ID
state : state whether interrupt is enabled
Returns: TRUE if last state is enabled
*---------------------------------------------------------------------------*/
BOOL osRestoreInterruptID( OSIntrID id, BOOL state );
/*---------------------------------------------------------------------------*
Name: osSetInterruptMask
Description: set irq factor
Arguments: mask irq factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osSetInterruptMask( OSIntrMask mask );
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osRestoreInterruptMask Name: osRestoreInterruptMask
@ -89,72 +130,26 @@ static inline OSIntrMask osRestoreInterruptMask( OSIntrMask mask )
} }
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osEnableInterruptID Name: osGetInterruptMask
Description: set Interrupt Set Enable Register Description: get irq factor
Arguments: Interrupt Distributor ID Arguments: None
Returns: TRUE if last state is pending Returns: irq factor which is set now
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
BOOL osEnableInterruptID( OSIntrID id ); static inline OSIntrMask osGetInterruptMask(void)
{
/*---------------------------------------------------------------------------* #ifdef SDK_ARM11
Name: osDisableInterruptID return reg_OS_IDR_SET_IE_ALL;
#else // SDK_ARM9
Description: set Interrupt Clear Enable Register return reg_OS_IE;
#endif // SDK_ARM9
Arguments: Interrupt Distributor ID }
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osDisableInterruptID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osRestoreInterruptID
Description: set Interrupt Clear Enable Register
Arguments: id : Interrupt Distributor ID
state : state whether interrupt is enabled
Returns: TRUE if last state is enabled
*---------------------------------------------------------------------------*/
BOOL osRestoreInterruptID( OSIntrID id, BOOL state );
//================================================================================ //================================================================================
// INTERRUPT PENDING // INTERRUPT PENDING
//================================================================================ //================================================================================
/*---------------------------------------------------------------------------*
Name: osClearInterruptPendingMask
Description: reset IF bit
(setting bit causes to clear bit for interrupt)
Arguments: intr irq factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osClearInterruptPendingMask( OSIntrMask mask );
/*---------------------------------------------------------------------------*
Name: osGetInterruptPendingMask
Description: get IF bit
Arguments: None
Returns: value of IF
*---------------------------------------------------------------------------*/
static inline OSIntrMask osGetInterruptPendingMask( void )
{
#ifdef SDK_ARM9
return reg_OS_IF;
#else // MPCORE
return reg_OS_IDR_SET_PENDING_ST;
#endif // MPCORE
}
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osClearInterruptPendingID Name: osClearInterruptPendingID
@ -167,7 +162,83 @@ static inline OSIntrMask osGetInterruptPendingMask( void )
BOOL osClearInterruptPendingID( OSIntrID id ); BOOL osClearInterruptPendingID( OSIntrID id );
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osIsInterruptIDPending Name: osClearInterruptPendingMask
Description: reset IF bit
(setting bit causes to clear bit for interrupt)
Arguments: intr irq factor
Returns: previous factors
*---------------------------------------------------------------------------*/
OSIntrMask osClearInterruptPendingMask( OSIntrMask mask );
#ifdef SDK_ARM11
/*---------------------------------------------------------------------------*
Name: osSetInterruptPendingID
Description: set Interrupt Set Pending Register
Arguments: Interrupt Distributor ID
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osSetInterruptPendingID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osRestoreInterruptPendingID
Description: restore Interrupt Pending
Arguments: id : Interrupt Distributor ID
state : state whether interrupt is enabled
Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/
BOOL osRestoreInterruptPendingID( OSIntrID id, BOOL state );
/*---------------------------------------------------------------------------*
Name: osSetEndOfInterruptRegister
Description: set ID to End of Interrupt Register
change state to Inactive.
Arguments: Interrupt Distributor ID
Returns: None
*---------------------------------------------------------------------------*/
void osSetEndOfInterruptRegister( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: i_osReadHighestPendingInterruptRegister
Description: read ID from Highest Pending Interrupt Register
Arguments: None
Returns: Interrupt Distributor ID
*---------------------------------------------------------------------------*/
OSIntrID i_osReadHighestPendingInterruptRegister( void );
/*---------------------------------------------------------------------------*
Name: i_osReadInterruptAcknowledgeRegister
Description: read ID from Interrupt Acknowledge Register
get interrupt ID and change state to NotPending and Active.
Arguments: None
Returns: Interrupt Distributor ID
*---------------------------------------------------------------------------*/
OSIntrID i_osReadInterruptAcknowledgeRegister( void );
#endif // SDK_ARM11
/*---------------------------------------------------------------------------*
Name: osIsInterruptPendingID
Description: set Interrupt Clear Pending Register Description: set Interrupt Clear Pending Register
@ -175,24 +246,27 @@ BOOL osClearInterruptPendingID( OSIntrID id );
Returns: TRUE if last state is pending Returns: TRUE if last state is pending
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static inline BOOL osIsInterruptPending( OSIntrID id ) BOOL osIsInterruptPendingID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osGetInterruptPendingMask
Description: get IF bit
Arguments: None
Returns: value of IF
*---------------------------------------------------------------------------*/
static inline OSIntrMask osGetInterruptPendingMask( void )
{ {
#ifdef SDK_ARM11 #ifdef SDK_ARM11
u32 ofs = id/32; return reg_OS_IDR_SET_PND_ALL;
u32 sft = id%32;
BOOL retval;
retval = TRUE & (reg_OS_IDR_SET_PND[ofs] >> sft);
#else // SDK_ARM9 #else // SDK_ARM9
OSIntrMask prep = reg_OS_IF; return reg_OS_IF;
BOOL retval;
retval = TRUE & (BOOL)(prep >> id);
#endif // SDK_ARM9 #endif // SDK_ARM9
return retval;
} }
//================================================================================ //================================================================================
// INTERRUPT HANDLER // INTERRUPT HANDLER
//================================================================================ //================================================================================
@ -233,7 +307,7 @@ void osSetInterruptHandler( OSIntrID id, OSIntrFunction function );
OSIntrFunction osGetInterruptHandler( OSIntrID id ); OSIntrFunction osGetInterruptHandler( OSIntrID id );
//================================================================================ //================================================================================
// INTERRUPT CHECK // INTERRUPT FLAG (INCLUDING TO WAIT FOR INTERRUPT)
//================================================================================ //================================================================================
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osSetInterruptCheckID Name: osSetInterruptCheckID
@ -246,28 +320,6 @@ OSIntrFunction osGetInterruptHandler( OSIntrID id );
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
BOOL osSetInterruptCheckID( OSIntrID id ); BOOL osSetInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osClearInterruptCheckID
Description: clear irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osClearInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckID
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osSetInterruptCheckMask Name: osSetInterruptCheckMask
@ -279,6 +331,17 @@ BOOL osIsInterruptCheckID( OSIntrID id );
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
void osSetInterruptCheckMask( OSIntrMask intr ); void osSetInterruptCheckMask( OSIntrMask intr );
/*---------------------------------------------------------------------------*
Name: osClearInterruptCheckID
Description: clear irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osClearInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osClearInterruptCheckMask Name: osClearInterruptCheckMask
@ -290,6 +353,28 @@ void osSetInterruptCheckMask( OSIntrMask intr );
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
void osClearInterruptCheckMask( OSIntrMask mask ); void osClearInterruptCheckMask( OSIntrMask mask );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckID
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckMask
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be cleared
Returns: TRUE if irq flag exists
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckMask( OSIntrMask mask );
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Name: osGetInterruptCheckMask Name: osGetInterruptCheckMask
@ -301,7 +386,11 @@ void osClearInterruptCheckMask( OSIntrMask mask );
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static inline OSIntrMask osGetInterruptCheckMask( void ) static inline OSIntrMask osGetInterruptCheckMask( void )
{ {
#ifdef SDK_ARM11
return *(OSIntrMask *)HW_INTR_CHECK0_BUF;
#else // SDK_ARM9
return *(OSIntrMask *)HW_INTR_CHECK_BUF; return *(OSIntrMask *)HW_INTR_CHECK_BUF;
#endif // SDK_ARM9
} }
//================================================================================ //================================================================================
@ -337,53 +426,6 @@ void osWaitInterruptID( BOOL clear, OSIntrID id );
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
void osWaitInterruptMask( BOOL clear, OSIntrMask irqFlags ); void osWaitInterruptMask( BOOL clear, OSIntrMask irqFlags );
//================================================================================
// INTERRUPT FLAG (INCLUDING TO WAIT FOR INTERRUPT)
//================================================================================
/*---------------------------------------------------------------------------*
Name: osSetInterruptCheckID
Description: set irq flag to check being called
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osSetInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osClearInterruptCheckID
Description: clear irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osClearInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckID
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be set
Returns: None
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckID( OSIntrID id );
/*---------------------------------------------------------------------------*
Name: osIsInterruptCheckMask
Description: check irq flag stored in HW_INTR_CHECK_BUF
Arguments: irq factors to be cleared
Returns: TRUE if irq flag exists
*---------------------------------------------------------------------------*/
BOOL osIsInterruptCheckMask( OSIntrMask mask );
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */