require '_h2ph_pre.ph';

unless(defined(&_MAC68K_SCSI5380_H_)) {
    eval 'sub _MAC68K_SCSI5380_H_ () {1;}' unless defined(&_MAC68K_SCSI5380_H_);
    eval 'sub sci_odata () { &sci_data;}' unless defined(&sci_odata);
    eval 'sub sci_sel_enb () { &sci_bus_csr;}' unless defined(&sci_sel_enb);
    eval 'sub sci_dma_send () { &sci_csr;}' unless defined(&sci_dma_send);
    eval 'sub sci_trecv () { &sci_idata;}' unless defined(&sci_trecv);
    eval 'sub sci_irecv () { &sci_iack;}' unless defined(&sci_irecv);
    eval 'sub SCI_ICMD_DATA () {0x01;}' unless defined(&SCI_ICMD_DATA);
    eval 'sub SCI_ICMD_ATN () {0x02;}' unless defined(&SCI_ICMD_ATN);
    eval 'sub SCI_ICMD_SEL () {0x04;}' unless defined(&SCI_ICMD_SEL);
    eval 'sub SCI_ICMD_BSY () {0x08;}' unless defined(&SCI_ICMD_BSY);
    eval 'sub SCI_ICMD_ACK () {0x10;}' unless defined(&SCI_ICMD_ACK);
    eval 'sub SCI_ICMD_LST () {0x20;}' unless defined(&SCI_ICMD_LST);
    eval 'sub SCI_ICMD_DIFF () { &SCI_ICMD_LST;}' unless defined(&SCI_ICMD_DIFF);
    eval 'sub SCI_ICMD_AIP () {0x40;}' unless defined(&SCI_ICMD_AIP);
    eval 'sub SCI_ICMD_TEST () { &SCI_ICMD_AIP;}' unless defined(&SCI_ICMD_TEST);
    eval 'sub SCI_ICMD_RST () {0x80;}' unless defined(&SCI_ICMD_RST);
    eval 'sub SCI_MODE_ARB () {0x01;}' unless defined(&SCI_MODE_ARB);
    eval 'sub SCI_MODE_DMA () {0x02;}' unless defined(&SCI_MODE_DMA);
    eval 'sub SCI_MODE_MONBSY () {0x04;}' unless defined(&SCI_MODE_MONBSY);
    eval 'sub SCI_MODE_DMA_IE () {0x08;}' unless defined(&SCI_MODE_DMA_IE);
    eval 'sub SCI_MODE_PERR_IE () {0x10;}' unless defined(&SCI_MODE_PERR_IE);
    eval 'sub SCI_MODE_PAR_CHK () {0x20;}' unless defined(&SCI_MODE_PAR_CHK);
    eval 'sub SCI_MODE_TARGET () {0x40;}' unless defined(&SCI_MODE_TARGET);
    eval 'sub SCI_MODE_BLOCKDMA () {0x80;}' unless defined(&SCI_MODE_BLOCKDMA);
    eval 'sub SCI_TCMD_IO () {0x01;}' unless defined(&SCI_TCMD_IO);
    eval 'sub SCI_TCMD_CD () {0x02;}' unless defined(&SCI_TCMD_CD);
    eval 'sub SCI_TCMD_MSG () {0x04;}' unless defined(&SCI_TCMD_MSG);
    eval 'sub SCI_TCMD_PHASE_MASK () {0x07;}' unless defined(&SCI_TCMD_PHASE_MASK);
    eval 'sub SCI_TCMD_REQ () {0x08;}' unless defined(&SCI_TCMD_REQ);
    eval 'sub SCI_TCMD_LAST_SENT () {0x80;}' unless defined(&SCI_TCMD_LAST_SENT);
    eval 'sub SCI_PHASE {
        local($x) = @_;
	    eval q( &SCSI_PHASE($x));
    }' unless defined(&SCI_PHASE);
    eval 'sub SCI_BUS_DBP () {0x01;}' unless defined(&SCI_BUS_DBP);
    eval 'sub SCI_BUS_SEL () {0x02;}' unless defined(&SCI_BUS_SEL);
    eval 'sub SCI_BUS_IO () {0x04;}' unless defined(&SCI_BUS_IO);
    eval 'sub SCI_BUS_CD () {0x08;}' unless defined(&SCI_BUS_CD);
    eval 'sub SCI_BUS_MSG () {0x10;}' unless defined(&SCI_BUS_MSG);
    eval 'sub SCI_BUS_REQ () {0x20;}' unless defined(&SCI_BUS_REQ);
    eval 'sub SCI_BUS_BSY () {0x40;}' unless defined(&SCI_BUS_BSY);
    eval 'sub SCI_BUS_RST () {0x80;}' unless defined(&SCI_BUS_RST);
    eval 'sub SCI_CUR_PHASE {
        local($x) = @_;
	    eval q( &SCSI_PHASE(($x)>>2));
    }' unless defined(&SCI_CUR_PHASE);
    eval 'sub SCI_CSR_ACK () {0x01;}' unless defined(&SCI_CSR_ACK);
    eval 'sub SCI_CSR_ATN () {0x02;}' unless defined(&SCI_CSR_ATN);
    eval 'sub SCI_CSR_DISC () {0x04;}' unless defined(&SCI_CSR_DISC);
    eval 'sub SCI_CSR_PHASE_MATCH () {0x08;}' unless defined(&SCI_CSR_PHASE_MATCH);
    eval 'sub SCI_CSR_INT () {0x10;}' unless defined(&SCI_CSR_INT);
    eval 'sub SCI_CSR_PERR () {0x20;}' unless defined(&SCI_CSR_PERR);
    eval 'sub SCI_CSR_DREQ () {0x40;}' unless defined(&SCI_CSR_DREQ);
    eval 'sub SCI_CSR_DONE () {0x80;}' unless defined(&SCI_CSR_DONE);
}
1;
