require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_IC_CACVAR_H_)) {
    eval 'sub _IC_CACVAR_H_ () {1;}' unless defined(&_IC_CACVAR_H_);
    eval 'sub CAC_MAX_CCBS () {128;}' unless defined(&CAC_MAX_CCBS);
    eval 'sub CAC_MAX_XFER () {(0xffff * 512);}' unless defined(&CAC_MAX_XFER);
    eval 'sub CAC_SG_SIZE () {32;}' unless defined(&CAC_SG_SIZE);
    eval 'sub CAC_SECTOR_SIZE () {512;}' unless defined(&CAC_SECTOR_SIZE);
    eval 'sub cac_inb {
        my($sc, $port) = @_;
	    eval q( &bus_space_read_1(($sc)-> &sc_iot, ($sc)-> &sc_ioh, $port));
    }' unless defined(&cac_inb);
    eval 'sub cac_inw {
        my($sc, $port) = @_;
	    eval q( &bus_space_read_2(($sc)-> &sc_iot, ($sc)-> &sc_ioh, $port));
    }' unless defined(&cac_inw);
    eval 'sub cac_inl {
        my($sc, $port) = @_;
	    eval q( &bus_space_read_4(($sc)-> &sc_iot, ($sc)-> &sc_ioh, $port));
    }' unless defined(&cac_inl);
    eval 'sub cac_outb {
        my($sc, $port, $val) = @_;
	    eval q( &bus_space_write_1(($sc)-> &sc_iot, ($sc)-> &sc_ioh, $port, $val));
    }' unless defined(&cac_outb);
    eval 'sub cac_outw {
        my($sc, $port, $val) = @_;
	    eval q( &bus_space_write_2(($sc)-> &sc_iot, ($sc)-> &sc_ioh, $port, $val));
    }' unless defined(&cac_outw);
    eval 'sub cac_outl {
        my($sc, $port, $val) = @_;
	    eval q( &bus_space_write_4(($sc)-> &sc_iot, ($sc)-> &sc_ioh, $port, $val));
    }' unless defined(&cac_outl);
    eval 'sub CAC_GET1 {
        my($x) = @_;
	    eval q(((($x))[0]));
    }' unless defined(&CAC_GET1);
    eval 'sub CAC_GET2 {
        my($x) = @_;
	    eval q(((($x))[0] | ((($x))[1] << 8)));
    }' unless defined(&CAC_GET2);
    eval 'sub CAC_GET4 {
        my($x) = @_;
	    eval q((((($x))[0] | ((($x))[1] << 8)) | ((($x))[0] << 16| ((($x))[1] << 24))));
    }' unless defined(&CAC_GET4);
    eval 'sub CAC_CCB_DATA_IN () {0x1;}' unless defined(&CAC_CCB_DATA_IN);
    eval 'sub CAC_CCB_DATA_OUT () {0x2;}' unless defined(&CAC_CCB_DATA_OUT);
    eval 'sub CAC_CCB_ACTIVE () {0x4;}' unless defined(&CAC_CCB_ACTIVE);
}
1;
