From 784cfe1d07259ba7faaa4f64a8d59c56d7a55641 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Thu, 17 Jun 2010 13:10:37 -0400 Subject: [PATCH] Staging: xgifb: Remove use of TC define Signed-off-by: Bill Pemberton Cc: Arnaud Patard Signed-off-by: Greg Kroah-Hartman --- drivers/staging/xgifb/osdef.h | 17 ---- drivers/staging/xgifb/vb_setmode.c | 188 ------------------------------------- drivers/staging/xgifb/vb_util.c | 9 -- 3 files changed, 214 deletions(-) diff --git a/drivers/staging/xgifb/osdef.h b/drivers/staging/xgifb/osdef.h index 83fffe1..01a8720 100644 --- a/drivers/staging/xgifb/osdef.h +++ b/drivers/staging/xgifb/osdef.h @@ -1,7 +1,6 @@ #ifndef _OSDEF_H_ #define _OSDEF_H_ -/* #define TC */ #define LINUX_KERNEL /* #define LINUX_XF86 */ @@ -12,8 +11,6 @@ /**********************************************************************/ -#ifdef TC -#endif #ifdef LINUX_XF86 #define LINUX #endif @@ -22,9 +19,6 @@ #endif /**********************************************************************/ -#ifdef TC -#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize); -#endif #ifdef LINUX_XF86 #define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) #endif @@ -35,9 +29,6 @@ /**********************************************************************/ -#ifdef TC -#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length); -#endif #ifdef LINUX_XF86 #define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length) #endif @@ -75,14 +66,6 @@ /* TC */ /**********************************************************************/ -#ifdef TC -#define OutPortByte(p,v) outp((unsigned short)(p),(unsigned char)(v)) -#define OutPortWord(p,v) outp((unsigned short)(p),(unsigned short)(v)) -#define OutPortLong(p,v) outp((unsigned short)(p),(unsigned long)(v)) -#define InPortByte(p) inp((unsigned short)(p)) -#define InPortWord(p) inp((unsigned short)(p)) -#define InPortLong(p) ((inp((unsigned short)(p+2))<<16) | inp((unsigned short)(p))) -#endif /**********************************************************************/ /* LINUX XF86 */ diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 8da9715..9f5ce8c 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c @@ -1,11 +1,5 @@ #include "osdef.h" -#ifdef TC -#include -#include -#include -#include -#endif #ifdef LINUX_XF86 @@ -3996,57 +3990,6 @@ BOOLEAN XGI_GetLCDInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBI BOOLEAN XGI_SearchModeID( USHORT ModeNo , USHORT *ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) { -#ifdef TC - - if ( ModeNo <= 5 ) - ModeNo |= 1 ; - - if ( ModeNo <= 0x13 ) - { - /* for (*ModeIdIndex=0;*ModeIdIndexSModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ - for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) - { - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) - break ; - if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) - return( FALSE ) ; - } - - VGA_INFO = ( PUCHAR )MK_FP( 0 , 0x489 ) ; - - if ( ModeNo == 0x07 ) - { - if ( ( *VGA_INFO & 0x10 ) != 0 ) - ( *ModeIdIndex )++ ; /* 400 lines */ - /* else 350 lines */ - } - - if ( ModeNo <= 3 ) - { - if ( ( *VGA_INFO & 0x80 ) == 0 ) - { - ( *ModeIdIndex )++ ; - if ( ( *VGA_INFO & 0x10 ) != 0 ) - ( *ModeIdIndex )++ ; /* 400 lines */ - /* else 350 lines */ - } - /* else 200 lines */ - } - } - else - { - /* for (*ModeIdIndex=0;*ModeIdIndexEModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ - for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) - { - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) - break ; - if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) - return( FALSE ) ; - } - } - - -#endif #ifdef LINUX /* chiawen for linux solution */ @@ -4448,141 +4391,10 @@ void XGI_SenseCRT1( PVB_DEVICE_INFO pVBInfo ) -#ifdef TC -/* --------------------------------------------------------------------- */ -/* Function : INT1AReturnCode */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -int INT1AReturnCode( union REGS regs ) -{ - if ( regs.x.cflag ) - { - /* printf( "Error to find pci device!\n" ) ; */ - return( 1 ) ; - } - - switch(regs.h.ah) - { - case 0: return 0; - break ; - case 0x81: - printf( "Function not support\n" ) ; - break ; - case 0x83: - printf( "bad vendor id\n" ) ; - break ; - case 0x86: - printf( "device not found\n" ) ; - break ; - case 0x87: - printf( "bad register number\n" ) ; - break ; - case 0x88: - printf( "set failed\n" ) ; - break ; - case 0x89: - printf( "buffer too small" ) ; - break ; - default: - break ; - } - return( 1 ) ; -} - - -/* --------------------------------------------------------------------- */ -/* Function : FindPCIIOBase */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -unsigned FindPCIIOBase( unsigned index , unsigned deviceid ) -{ - union REGS regs ; - - regs.h.ah = 0xb1 ; /* PCI_FUNCTION_ID */ - regs.h.al = 0x02 ; /* FIND_PCI_DEVICE */ - regs.x.cx = deviceid ; - regs.x.dx = 0x1039 ; - regs.x.si = index ; /* find n-th device */ - - int86( 0x1A , ®s , ®s ) ; - - if ( INT1AReturnCode( regs ) != 0 ) - return( 0 ) ; - - /* regs.h.bh bus number */ - /* regs.h.bl device number */ - regs.h.ah = 0xb1 ; /* PCI_FUNCTION_ID */ - regs.h.al = 0x09 ; /* READ_CONFIG_WORD */ - regs.x.cx = deviceid ; - regs.x.dx = 0x1039 ; - regs.x.di = 0x18 ; /* register number */ - int86( 0x1A , ®s , ®s ) ; - - if ( INT1AReturnCode( regs ) != 0 ) - return( 0 ) ; - - return( regs.x.cx ) ; -} - -#endif - - - -#ifdef TC -/* --------------------------------------------------------------------- */ -/* Function : main */ -/* Input : */ -/* Output : */ -/* Description : */ -/* --------------------------------------------------------------------- */ -void main(int argc, char *argv[]) -{ - XGI_HW_DEVICE_INFO HwDeviceExtension ; - USHORT temp ; - USHORT ModeNo ; - - /* HwDeviceExtension.pjVirtualRomBase =(PUCHAR) MK_FP(0xC000,0); */ - /* HwDeviceExtension.pjVideoMemoryAddress = (PUCHAR)MK_FP(0xA000,0); */ - - HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 ,0x6300 ) & 0xFF80 ) + 0x30 ; - HwDeviceExtension.jChipType = XGI_340 ; - /* HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 , 0x5315 ) & 0xFF80 ) + 0x30 ; */ - - HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 , 0x330 ) & 0xFF80 ) + 0x30 ; - HwDeviceExtension.jChipType = XGI_340 ; - - - HwDeviceExtension.ujVBChipID = VB_CHIP_301 ; - StrCpy(HwDeviceExtension.szVBIOSVer , "0.84" ) ; - HwDeviceExtension.bSkipDramSizing = FALSE ; - HwDeviceExtension.ulVideoMemorySize = 0 ; - - if ( argc == 2 ) - { - ModeNo = atoi( argv[ 1 ] ) ; - } - else - { - ModeNo = 0x2e ; - /* ModeNo = 0x37 ; 1024x768x 4bpp */ - /* ModeNo = 0x38 ; 1024x768x 8bpp */ - /* ModeNo = 0x4A ; 1024x768x 16bpp */ - /* ModeNo = 0x47 ; 800x600x 16bpp */ - } - - /* XGIInitNew( &HwDeviceExtension ) ; */ - XGISetModeNew( &HwDeviceExtension , ModeNo ) ; -} -#endif - /* --------------------------------------------------------------------- */ /* Function : XGI_WaitDisplay */ diff --git a/drivers/staging/xgifb/vb_util.c b/drivers/staging/xgifb/vb_util.c index cd8ddb9..4c8ec25 100644 --- a/drivers/staging/xgifb/vb_util.c +++ b/drivers/staging/xgifb/vb_util.c @@ -9,12 +9,6 @@ #include #endif -#ifdef TC -#include -#include -#include -#include -#endif #ifdef LINUX_XF86 @@ -213,9 +207,6 @@ void NewDelaySeconds( int seconds ) for( i = 0 ; i < seconds ; i++ ) { -#ifdef TC - delay( 1000 ) ; -#endif -- 2.7.4