sis_regs.h

来自「君正早期ucos系统(只有早期的才不没有打包成库),MPLAYER,文件系统,图」· C头文件 代码 · 共 414 行 · 第 1/2 页

H
414
字号
/* *  SiS register definitions and access macros *  From SiS X11 driver * *  Copyright (C) 2001-2003 by Thomas Winischhofer, Vienna, Austria * * This file is part of MPlayer. * * MPlayer is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * MPlayer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MPlayer; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */#ifndef VIDIX_SIS_REGS_H#define VIDIX_SIS_REGS_H#define inSISREG(base)          INPORT8(base)#define outSISREG(base,val)     OUTPORT8(base, val)#define orSISREG(base,val)      do { \                      unsigned char __Temp = INPORT8(base); \                      outSISREG(base, __Temp | (val)); \                    } while (0)#define andSISREG(base,val)     do { \                      unsigned char __Temp = INPORT8(base); \                      outSISREG(base, __Temp & (val)); \                    } while (0)#define inSISIDXREG(base,idx,var)   do { \                      OUTPORT8(base, idx); var=INPORT8((base)+1); \                    } while (0)#define outSISIDXREG(base,idx,val)  do { \                      OUTPORT8(base, idx); OUTPORT8((base)+1, val); \                    } while (0)#define orSISIDXREG(base,idx,val)   do { \                      unsigned char __Temp; \                      OUTPORT8(base, idx);   \                      __Temp = INPORT8((base)+1)|(val); \                      outSISIDXREG(base,idx,__Temp); \                    } while (0)#define andSISIDXREG(base,idx,and)  do { \                      unsigned char __Temp; \                      OUTPORT8(base, idx);   \                      __Temp = INPORT8((base)+1)&(and); \                      outSISIDXREG(base,idx,__Temp); \                    } while (0)#define setSISIDXREG(base,idx,and,or)   do { \                      unsigned char __Temp; \                      OUTPORT8(base, idx);   \                      __Temp = (INPORT8((base)+1)&(and))|(or); \                      outSISIDXREG(base,idx,__Temp); \                    } while (0)#define BITMASK(h,l)    (((unsigned)(1U << ((h)-(l)+1))-1)<<(l))#define GENMASK(mask)   BITMASK(1?mask,0?mask)#define GETBITS(var,mask)   	(((var) & GENMASK(mask)) >> (0?mask))#define SETBITS(val,mask)   	((val) << (0?mask))#define SETBIT(n)       	(1<<(n))#define GETBITSTR(val,from,to)  ((GETBITS(val,from)) << (0?to))#define SETVARBITS(var,val,from,to) (((var)&(~(GENMASK(to)))) | \                                    GETBITSTR(val,from,to))#define GETVAR8(var)        ((var)&0xFF)#define SETVAR8(var,val)    (var) =  GETVAR8(val)/* #define VGA_RELIO_BASE  0x380 */#define AROFFSET        0x40	/* VGA_ATTR_INDEX - VGA_RELIO_BASE */#define ARROFFSET       0x41	/* VGA_ATTR_DATA_R - VGA_RELIO_BASE  */#define GROFFSET        0x4e	/* VGA_GRAPH_INDEX - VGA_RELIO_BASE */#define SROFFSET        0x44	/* VGA_SEQ_INDEX - VGA_RELIO_BASE */#define CROFFSET        0x54	/* VGA_CRTC_INDEX_OFFSET + VGA_IOBASE_COLOR - VGA_RELIO_BASE */#define MISCROFFSET     0x4c	/* VGA_MISC_OUT_R - VGA_RELIO_BASE */#define MISCWOFFSET     0x42	/* VGA_MISC_OUT_W - VGA_RELIO_BASE */#define INPUTSTATOFFSET 0x5A#define PART1OFFSET     0x04#define PART2OFFSET     0x10#define PART3OFFSET     0x12#define PART4OFFSET     0x14#define PART5OFFSET     0x16#define VIDEOOFFSET     0x02#define COLREGOFFSET    0x48#define SIS_IOBASE  sis_iobase	/* var defined in sis_vid.c */#define SISAR       SIS_IOBASE + AROFFSET#define SISARR      SIS_IOBASE + ARROFFSET#define SISGR       SIS_IOBASE + GROFFSET#define SISSR       SIS_IOBASE + SROFFSET#define SISCR       SIS_IOBASE + CROFFSET#define SISMISCR    SIS_IOBASE + MISCROFFSET#define SISMISCW    SIS_IOBASE + MISCWOFFSET#define SISINPSTAT  SIS_IOBASE + INPUTSTATOFFSET#define SISPART1    SIS_IOBASE + PART1OFFSET#define SISPART2    SIS_IOBASE + PART2OFFSET#define SISPART3    SIS_IOBASE + PART3OFFSET#define SISPART4    SIS_IOBASE + PART4OFFSET#define SISPART5    SIS_IOBASE + PART5OFFSET#define SISVID      SIS_IOBASE + VIDEOOFFSET#define SISCOLIDX   SIS_IOBASE + COLREGOFFSET#define SISCOLDATA  SIS_IOBASE + COLREGOFFSET + 1#define SISCOL2IDX  SISPART5#define SISCOL2DATA SISPART5 + 1#define vc_index_offset    0x00	/* Video capture - unused */#define vc_data_offset     0x01#define vi_index_offset    VIDEOOFFSET#define vi_data_offset     (VIDEOOFFSET + 1)#define crt2_index_offset  PART1OFFSET#define crt2_port_offset   (PART1OFFSET + 1)#define sr_index_offset    SROFFSET#define sr_data_offset     (SROFFSET + 1)#define cr_index_offset    CROFFSET#define cr_data_offset     (CROFFSET + 1)#define input_stat         INPUTSTATOFFSET/* For old chipsets (5597/5598, 6326, 530/620) ------------ *//* SR (3C4) */#define BankReg 0x06#define ClockReg 0x07#define CPUThreshold 0x08#define CRTThreshold 0x09#define CRTCOff 0x0A#define DualBanks 0x0B#define MMIOEnable 0x0B#define RAMSize 0x0C#define Mode64 0x0C#define ExtConfStatus1 0x0E#define ClockBase 0x13#define LinearAdd0 0x20#define LinearAdd1 0x21#define GraphEng 0x27#define MemClock0 0x28#define MemClock1 0x29#define XR2A 0x2A#define XR2B 0x2B#define TurboQueueBase 0x2C#define FBSize 0x2F#define ExtMiscCont5 0x34#define ExtMiscCont9 0x3C/* 3x4 */#define Offset 0x13/* SiS Registers for 300, 540, 630, 730, 315, 550, 650, 740 *//* VGA standard register */#define  Index_SR_Graphic_Mode                  0x06#define  Index_SR_RAMDAC_Ctrl                   0x07#define  Index_SR_Threshold_Ctrl1               0x08#define  Index_SR_Threshold_Ctrl2               0x09#define  Index_SR_Misc_Ctrl                     0x0F#define  Index_SR_DDC                           0x11#define  Index_SR_Feature_Connector_Ctrl        0x12#define  Index_SR_DRAM_Sizing                   0x14#define  Index_SR_DRAM_State_Machine_Ctrl       0x15#define  Index_SR_AGP_PCI_State_Machine         0x21#define  Index_SR_Internal_MCLK0                0x28#define  Index_SR_Internal_MCLK1                0x29#define  Index_SR_Internal_DCLK1                0x2B#define  Index_SR_Internal_DCLK2                0x2C#define  Index_SR_Internal_DCLK3                0x2D#define  Index_SR_Ext_Clock_Sel                 0x32#define  Index_SR_Int_Status                    0x34#define  Index_SR_Int_Enable                    0x35#define  Index_SR_Int_Reset                     0x36#define  Index_SR_Power_On_Trap                 0x38#define  Index_SR_Power_On_Trap2                0x39#define  Index_SR_Power_On_Trap3                0x3A/* video registers (300/630/730/315/550/650/740 only) */#define  Index_VI_Passwd                        0x00/* Video overlay horizontal start/end, unit=screen pixels */#define  Index_VI_Win_Hor_Disp_Start_Low        0x01#define  Index_VI_Win_Hor_Disp_End_Low          0x02#define  Index_VI_Win_Hor_Over                  0x03	/* Overflow *//* Video overlay vertical start/end, unit=screen pixels */#define  Index_VI_Win_Ver_Disp_Start_Low        0x04#define  Index_VI_Win_Ver_Disp_End_Low          0x05#define  Index_VI_Win_Ver_Over                  0x06	/* Overflow *//* Y Plane (4:2:0) or YUV (4:2:2) buffer start address, unit=word */#define  Index_VI_Disp_Y_Buf_Start_Low          0x07#define  Index_VI_Disp_Y_Buf_Start_Middle       0x08#define  Index_VI_Disp_Y_Buf_Start_High         0x09/* U Plane (4:2:0) buffer start address, unit=word */#define  Index_VI_U_Buf_Start_Low               0x0A#define  Index_VI_U_Buf_Start_Middle            0x0B#define  Index_VI_U_Buf_Start_High              0x0C/* V Plane (4:2:0) buffer start address, unit=word */#define  Index_VI_V_Buf_Start_Low               0x0D#define  Index_VI_V_Buf_Start_Middle            0x0E#define  Index_VI_V_Buf_Start_High              0x0F

⌨️ 快捷键说明

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