require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MACHINE_AUTOCONF_H_)) {
    eval 'sub _MACHINE_AUTOCONF_H_ () {1;}' unless defined(&_MACHINE_AUTOCONF_H_);
    eval 'sub RA_MAXVADDR () {8;}' unless defined(&RA_MAXVADDR);
    eval 'sub RA_MAXREG () {16;}' unless defined(&RA_MAXREG);
    eval 'sub RA_MAXINTR () {8;}' unless defined(&RA_MAXINTR);
    eval 'sub ra_vaddr () { $ra_vaddrs[0];}' unless defined(&ra_vaddr);
    eval 'sub ra_iospace () { ($ra_reg[0]->{rr_iospace});}' unless defined(&ra_iospace);
    eval 'sub ra_paddr () { ($ra_reg[0]->{rr_paddr});}' unless defined(&ra_paddr);
    eval 'sub ra_len () { ($ra_reg[0]->{rr_len});}' unless defined(&ra_len);
    eval 'sub BUS_MAIN () {0;}' unless defined(&BUS_MAIN);
    eval 'sub BUS_OBIO () {1;}' unless defined(&BUS_OBIO);
    eval 'sub BUS_VME16 () {2;}' unless defined(&BUS_VME16);
    eval 'sub BUS_VME32 () {3;}' unless defined(&BUS_VME32);
    eval 'sub BUS_SBUS () {4;}' unless defined(&BUS_SBUS);
    eval 'sub BUS_XBOX () {5;}' unless defined(&BUS_XBOX);
    eval 'sub BUS_FGA () {6;}' unless defined(&BUS_FGA);
    eval 'sub BUS_FGA_A16D8 () {7;}' unless defined(&BUS_FGA_A16D8);
    eval 'sub BUS_FGA_A16D16 () {8;}' unless defined(&BUS_FGA_A16D16);
    eval 'sub BUS_FGA_A16D32 () {9;}' unless defined(&BUS_FGA_A16D32);
    eval 'sub BUS_FGA_A24D8 () {10;}' unless defined(&BUS_FGA_A24D8);
    eval 'sub BUS_FGA_A24D16 () {11;}' unless defined(&BUS_FGA_A24D16);
    eval 'sub BUS_FGA_A24D32 () {12;}' unless defined(&BUS_FGA_A24D32);
    eval 'sub BUS_FGA_A32D8 () {13;}' unless defined(&BUS_FGA_A32D8);
    eval 'sub BUS_FGA_A32D16 () {14;}' unless defined(&BUS_FGA_A32D16);
    eval 'sub BUS_FGA_A32D32 () {15;}' unless defined(&BUS_FGA_A32D32);
    eval 'sub mapiodev {
        my($pa, $offset, $size) = @_;
	    eval q( &mapdev($pa, 0, $offset, $size));
    }' unless defined(&mapiodev);
    eval 'sub REG2PHYS {
        my($rr, $offset) = @_;
	    eval q(((($rr)-> &rr_paddr + ($offset)) |  &PMAP_IOENC(($rr)-> &rr_iospace) ));
    }' unless defined(&REG2PHYS);
}
1;
