?? tstsrv.h
字號:
/*-----------------------------------------------------------------------------
* File: tstsrv.h
*-----------------------------------------------------------------------
* (C) Copyright 2001 Metrowerks Corp.
* ALL RIGHTS RESERVED .
*
* THIS IS CONFIDENTIAL PROPRIETARY SOURCE CODE OF METROWERKS CORP.
*
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
*-----------------------------------------------------------------------
*
* Description:
*
* This file contains the common defines for the tests on i.mx31 board
*
* History:
*
*
*-----------------------------------------------------------------------------*/
#ifndef TSTSRV_H
#define TSTSRV_H
#define DATA_32_BUS_WIDTH 32
#define DATA_64_BUS_WIDTH 64
//----------------------------------------------------------------------
// Assembler Instructions macros
//----------------------------------------------------------------------
//{{{2
// === MACRO ======================================================================
//
// Name: nop
//
// Description: Execute "nop" assembler instruction
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in:
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:54:11 IST
// Revision: none
// =====================================================================================
#define nop() asm ( "nop" );
// ##### EXPORTED TYPE DEFINITIONS ################################################# {{{1
/** Datatype to be used for 8 bit accesses */
//typedef unsigned char UINT08;
/** Datatype to be used for 16 bit accesses */
//typedef unsigned short UINT16;
/** Datatype to be used for 32 bit accesses */
//typedef unsigned long UINT32;
typedef volatile unsigned long WORD;
//typedef volatile unsigned short HALF;
//typedef volatile unsigned char BYTE;
/* ------------ */
/* Return CODES */
/* ------------ */
#define RET_OK 0
#define RET_ERR 1
/*******************/
/* TYPE DEFINITION */
/*******************/
typedef unsigned long ulong;
typedef unsigned long *pulong;
typedef unsigned short ushort;
typedef unsigned short *pushort;
typedef unsigned short word;
typedef unsigned short *pword;
typedef unsigned char byte;
typedef unsigned char *pbyte;
typedef unsigned char uchar;
//----------------------------------------------------------------------
// Some Genaral Macros
//----------------------------------------------------------------------
#define FALSE 0
#define TRUE 1
//----------------------------------------------------------------------
// Basic Read/Write Macros
//----------------------------------------------------------------------
//{{{2
// === MACRO ======================================================================
//
// Name: regN_read(addr)
//
// Description: Basic Register Read/Write Macros -returns register value
// N = 8,16,32 - access size
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD addr
// in-out:
// out: BYTE/HALF/WORD value returned by macro, type depends on
// N
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:37:12 IST
// Revision: none
// =====================================================================================
#define reg8_read(addr) *((BYTE *)(addr))
#define reg16_read(addr) *((HALF *)(addr))
#define reg32_read(addr) *(WORD *)((addr))
// === MACRO ======================================================================
//
// Name: regN_write(addr,val)
//
// Description: Basic Register Read/Write Macros - writes val to addr
// N = 8,16,32 - access size
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD addr address to access
// in: BYTE/HALF/WORD val value to write, Type depends on N
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:38:31 IST
// Revision: none
// =====================================================================================
#define reg8_write(addr,val) *((BYTE *)(addr)) = (val)
#define reg16_write(addr,val) *((HALF *)(addr)) = (val)
#define reg32_write(addr,val) *((WORD *)(addr)) = (val)
// === MACRO ======================================================================
//
// Name: memN_read(addr)
//
// Description: Basic Memory Read/Write Macros - returns memory value
// N = 8,16,32 - access size
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD addr
// in-out:
// out: BYTE/HALF/WORD value returned by macro, type depends on
// N
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:37:12 IST
// Revision: none
// =====================================================================================
#define mem8_read(addr) *((BYTE *)(addr))
#define mem16_read(addr) *((HALF *)(addr))
#define mem32_read(addr) *(WORD *)((addr))
// === MACRO ======================================================================
//
// Name: memN_write(addr,val)
//
// Description: Basic Memory Read/Write Macros - writes val to addr
// N = 8,16,32 - access size
//
// - PARAMETER -------------------------------------------------------------------------
// Mode Type Name Description
// -------------------------------------------------------------------------------------
// in: WORD addr address to access
// in: BYTE/HALF/WORD val value to write, Type depends on N
// in-out:
// out:
// return:
// -------------------------------------------------------------------------------------
// Author:
// Created: 03/01/04 13:38:31 IST
// Revision: none
// =====================================================================================
#define mem8_write(addr,val) *((BYTE *)(addr)) = (val)
#define mem16_write(addr,val) *((HALF *)(addr)) = (val)
#define mem32_write(addr,val) *((WORD *)(addr)) = (val)
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -