require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&__DEV_ACPI_DSDT_H__)) {
    eval 'sub __DEV_ACPI_DSDT_H__ () {1;}' unless defined(&__DEV_ACPI_DSDT_H__);
    eval 'sub SR_IRQ () {0x4;}' unless defined(&SR_IRQ);
    eval 'sub SR_DMA () {0x5;}' unless defined(&SR_DMA);
    eval 'sub SR_STARTDEP () {0x6;}' unless defined(&SR_STARTDEP);
    eval 'sub SR_ENDDEP () {0x7;}' unless defined(&SR_ENDDEP);
    eval 'sub SR_IOPORT () {0x8;}' unless defined(&SR_IOPORT);
    eval 'sub SR_FIXEDPORT () {0x9;}' unless defined(&SR_FIXEDPORT);
    eval 'sub SR_ENDTAG () {0xf;}' unless defined(&SR_ENDTAG);
    eval 'sub LR_24BIT () {0x81;}' unless defined(&LR_24BIT);
    eval 'sub LR_GENREGISTER () {0x82;}' unless defined(&LR_GENREGISTER);
    eval 'sub LR_32BIT () {0x85;}' unless defined(&LR_32BIT);
    eval 'sub LR_32BITFIXED () {0x86;}' unless defined(&LR_32BITFIXED);
    eval 'sub LR_DWORD () {0x87;}' unless defined(&LR_DWORD);
    eval 'sub LR_WORD () {0x88;}' unless defined(&LR_WORD);
    eval 'sub LR_EXTIRQ () {0x89;}' unless defined(&LR_EXTIRQ);
    eval 'sub LR_QWORD () {0x8a;}' unless defined(&LR_QWORD);
    eval 'sub __amlflagbit {
        my($v,$s,$l) = @_;
	    eval q();
    }' unless defined(&__amlflagbit);
    eval 'sub AML_CRSTYPE {
        my($x) = @_;
	    eval q((($x)-> ($hdr->{typecode}) & 0x80 ? ($x)-> ($hdr->{typecode}) : ($x)-> ($hdr->{typecode}) >> 3));
    }' unless defined(&AML_CRSTYPE);
    eval 'sub AML_CRSLEN {
        my($x) = @_;
	    eval q((($x)-> ($hdr->{typecode}) & 0x80 ? 3+($x)-> ($hdr->{length}) : 1+(($x)-> ($hdr->{typecode}) & 0x7)));
    }' unless defined(&AML_CRSLEN);
    eval 'sub ACPI_E_NOERROR () {0x;}' unless defined(&ACPI_E_NOERROR);
    eval 'sub ACPI_E_BADVALUE () {0x1;}' unless defined(&ACPI_E_BADVALUE);
    eval 'sub AML_MAX_ARG () {7;}' unless defined(&AML_MAX_ARG);
    eval 'sub AML_MAX_LOCAL () {8;}' unless defined(&AML_MAX_LOCAL);
    eval 'sub aml_letohost16 {
        my($x) = @_;
	    eval q( &letoh16($x));
    }' unless defined(&aml_letohost16);
    eval 'sub aml_letohost32 {
        my($x) = @_;
	    eval q( &letoh32($x));
    }' unless defined(&aml_letohost32);
    eval 'sub aml_letohost64 {
        my($x) = @_;
	    eval q( &letoh64($x));
    }' unless defined(&aml_letohost64);
    eval 'sub AML_WALK_PRE () {0x;}' unless defined(&AML_WALK_PRE);
    eval 'sub AML_WALK_POST () {0x1;}' unless defined(&AML_WALK_POST);
}
1;
