⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trg.h

📁 SEED的VPM642测试程序-板级支持库
💻 H
字号:
/*
 *  Copyright 2003 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DSP/BIOS 4.90.270 12-18-03 (barracuda-o04)" */
/*
 *  ======== trg.h ========
 *
 *  Target processor dependencies:
 *
 */

#ifndef TRG_
#define TRG_

/*
 *  TaRGet processor attributes include:
 *
 *  TRG_MAUBITS		Native MAU size in BITS
 *  TRG_WORDBITS	Native WORD size in BITS
 *  TRG_LONGBITS	Native LONG size in BITS
 *
 *  TRG_WORDMAUS	Native WORD size in MAUS
 *
 *  TRG_StackEntry	Stack data type
 *  TRG_STACKGROWTH	-1 if stack grows toward lower memory
 *			+1 if stack grows toward higher memory
 *  TRG_STACKSTAMP	Distinguished stack element for TSK_stat
 *  TRG_STACKALIGN	In sizeof() operator units (see mem_alloc.c)
 *
 */

#include <fxn.h>

#if defined(_54_)
#define TRG_MAUBITS		16
#define TRG_WORDBITS		16
#define TRG_LONGBITS		32
#define TRG_WORDMAUS		1
#define TRG_STACKGROWTH		-1
#define TRG_STACKSTAMP		0xBEEF
#define TRG_STACKALIGN		1

#elif defined(_55_)
#define TRG_MAUBITS		16
#define TRG_WORDBITS		16
#define TRG_LONGBITS		32
#define TRG_WORDMAUS		1
#define TRG_STACKGROWTH		-1
#define TRG_STACKSTAMP		0xBEEF
#define TRG_SYSSTACKSTAMP	0xFEEB 
#define TRG_STACKALIGN		2

#elif defined(_62_)
#include <hwi.h>
#define TRG_MAUBITS		8
#define TRG_WORDBITS		32
#define TRG_LONGBITS	        32	/* Note! sizeof(long) == 5 not 4! */
#define TRG_WORDMAUS		4
#define TRG_STACKGROWTH		-1
#define TRG_STACKSTAMP		0xBE
#define TRG_STACKALIGN		8

#elif defined(_28_)
#define TRG_MAUBITS		16
#define TRG_WORDBITS		16
#define TRG_LONGBITS	        32	/* Note! sizeof(long) == 5 not 4! */
#define TRG_WORDMAUS		1
#define TRG_STACKGROWTH		1
#define TRG_STACKSTAMP		0xBEEF
#define TRG_STACKALIGN		2

#elif defined(_SUN_)
#define TRG_MAUBITS		8
#define TRG_WORDBITS		32
#define TRG_LONGBITS		32
#define TRG_WORDMAUS		4
#define TRG_STACKGROWTH		-1		/* ?? */
#define TRG_STACKSTAMP		0xBE
#define TRG_STACKALIGN		1

#else
#error Unsupport target processor
#endif

#ifdef __cplusplus
extern "C" {
#endif

typedef Uns		TRG_IntState;
typedef unsigned char	TRG_StackEntry;
typedef TRG_StackEntry	*TRG_StackPtr;
 
/*
 *  ======== TRG_init ========
 */
#define	TRG_init	FXN_F_nop

/*
 *  ======== TRG_stkbottom ========
 *  Returns the bottom of a stack given the base address and size.
 *  (dependent on whether stacks grow up or down)
 */
#if TRG_STACKGROWTH < 0

#define TRG_stkbottom(base, size) \
	( (Ptr)(((Char *)(base)) + (size) - TRG_STACKALIGN) )

#else	/* TRG_STACKGROWTH < 0 */

#define TRG_stkbottom(base, size)	(base)

#endif	/* TRG_STACKGROWTH < 0 */

/*
 *  ======== TRG_stkok ========
 */
#if TRG_STACKGROWTH < 0

#define TRG_stkok(base, size) ( *(TRG_StackPtr)base == TRG_STACKSTAMP )

#else

#define TRG_stkok(base, size) \
    ( *((TRG_StackPtr)base + size - 1) == TRG_STACKSTAMP )

#endif

#if defined(_55_)
#define TRG_sysstkok(base, size) ( *(TRG_StackPtr)base == TRG_SYSSTACKSTAMP )
extern Int TRG_sysstkused(Ptr base, Uns size);
#endif

extern Int TRG_stkused(Ptr base, Uns size);

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* TRG_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -