ntr_bootrom/trunk/IrisSubp/IrisSubpMon/IrisSubpMonMacro.h

98 lines
3.1 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_SUBP_MON_MACRO_H
#define _IRIS_SUBP_MON_MACRO_H
#include <IrisSubpTypes.h>
#include "IrisSubpMonTarget.h"
//----------------------------------------------------------------------
// CRC16bit初期値 0xffff 算出
//----------------------------------------------------------------------
#define GetInvCRC16(datap, size) \
\
GetCRC16(0xffff, datap, size)
//----------------------------------------------------------------------
// メインプロセッサ・インタフェース受信
//----------------------------------------------------------------------
#define RecvMainpIntf() \
\
((*(vMainpIntf *)REG_MAINPINTF).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 CpuArrayFastClear32( data, destp) \
CpuFastClear32( data, destp, sizeof(destp))
//----------------------------------------------------------------------
// 高速コピー(32Byte単位)
//----------------------------------------------------------------------
#define CpuCopyFast32(srcp, destp, size) \
\
CpuSetFast32((u8 *)(srcp), (u8 *)(destp), ( \
DMA_SRC_INC | (size)/(32/8)))
#define CpuCopyFast32Fook(srcp, destp, size) \
\
CpuSetFast32Fook((u8 *)(srcp), (u8 *)(destp), ( \
DMA_SRC_INC | (size)/(32/8)))
#define CpuArrayFastCopy32( srcp, destp) \
CpuFastCopy32( srcp, destp, sizeof(srcp))
#define CpuArrayFastCopy32Fook( srcp, destp) \
CpuFastCopy32Fook( srcp, destp, sizeof(srcp))
#endif /* _IRIS_SUBP_MON_MACRO_H */