📄 common.h
字号:
/* Copyright 1996, ESS Technology, Inc. *//* SCCSID @(#)common.h 4.12 02/06/04 *//* * $Log$ *//************************************************************ * common.h contains general definitions and global variables * declaration, always include as 1st header in all files ************************************************************/#ifndef _COMMON_H_ #define _COMMON_H_/* * **************** General Definitions **************** */#ifdef MAIN#define GBLDEF(name,value) name = value#define GBLDEF_0(name,value) name#define GBLDEF0(name) name#else#define GBLDEF(name,value) extern name#define GBLDEF_0(name,value) extern name#define GBLDEF0(name) extern name#endif#ifdef MAIN_AC3#define GBLAC3(name) name#define GBLAC3DEF(name,value) name = value#else#define GBLAC3(name) extern name#define GBLAC3DEF(name,value) extern name#endif#ifdef MAIN_WMA#define GBLWMA(name) name#define GBLWMADEF(name,value) name = value#else#define GBLWMA(name) extern name#define GBLWMADEF(name,value) extern name#endif#define cat2(i,j) i##j#define cat3(i,j,k) i##j##k#define max2(a,b) ((a)>(b)?(a):(b))#define max3(a,b,c) max2(max2(a,b),c)#define min2(a,b) ((a)<(b)?(a):(b))#define min3(a,b,c) min2(min2(a,b),c)#define IDLECLK (CPUCLK/8) /* Internal 3210's clock divider*/#ifndef FAKE#define PROTECT(a) do {mvd[riface_irqsuppress] = 0;\ asm("nop"); asm("nop"); a;} while (0)GBLDEF(unsigned int x12000000, 0x12000000);GBLDEF(unsigned int x02000000, 0x02000000);#define dram(a) (x12000000 | ((a)<<2))#define undram(a) (((uint)(a) & ~0x12000000) >> 2)#define dram_cached(a) (x02000000 | ((a)<<2))register int reg0 asm("r0");register volatile int *mvd asm("r27");#else#define PROTECT(a) (a)#define dram(a) (a)#define undram(a) (a)#define dram_cached(a) (a)#endif#ifdef BILINGUAL_OSD#define assign_osd_msg(ptr, msg, c_ptr, c_msg) { ptr = msg; c_ptr = c_msg; }#else#define assign_osd_msg(ptr, msg, c_ptr, c_msg) { ptr = msg; }#endif/*GBLDEF(int mvd_version, 0x3210); /* Current chip version (3210 only!) *//************************************************************ * addressing conversion goodies. * a2x, a2y pair convert linear address to components used in dmax and dmay. * xy2a convert a 2d coordinate(x,y) with width to a linear address. * placed here because both riscbus.h and vp.h shares it. ************************************************************/#define a2x(a) ((a) & 0x1ff)#define a2y(a) ((a) >> 9)#define xy2a(x,y,width) ((y)*(width)+(x))/************************************************************ * for portability reason ************************************************************/#define uchar unsigned char#define ushort unsigned short#define uint unsigned/************************************************************ * classifier for public functions ************************************************************/#define EXPORT extern#define IMPORT extern#define PUBLIC#define PRIVATE static/* Global typedefs */typedef void (*PFV)(); /* Pointer to func. returning void */ typedef int (*PFI)(); /* Pointer to func. returning int */ typedef uint (*PFUI)(); /* Pointer to func. returning uint */ #endif /* _COMMON_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -