require '_h2ph_pre.ph';

unless(defined(&_LINUX_SERIALP_H)) {
    eval 'sub _LINUX_SERIALP_H () {1;}' unless defined(&_LINUX_SERIALP_H);
    require 'linux/config.ph';
    require 'linux/termios.ph';
    require 'linux/tqueue.ph';
    require 'linux/circ_buf.ph';
    require 'linux/wait.ph';
    if(((defined(&LINUX_VERSION_CODE) ? &LINUX_VERSION_CODE : 0) < 0x20300)) {
	require 'linux/serial.ph';
    }
    if(defined(&DECLARE_WAITQUEUE)) {
    } else {
    }
    eval 'sub CONFIGURED_SERIAL_PORT {
        local($info) = @_;
	    eval q((($info)-> &port || (($info)-> &iomem_base)));
    }' unless defined(&CONFIGURED_SERIAL_PORT);
    eval 'sub SERIAL_MAGIC () {0x5301;}' unless defined(&SERIAL_MAGIC);
    eval 'sub SSTATE_MAGIC () {0x5302;}' unless defined(&SSTATE_MAGIC);
    eval 'sub RS_EVENT_WRITE_WAKEUP () {0;}' unless defined(&RS_EVENT_WRITE_WAKEUP);
    if(defined( &__alpha__)  && !defined( &CONFIG_PCI)) {
	eval 'sub ALPHA_KLUDGE_MCR () {( &UART_MCR_OUT2 |  &UART_MCR_OUT1);}' unless defined(&ALPHA_KLUDGE_MCR);
    } else {
	eval 'sub ALPHA_KLUDGE_MCR () {0;}' unless defined(&ALPHA_KLUDGE_MCR);
    }
    unless(defined(&PCI_ANY_ID)) {
	eval 'sub PCI_ANY_ID () {(~0);}' unless defined(&PCI_ANY_ID);
    }
    eval 'sub SPCI_FL_BASE_MASK () {0x7;}' unless defined(&SPCI_FL_BASE_MASK);
    eval 'sub SPCI_FL_BASE0 () {0x;}' unless defined(&SPCI_FL_BASE0);
    eval 'sub SPCI_FL_BASE1 () {0x1;}' unless defined(&SPCI_FL_BASE1);
    eval 'sub SPCI_FL_BASE2 () {0x2;}' unless defined(&SPCI_FL_BASE2);
    eval 'sub SPCI_FL_BASE3 () {0x3;}' unless defined(&SPCI_FL_BASE3);
    eval 'sub SPCI_FL_BASE4 () {0x4;}' unless defined(&SPCI_FL_BASE4);
    eval 'sub SPCI_FL_GET_BASE {
        local($x) = @_;
	    eval q(($x &  &SPCI_FL_BASE_MASK));
    }' unless defined(&SPCI_FL_GET_BASE);
    eval 'sub SPCI_FL_IRQ_MASK () {(0x7 << 4);}' unless defined(&SPCI_FL_IRQ_MASK);
    eval 'sub SPCI_FL_IRQBASE0 () {(0x << 4);}' unless defined(&SPCI_FL_IRQBASE0);
    eval 'sub SPCI_FL_IRQBASE1 () {(0x1 << 4);}' unless defined(&SPCI_FL_IRQBASE1);
    eval 'sub SPCI_FL_IRQBASE2 () {(0x2 << 4);}' unless defined(&SPCI_FL_IRQBASE2);
    eval 'sub SPCI_FL_IRQBASE3 () {(0x3 << 4);}' unless defined(&SPCI_FL_IRQBASE3);
    eval 'sub SPCI_FL_IRQBASE4 () {(0x4 << 4);}' unless defined(&SPCI_FL_IRQBASE4);
    eval 'sub SPCI_FL_GET_IRQBASE {
        local($x) = @_;
	    eval q((($x &  &SPCI_FL_IRQ_MASK) >> 4));
    }' unless defined(&SPCI_FL_GET_IRQBASE);
    eval 'sub SPCI_FL_BASE_TABLE () {0x100;}' unless defined(&SPCI_FL_BASE_TABLE);
    eval 'sub SPCI_FL_IRQ_TABLE () {0x200;}' unless defined(&SPCI_FL_IRQ_TABLE);
    eval 'sub SPCI_FL_IRQRESOURCE () {0x400;}' unless defined(&SPCI_FL_IRQRESOURCE);
    eval 'sub SPCI_FL_REGION_SZ_CAP () {0x800;}' unless defined(&SPCI_FL_REGION_SZ_CAP);
    eval 'sub SPCI_FL_NO_SHIRQ () {0x1000;}' unless defined(&SPCI_FL_NO_SHIRQ);
    eval 'sub SPCI_FL_ISPNP () {0x2000;}' unless defined(&SPCI_FL_ISPNP);
    eval 'sub SPCI_FL_PNPDEFAULT () {( &SPCI_FL_IRQRESOURCE| &SPCI_FL_ISPNP);}' unless defined(&SPCI_FL_PNPDEFAULT);
}
1;
