📄 common.h
字号:
/* Copyright 1996, ESS Technology, Inc. *//* SCCSID @(#)common.h 1.33 6/9/98 *//* * $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#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)#ifdef CLKDIV#define IDLECLK (CPUCLK/8.0) /* Internal 3210's clock divider*/#else#define IDLECLK _IDLECLK_ /* Clock from 3207/9 */#endif#ifndef FAKE#define PROTECT(a) do {mvd[riface_irqsuppress] = 0;\ asm("nop"); asm("nop"); a;} while (0)GBLDEF(int x12000000, 0x12000000);GBLDEF(int x02000000, 0x02000000);#define dram(a) (x12000000 + ((a)<<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 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#if (defined(FOUR_LINE_OSD) && !defined(BF43))#define ADJUST_4_LINE 244 /* DRAM adjustment for stack */#else#define ADJUST_4_LINE 0 /* No DRAM adjustment for stack */#endifGBLDEF_0(int mvd_version, 0); /* Current chip version (3208 vs 3210) */GBLDEF_0(int rev3210, 0); /* 0: rev V and earlier * * 1: rev T (not for production) and * * rev S (3880) */GBLDEF_0(int DSC_version, 0); /* 0: pre-3207VA; 1: 3881/3883 etc. */GBLDEF_0(unsigned short * VP_ucode_offset, 0); /* VP ucode offsets (differnt on versions) *//************************************************************ * 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 */ #endif /* _COMMON_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -