require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SBUS_VAR_H)) {
    eval 'sub _SBUS_VAR_H () {1;}' unless defined(&_SBUS_VAR_H);
    eval 'sub sa_slot () { ($sa_reg[0]->{sbr_slot});}' unless defined(&sa_slot);
    eval 'sub sa_offset () { ($sa_reg[0]->{sbr_offset});}' unless defined(&sa_offset);
    eval 'sub sa_size () { ($sa_reg[0]->{sbr_size});}' unless defined(&sa_size);
    eval 'sub sa_pri () { ($sa_intr[0]->{sbi_pri});}' unless defined(&sa_pri);
    eval 'sub sa_promvaddr () { $sa_promvaddrs[0];}' unless defined(&sa_promvaddr);
    eval 'sub sbus_bus_map {
        my($t, $slot, $offset, $sz, $flags, $unused, $hp) = @_;
	    eval q( &bus_space_map($t,  &BUS_ADDR($slot, $offset), $sz, $flags, $hp));
    }' unless defined(&sbus_bus_map);
    if((defined(&notyet) ? &notyet : 0)) {
    }
    eval 'sub SBUS_BURST_1 () {0x1;}' unless defined(&SBUS_BURST_1);
    eval 'sub SBUS_BURST_2 () {0x2;}' unless defined(&SBUS_BURST_2);
    eval 'sub SBUS_BURST_4 () {0x4;}' unless defined(&SBUS_BURST_4);
    eval 'sub SBUS_BURST_8 () {0x8;}' unless defined(&SBUS_BURST_8);
    eval 'sub SBUS_BURST_16 () {0x10;}' unless defined(&SBUS_BURST_16);
    eval 'sub SBUS_BURST_32 () {0x20;}' unless defined(&SBUS_BURST_32);
    eval 'sub SBUS_BURST_64 () {0x40;}' unless defined(&SBUS_BURST_64);
    if(defined( &__sparc__)  && !defined( &__sparc64__)) {
	require 'sparc/dev/sbusvar.ph';
	eval 'sub INTLEV {
	    my($x) = @_;
    	    eval q(($x));
	}' unless defined(&INTLEV);
    }
 elsif(defined( &__sparc64__)) {
	require 'sparc64/dev/sbusvar.ph';
	require 'sparc64/dev/iommureg.ph';
    }
}
1;
