mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@95 b871894f-2f95-9b40-918c-086798483c85
171 lines
4.5 KiB
C
171 lines
4.5 KiB
C
/*---------------------------------------------------------------------------*
|
|
Project: CtrBrom - OS - include
|
|
File: interrupt_common.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_COMMON_H_
|
|
#define BROM_OS_INTERRUPT_COMMON_H_
|
|
|
|
#include <brom/types.h>
|
|
#include <brom/memorymap.h>
|
|
#include <ctr/ioreg.h>
|
|
#ifdef SDK_ARM11
|
|
#include <brom/os/ARM11/interrupt_types.h>
|
|
#else // SDK_ARM9
|
|
#include <brom/os/ARM9/interrupt_types.h>
|
|
#endif // SDK_ARM9
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
typedef u32 OSIntrMode;
|
|
|
|
typedef enum
|
|
{
|
|
OS_IRQ_DISABLE = HW_PSR_IRQ_DISABLE,
|
|
OS_IRQ_ENABLE = 0
|
|
}
|
|
OSIrqMode;
|
|
|
|
typedef enum
|
|
{
|
|
OS_FIQ_DISABLE = HW_PSR_FIQ_DISABLE,
|
|
OS_FIQ_ENABLE = 0
|
|
}
|
|
OSFiqMode;
|
|
|
|
|
|
//---- interrupt handler type
|
|
//typedef IRQ void (*OSIntrHandler) (void);
|
|
typedef void (*OSIntrHandler) (void);
|
|
typedef void (*OSIntrFunction) (void);
|
|
|
|
|
|
|
|
//IRQ void osInterruptHandler( void );
|
|
void osInterruptHandler( void );
|
|
void i_osInitInterruptTable( void );
|
|
|
|
OSIntrMode osEnableIrq( void );
|
|
OSIntrMode osDisableIrq( void );
|
|
OSIntrMode osRestoreIrq( OSIntrMode state );
|
|
|
|
OSIntrMode osEnableFiq( void );
|
|
OSIntrMode osDisableFiq( void );
|
|
OSIntrMode osRestoreFiq( OSIntrMode state );
|
|
|
|
OSIntrMode osEnableIrqAndFiq( void );
|
|
OSIntrMode osDisableIrqAndFiq( void );
|
|
OSIntrMode osRestoreIrqAndFiq( OSIntrMode state );
|
|
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osInitInterrupt
|
|
|
|
Description: Initialize Interrupts
|
|
|
|
Arguments: None
|
|
|
|
Returns: None
|
|
*---------------------------------------------------------------------------*/
|
|
void osInitInterrupt( void );
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osSetInterruptHandler
|
|
|
|
Description: Set interrupt handler
|
|
|
|
Arguments: interrupt ID
|
|
interrupt handler
|
|
|
|
Returns: None
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
void osSetInterruptHandler( OSIntrID id, OSIntrFunction handler );
|
|
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osHalt
|
|
|
|
Description: Halt CPU Core until Interrupt
|
|
|
|
Arguments: None
|
|
|
|
Returns: None
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
void osHalt( void );
|
|
|
|
#ifdef SDK_ARM9
|
|
#else // SDK_MPCORE
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osHaltUntilEvent
|
|
|
|
Description: Halt CPU Core until Event
|
|
|
|
Arguments: None
|
|
|
|
Returns: None
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
void osHaltUntilEvent( void );
|
|
|
|
#endif // SDK_MPCORE
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osEnableInterrupts
|
|
|
|
Description: Set CPSR to enable irq and fiq interrupts
|
|
|
|
Arguments: None.
|
|
|
|
Returns: last state of HW_PSR_IRQ_DISABLE & HW_PSR_FIQ_DISABLE
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
OSIntrMode osEnableInterrupts( void );
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osDisableInterrupts
|
|
|
|
Description: Set CPSR to disable irq and fiq interrupts
|
|
|
|
Arguments: None.
|
|
|
|
Returns: last state of HW_PSR_IRQ_DISABLE & HW_PSR_FIQ_DISABLE
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
OSIntrMode osDisableInterrupts( void );
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: osRestoreInterrupts
|
|
|
|
Description: Restore CPSR irq and fiq interrupts
|
|
|
|
Arguments: state of irq interrupt bit
|
|
|
|
Returns: last state of HW_PSR_IRQ_DISABLE & HW_PSR_FIQ_DISABLE
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
OSIntrMode osRestoreInterrupts( OSIntrMode state );
|
|
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // BROM_OS_INTERRUPT_COMMON_H_
|