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@296 b871894f-2f95-9b40-918c-086798483c85
100 lines
3.2 KiB
C
100 lines
3.2 KiB
C
/*---------------------------------------------------------------------------*
|
|
Project: CtrBrom - MI - include
|
|
File: exclusive.h
|
|
|
|
Copyright 2009 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_MI_EXCLUSIVE_H_
|
|
#define BROM_MI_EXCLUSIVE_H_
|
|
|
|
#include <brom/misc.h>
|
|
#include <brom/types.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum
|
|
{
|
|
MI_STREX_SUCCESS = 0, // 排他ストア成功
|
|
MI_STREX_ERROR = 1 // 排他ストアエラー
|
|
}
|
|
MIStrExErr;
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: miSwap[Byte|Word]
|
|
|
|
Description: swap data and memory
|
|
|
|
Arguments: setData data to swap
|
|
destp memory address to swap
|
|
|
|
Returns: swapped memory data
|
|
|
|
*Notice: Cannot access to main memory by byte unless cache.
|
|
Use miSwapByte() not miSwapWord() basically.
|
|
*---------------------------------------------------------------------------*/
|
|
//---- by byte
|
|
u8 miSwapByte(u8 setData, u8 *destp);
|
|
|
|
//---- by word
|
|
u32 miSwapWord(u32 setData, u32 *destp);
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: miLoadExclusive[Byte|HalfWord|Word|DoubleWord]
|
|
|
|
Description: load exclusive data and memory
|
|
|
|
Arguments: destp memory address to load exclusive
|
|
|
|
Returns: loaded memory data
|
|
*---------------------------------------------------------------------------*/
|
|
u8 miLoadExclusiveByte( u8* destp );
|
|
u16 miLoadExclusiveHalfWord( u16* destp );
|
|
u32 miLoadExclusiveWord( u32* destp );
|
|
u64 miLoadExclusiveDoubleWord( u64* destp );
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: miStoreExclusive[Byte|HalfWord|Word|DoubleWord]
|
|
|
|
Description: store exclusive data and memory
|
|
|
|
Arguments: setData data to store exclusive
|
|
destp memory address to store exclusive
|
|
|
|
Returns: MI_STREX_SUCCESS success
|
|
MI_STREX_ERROR error of store exclusive
|
|
*---------------------------------------------------------------------------*/
|
|
MIStrExErr miStoreExclusiveByte( u8 setData, u8* destp );
|
|
MIStrExErr miStoreExclusiveHalfWord( u16 setData, u16* destp );
|
|
MIStrExErr miStoreExclusiveWord( u32 setData, u32* destp );
|
|
MIStrExErr miStoreExclusiveDoubleWord( u64 setData, u64* destp );
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: miClearExclusiveAccess
|
|
|
|
Description: clear exclusive access
|
|
|
|
Arguments: None.
|
|
|
|
Returns: None.
|
|
*---------------------------------------------------------------------------*/
|
|
void miClearExclusiveAccess( void );
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern "C" */
|
|
#endif
|
|
|
|
/* BROM_MI_EXCLUSIVE_H_ */
|
|
#endif
|