require '_h2ph_pre.ph';

unless(defined(&_PS2ESDI_H_)) {
    eval 'sub _PS2ESDI_H_ () {1;}' unless defined(&_PS2ESDI_H_);
    eval 'sub NRML_ESDI_ID () {0xddff;}' unless defined(&NRML_ESDI_ID);
    eval 'sub INTG_ESDI_ID () {0xdf9f;}' unless defined(&INTG_ESDI_ID);
    eval 'sub PRIMARY_IO_BASE () {0x3510;}' unless defined(&PRIMARY_IO_BASE);
    eval 'sub ALT_IO_BASE () {0x3518;}' unless defined(&ALT_IO_BASE);
    eval 'sub ESDI_CMD_INT () {( &io_base+0);}' unless defined(&ESDI_CMD_INT);
    eval 'sub ESDI_STT_INT () {( &io_base+0);}' unless defined(&ESDI_STT_INT);
    eval 'sub ESDI_CONTROL () {( &io_base+2);}' unless defined(&ESDI_CONTROL);
    eval 'sub ESDI_STATUS () {( &io_base+2);}' unless defined(&ESDI_STATUS);
    eval 'sub ESDI_ATTN () {( &io_base+3);}' unless defined(&ESDI_ATTN);
    eval 'sub ESDI_INTRPT () {( &io_base+3);}' unless defined(&ESDI_INTRPT);
    eval 'sub STATUS_ENABLED () {0x1;}' unless defined(&STATUS_ENABLED);
    eval 'sub STATUS_ALTERNATE () {0x2;}' unless defined(&STATUS_ALTERNATE);
    eval 'sub STATUS_BUSY () {0x10;}' unless defined(&STATUS_BUSY);
    eval 'sub STATUS_STAT_AVAIL () {0x8;}' unless defined(&STATUS_STAT_AVAIL);
    eval 'sub STATUS_INTR () {0x1;}' unless defined(&STATUS_INTR);
    eval 'sub STATUS_RESET_FAIL () {0xea;}' unless defined(&STATUS_RESET_FAIL);
    eval 'sub STATUS_CMD_INF () {0x4;}' unless defined(&STATUS_CMD_INF);
    eval 'sub CTRL_SOFT_RESET () {0xe4;}' unless defined(&CTRL_SOFT_RESET);
    eval 'sub CTRL_HARD_RESET () {0x80;}' unless defined(&CTRL_HARD_RESET);
    eval 'sub CTRL_EOI () {0xe2;}' unless defined(&CTRL_EOI);
    eval 'sub CTRL_ENABLE_DMA () {0x2;}' unless defined(&CTRL_ENABLE_DMA);
    eval 'sub CTRL_ENABLE_INTR () {0x1;}' unless defined(&CTRL_ENABLE_INTR);
    eval 'sub CTRL_DISABLE_INTR () {0x;}' unless defined(&CTRL_DISABLE_INTR);
    eval 'sub ATT_EOI () {0x2;}' unless defined(&ATT_EOI);
    eval 'sub CONFIG_IS () {0x10;}' unless defined(&CONFIG_IS);
    eval 'sub CONFIG_ZD () {0x8;}' unless defined(&CONFIG_ZD);
    eval 'sub CONFIG_SF () {0x4;}' unless defined(&CONFIG_SF);
    eval 'sub CONFIG_FR () {0x2;}' unless defined(&CONFIG_FR);
    eval 'sub CONFIG_RT () {0x1;}' unless defined(&CONFIG_RT);
    eval 'sub PORT_SYS_A () {0x92;}' unless defined(&PORT_SYS_A);
    eval 'sub PORT_DMA_FN () {0x18;}' unless defined(&PORT_DMA_FN);
    eval 'sub PORT_DMA_EX () {0x1a;}' unless defined(&PORT_DMA_EX);
    eval 'sub ON () {0x40;}' unless defined(&ON);
    eval 'sub OFF () {~ &ON;}' unless defined(&OFF);
    eval 'sub LITE_ON () { &outb( &inb( &PORT_SYS_A) |  &ON, &PORT_SYS_A);}' unless defined(&LITE_ON);
    eval 'sub LITE_OFF () { &outb(( &inb( &PORT_SYS_A) &  &OFF), &PORT_SYS_A);}' unless defined(&LITE_OFF);
    eval 'sub FAIL () {0;}' unless defined(&FAIL);
    eval 'sub SUCCES () {1;}' unless defined(&SUCCES);
    eval 'sub INT_CMD_COMPLETE () {0x1;}' unless defined(&INT_CMD_COMPLETE);
    eval 'sub INT_CMD_ECC () {0x3;}' unless defined(&INT_CMD_ECC);
    eval 'sub INT_CMD_RETRY () {0x5;}' unless defined(&INT_CMD_RETRY);
    eval 'sub INT_CMD_FORMAT () {0x6;}' unless defined(&INT_CMD_FORMAT);
    eval 'sub INT_CMD_ECC_RETRY () {0x7;}' unless defined(&INT_CMD_ECC_RETRY);
    eval 'sub INT_CMD_WARNING () {0x8;}' unless defined(&INT_CMD_WARNING);
    eval 'sub INT_CMD_ABORT () {0x9;}' unless defined(&INT_CMD_ABORT);
    eval 'sub INT_RESET () {0xa;}' unless defined(&INT_RESET);
    eval 'sub INT_TRANSFER_REQ () {0xb;}' unless defined(&INT_TRANSFER_REQ);
    eval 'sub INT_CMD_FAILED () {0xc;}' unless defined(&INT_CMD_FAILED);
    eval 'sub INT_DMA_ERR () {0xd;}' unless defined(&INT_DMA_ERR);
    eval 'sub INT_CMD_BLK_ERR () {0xe;}' unless defined(&INT_CMD_BLK_ERR);
    eval 'sub INT_ATTN_ERROR () {0xf;}' unless defined(&INT_ATTN_ERROR);
    eval 'sub DMA_MASK_CHAN () {0x90;}' unless defined(&DMA_MASK_CHAN);
    eval 'sub DMA_UNMASK_CHAN () {0xa0;}' unless defined(&DMA_UNMASK_CHAN);
    eval 'sub DMA_WRITE_ADDR () {0x20;}' unless defined(&DMA_WRITE_ADDR);
    eval 'sub DMA_WRITE_TC () {0x40;}' unless defined(&DMA_WRITE_TC);
    eval 'sub DMA_WRITE_MODE () {0x70;}' unless defined(&DMA_WRITE_MODE);
    eval 'sub CMD_GET_DEV_CONFIG () {0x9;}' unless defined(&CMD_GET_DEV_CONFIG);
    eval 'sub CMD_READ () {0x4601;}' unless defined(&CMD_READ);
    eval 'sub CMD_WRITE () {0x4602;}' unless defined(&CMD_WRITE);
    eval 'sub DMA_READ_16 () {0x4c;}' unless defined(&DMA_READ_16);
    eval 'sub DMA_WRITE_16 () {0x44;}' unless defined(&DMA_WRITE_16);
    eval 'sub MB () {1024*1024;}' unless defined(&MB);
    eval 'sub SECT_SIZE () {512;}' unless defined(&SECT_SIZE);
    eval 'sub ERROR () {1;}' unless defined(&ERROR);
    eval 'sub OK () {0;}' unless defined(&OK);
    eval 'sub HDIO_GETGEO () {0x301;}' unless defined(&HDIO_GETGEO);
    eval 'sub FALSE () {0;}' unless defined(&FALSE);
    eval 'sub TRUE () {! &FALSE;}' unless defined(&TRUE);
}
1;
