ntr_bootrom/trunk/IrisMainp/IrisMon/IrisMonMacro.h

81 lines
2.5 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//*******************************************************************
// IRISモニタプログラム マクロ関数
//*******************************************************************
#ifndef _IRIS_MON_MACRO_H
#define _IRIS_MON_MACRO_H
#include <IrisTypes.h>
#include "IrisMonTarget.h"
//----------------------------------------------------------------------
// サブプロセッサ・インタフェース受信
//----------------------------------------------------------------------
#define RecvSubpIntf() \
\
((*(vSubpIntf *)REG_SUBPINTF).recvStatus)
//----------------------------------------------------------------------
// クリア
//----------------------------------------------------------------------
#define CpuClear16_32(data, destp, size, bit) \
{ \
u##bit tmp = (vu##bit )(data); \
CpuSet16_32((u8 *)&(tmp), (u8 *)(destp), ( \
DMA_SRC_FIX | \
DMA_##bit##BIT_BUS | (size)/((bit)/8))); \
}
#define CpuArrayClear16_32( data, destp, bit) \
CpuClear16_32( data, destp, sizeof(destp), bit)
//----------------------------------------------------------------------
// コピー
//----------------------------------------------------------------------
#define CpuCopy16_32(srcp, destp, size, bit) \
\
CpuSet16_32((u8 *)(srcp), (u8 *)(destp), ( \
DMA_SRC_INC | \
DMA_##bit##BIT_BUS | (size)/((bit)/8)))
#define CpuArrayCopy16_32( srcp, destp, bit) \
CpuCopy16_32( srcp, destp, sizeof(srcp), bit)
//----------------------------------------------------------------------
// 高速クリア(32Byte単位)
//----------------------------------------------------------------------
#define CpuClearFast32(data, destp, size) \
{ \
u32 tmp = (vu32 )(data); \
CpuSetFast32((u8 *)&(tmp), (u8 *)(destp), ( \
DMA_SRC_FIX | (size)/(32/8))); \
}
#define CpuClearArrayFast32( data, destp) \
CpuClearFast32( data, destp, sizeof(destp))
//----------------------------------------------------------------------
// 高速コピー(32Byte単位)
//----------------------------------------------------------------------
#define CpuCopyFast32(srcp, destp, size) \
\
CpuSetFast32((u8 *)(srcp), (u8 *)(destp), ( \
DMA_SRC_INC | (size)/(32/8)))
#define CpuCopyArrayFast32( srcp, destp) \
CpuCopyFast32( srcp, destp, sizeof(srcp))
#endif // _IRIS_MON_MACRO_H