1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: os_MemoryBarrier.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_OS_ARM_OS_MEMORYBARRIER_H_ 17 #define NN_OS_ARM_OS_MEMORYBARRIER_H_ 18 19 #ifdef __cplusplus 20 21 #include <nn/config.h> 22 23 namespace nn { 24 namespace os { 25 namespace ARM { 26 27 DataSynchronizationBarrier()28 inline void DataSynchronizationBarrier() 29 { 30 NN_ASM("mcr p15, 0, 0, c7, c10, 4"); 31 } 32 DataMemoryBarrier()33 inline void DataMemoryBarrier() 34 { 35 #ifdef NN_PROCESSOR_ARM_V6 36 NN_ASM("mcr p15, 0, 0, c7, c10, 5"); 37 #endif 38 } 39 InstructionMemoryBarrier()40 inline void InstructionMemoryBarrier() 41 { 42 #ifdef NN_PROCESSOR_ARM_V6 43 NN_ASM("mcr p15, 0, 0, c7, c5, 4"); 44 #endif 45 } 46 47 48 } // end of namespace ARM 49 } // end of namespace os 50 } // end of namespace nn 51 52 #endif // __cplusplus 53 54 #endif /* NN_OS_ARM_OS_MEMORYBARRIER_H_ */ 55