require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_DEV_ISA_ISADMAVAR_H)) {
    eval 'sub _DEV_ISA_ISADMAVAR_H () {1;}' unless defined(&_DEV_ISA_ISADMAVAR_H);
    unless(defined(&__ISADMA_COMPAT)) {
	eval 'sub __ISADMA_COMPAT () {1;}' unless defined(&__ISADMA_COMPAT);
    }
    if(defined(&__ISADMA_COMPAT)) {
	eval 'sub isadma_acquire {
	    my($c) = @_;
    	    eval q( &isa_dma_acquire( &isa_dev, ($c)));
	}' unless defined(&isadma_acquire);
	eval 'sub isadma_release {
	    my($c) = @_;
    	    eval q( &isa_dma_release( &isa_dev, ($c)));
	}' unless defined(&isadma_release);
	eval 'sub isadma_cascade {
	    my($c) = @_;
    	    eval q( &isa_dmacascade( &isa_dev, ($c)));
	}' unless defined(&isadma_cascade);
	eval 'sub isadma_start {
	    my($a, $s, $c, $f) = @_;
    	    eval q( &isa_dmastart( &isa_dev, ($c), ($a), ($s), 0, ($f),  &BUS_DMA_WAITOK| &BUS_DMA_BUS1));
	}' unless defined(&isadma_start);
	eval 'sub isadma_abort {
	    my($c) = @_;
    	    eval q( &isa_dmaabort( &isa_dev, ($c)));
	}' unless defined(&isadma_abort);
	eval 'sub isadma_finished {
	    my($c) = @_;
    	    eval q( &isa_dmafinished( &isa_dev, ($c)));
	}' unless defined(&isadma_finished);
	eval 'sub isadma_done {
	    my($c) = @_;
    	    eval q( &isa_dmadone( &isa_dev, ($c)));
	}' unless defined(&isadma_done);
    }
    eval 'sub MAX_ISADMA () {65536;}' unless defined(&MAX_ISADMA);
    eval 'sub DMAMODE_WRITE () {0;}' unless defined(&DMAMODE_WRITE);
    eval 'sub DMAMODE_READ () {1;}' unless defined(&DMAMODE_READ);
    eval 'sub DMAMODE_LOOP () {2;}' unless defined(&DMAMODE_LOOP);
}
1;
