require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SIS_DRV_H_)) {
    eval 'sub _SIS_DRV_H_ () {1;}' unless defined(&_SIS_DRV_H_);
    eval 'sub DRIVER_AUTHOR () {"SIS, Tungsten Graphics";}' unless defined(&DRIVER_AUTHOR);
    eval 'sub DRIVER_NAME () {"sis";}' unless defined(&DRIVER_NAME);
    eval 'sub DRIVER_DESC () {"SIS 300/630/540 and XGI V3XE/V5/V8";}' unless defined(&DRIVER_DESC);
    eval 'sub DRIVER_DATE () {"20070626";}' unless defined(&DRIVER_DATE);
    eval 'sub DRIVER_MAJOR () {1;}' unless defined(&DRIVER_MAJOR);
    eval 'sub DRIVER_MINOR () {3;}' unless defined(&DRIVER_MINOR);
    eval 'sub DRIVER_PATCHLEVEL () {0;}' unless defined(&DRIVER_PATCHLEVEL);
    eval("sub SIS_OTHER () { 0; }") unless defined(&SIS_OTHER);
    eval("sub SIS_CHIP_315 () { 1; }") unless defined(&SIS_CHIP_315);
    if(defined( &__linux__)) {
	eval 'sub SIS_HAVE_CORE_MM () {1;}' unless defined(&SIS_HAVE_CORE_MM);
    }
    if(defined(&SIS_HAVE_CORE_MM)) {
	require 'drm_sman.ph';
	eval 'sub SIS_BASE () {( ($dev_priv->{mmio}));}' unless defined(&SIS_BASE);
	eval 'sub SIS_READ {
	    my($reg) = @_;
    	    eval q( &DRM_READ32( &SIS_BASE, $reg););
	}' unless defined(&SIS_READ);
	eval 'sub SIS_WRITE {
	    my($reg, $val) = @_;
    	    eval q( &DRM_WRITE32( &SIS_BASE, $reg, $val););
	}' unless defined(&SIS_WRITE);
    } else {
	require 'sis_ds.ph';
    }
}
1;
