require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MACHINE_BUS_H_)) {
    eval 'sub _MACHINE_BUS_H_ () {1;}' unless defined(&_MACHINE_BUS_H_);
    eval 'sub __abs_c {
        my($a,$b) = @_;
	    eval q( &__CONCAT($a,$b));
    }' unless defined(&__abs_c);
    eval 'sub __abs_opname {
        my($op,$size) = @_;
	    eval q( &__abs_c( &__abs_c( &__abs_c( &abs_,$op), &_),$size));
    }' unless defined(&__abs_opname);
    eval 'sub __abs_rs {
        my($sz, $t, $h, $o) = @_;
	    eval q((*($t)-> &__abs_opname( &r,$sz))(($t)-> &abs_cookie, $h, $o));
    }' unless defined(&__abs_rs);
    eval 'sub __abs_ws {
        my($sz, $t, $h, $o, $v) = @_;
	    eval q((*($t)-> &__abs_opname( &w,$sz))(($t)-> &abs_cookie, $h, $o, $v));
    }' unless defined(&__abs_ws);
    eval 'sub __abs_nonsingle {
        my($type, $sz, $t, $h, $o, $a, $c) = @_;
	    eval q((*($t)-> &__abs_opname($type,$sz))(($t)-> &abs_cookie, $h, $o, $a, $c));
    }' unless defined(&__abs_nonsingle);
    unless(defined(&DEBUG)) {
	eval 'sub __abs_aligned_nonsingle {
	    my($type, $sz, $t, $h, $o, $a, $c) = @_;
    	    eval q( &__abs_nonsingle($type, $sz, ($t), ($h), ($o), ($a), ($c)));
	}' unless defined(&__abs_aligned_nonsingle);
    } else {
	eval 'sub __abs_aligned_nonsingle {
	    my($type, $sz, $t, $h, $o, $a, $c) = @_;
    	    eval q( &do {  &if (($a & ($sz - 1)) != 0)  &panic(\\"bus non-single %d-byte unaligned (to %p) at %s:%d\\", $sz, $a,  &__FILE__,  &__LINE__); (*($t)-> &__abs_opname($type,$sz))(($t)-> &abs_cookie, $h, $o, $a, $c); }  &while (0));
	}' unless defined(&__abs_aligned_nonsingle);
    }
    eval 'sub __abs_set {
        my($type, $sz, $t, $h, $o, $v, $c) = @_;
	    eval q((*($t)-> &__abs_opname($type,$sz))(($t)-> &abs_cookie, $h, $o, $v, $c));
    }' unless defined(&__abs_set);
    eval 'sub __abs_copy {
        my($sz, $t, $h1, $o1, $h2, $o2, $cnt) = @_;
	    eval q((*($t)-> &__abs_opname( &c,$sz))(($t)-> &abs_cookie, $h1, $o1, $h2, $o2, $cnt));
    }' unless defined(&__abs_copy);
    eval 'sub bus_space_map {
        my($t, $a, $s, $c, $hp) = @_;
	    eval q((*($t)-> &abs_map)(($t)-> &abs_cookie, ($a), ($s), ($c), ($hp)));
    }' unless defined(&bus_space_map);
    eval 'sub alpha_bus_space_map_noacct () { &bus_space_map;}' unless defined(&alpha_bus_space_map_noacct);
    eval 'sub bus_space_unmap {
        my($t, $h, $s) = @_;
	    eval q((*($t)-> &abs_unmap)(($t)-> &abs_cookie, ($h), ($s)));
    }' unless defined(&bus_space_unmap);
    eval 'sub alpha_bus_space_unmap_noacct () { &bus_space_unmap;}' unless defined(&alpha_bus_space_unmap_noacct);
    eval 'sub bus_space_subregion {
        my($t, $h, $o, $s, $hp) = @_;
	    eval q((*($t)-> &abs_subregion)(($t)-> &abs_cookie, ($h), ($o), ($s), ($hp)));
    }' unless defined(&bus_space_subregion);
    eval 'sub BUS_SPACE_MAP_CACHEABLE () {0x1;}' unless defined(&BUS_SPACE_MAP_CACHEABLE);
    eval 'sub BUS_SPACE_MAP_LINEAR () {0x2;}' unless defined(&BUS_SPACE_MAP_LINEAR);
    eval 'sub BUS_SPACE_MAP_PREFETCHABLE () {0x4;}' unless defined(&BUS_SPACE_MAP_PREFETCHABLE);
    eval 'sub bus_space_alloc {
        my($t, $rs, $re, $s, $a, $b, $c, $ap, $hp) = @_;
	    eval q((*($t)-> &abs_alloc)(($t)-> &abs_cookie, ($rs), ($re), ($s), ($a), ($b), ($c), ($ap), ($hp)));
    }' unless defined(&bus_space_alloc);
    eval 'sub bus_space_free {
        my($t, $h, $s) = @_;
	    eval q((*($t)-> &abs_free)(($t)-> &abs_cookie, ($h), ($s)));
    }' unless defined(&bus_space_free);
    eval 'sub bus_space_vaddr {
        my($t, $h) = @_;
	    eval q((*($t)-> &abs_vaddr)(($t)-> &abs_cookie, ($h)));
    }' unless defined(&bus_space_vaddr);
    eval 'sub bus_space_barrier {
        my($t, $h, $o, $l, $f) = @_;
	    eval q((*($t)-> &abs_barrier)(($t)-> &abs_cookie, ($h), ($o), ($l), ($f)));
    }' unless defined(&bus_space_barrier);
    eval 'sub BUS_SPACE_BARRIER_READ () {0x1;}' unless defined(&BUS_SPACE_BARRIER_READ);
    eval 'sub BUS_SPACE_BARRIER_WRITE () {0x2;}' unless defined(&BUS_SPACE_BARRIER_WRITE);
    eval 'sub bus_space_read_1 {
        my($t, $h, $o) = @_;
	    eval q( &__abs_rs(1,($t),($h),($o)));
    }' unless defined(&bus_space_read_1);
    eval 'sub bus_space_read_2 {
        my($t, $h, $o) = @_;
	    eval q( &__abs_rs(2,($t),($h),($o)));
    }' unless defined(&bus_space_read_2);
    eval 'sub bus_space_read_4 {
        my($t, $h, $o) = @_;
	    eval q( &__abs_rs(4,($t),($h),($o)));
    }' unless defined(&bus_space_read_4);
    eval 'sub bus_space_read_8 {
        my($t, $h, $o) = @_;
	    eval q( &__abs_rs(8,($t),($h),($o)));
    }' unless defined(&bus_space_read_8);
    eval 'sub bus_space_read_multi_1 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &rm,1,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_multi_1);
    eval 'sub bus_space_read_multi_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &rm,2,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_multi_2);
    eval 'sub bus_space_read_multi_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &rm,4,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_multi_4);
    eval 'sub bus_space_read_multi_8 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &rm,8,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_multi_8);
    eval 'sub bus_space_read_raw_multi_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &rrm,2,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_raw_multi_2);
    eval 'sub bus_space_read_raw_multi_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &rrm,4,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_raw_multi_4);
    eval 'sub bus_space_read_raw_multi_8 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &rrm,8,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_raw_multi_8);
    eval 'sub bus_space_read_region_1 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &rr,1,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_region_1);
    eval 'sub bus_space_read_region_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &rr,2,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_region_2);
    eval 'sub bus_space_read_region_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &rr,4,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_region_4);
    eval 'sub bus_space_read_region_8 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &rr,8,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_read_region_8);
    eval 'sub bus_space_read_raw_region_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &bus_space_read_region_2(($t), ($h), ($o), ( &u_int16_t *)($a), ($c) >> 1));
    }' unless defined(&bus_space_read_raw_region_2);
    eval 'sub bus_space_read_raw_region_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &bus_space_read_region_4(($t), ($h), ($o), ( &u_int32_t *)($a), ($c) >> 2));
    }' unless defined(&bus_space_read_raw_region_4);
    eval 'sub bus_space_write_1 {
        my($t, $h, $o, $v) = @_;
	    eval q( &__abs_ws(1,($t),($h),($o),($v)));
    }' unless defined(&bus_space_write_1);
    eval 'sub bus_space_write_2 {
        my($t, $h, $o, $v) = @_;
	    eval q( &__abs_ws(2,($t),($h),($o),($v)));
    }' unless defined(&bus_space_write_2);
    eval 'sub bus_space_write_4 {
        my($t, $h, $o, $v) = @_;
	    eval q( &__abs_ws(4,($t),($h),($o),($v)));
    }' unless defined(&bus_space_write_4);
    eval 'sub bus_space_write_8 {
        my($t, $h, $o, $v) = @_;
	    eval q( &__abs_ws(8,($t),($h),($o),($v)));
    }' unless defined(&bus_space_write_8);
    eval 'sub bus_space_write_multi_1 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &wm,1,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_multi_1);
    eval 'sub bus_space_write_multi_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &wm,2,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_multi_2);
    eval 'sub bus_space_write_multi_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &wm,4,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_multi_4);
    eval 'sub bus_space_write_multi_8 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &wm,8,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_multi_8);
    eval 'sub bus_space_write_raw_multi_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &wrm,2,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_raw_multi_2);
    eval 'sub bus_space_write_raw_multi_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &wrm,4,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_raw_multi_4);
    eval 'sub bus_space_write_raw_multi_8 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &wrm,8,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_raw_multi_8);
    eval 'sub bus_space_write_region_1 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_nonsingle( &wr,1,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_region_1);
    eval 'sub bus_space_write_region_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &wr,2,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_region_2);
    eval 'sub bus_space_write_region_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &wr,4,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_region_4);
    eval 'sub bus_space_write_region_8 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &__abs_aligned_nonsingle( &wr,8,($t),($h),($o),($a),($c)));
    }' unless defined(&bus_space_write_region_8);
    eval 'sub bus_space_write_raw_region_2 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &bus_space_write_region_2(($t), ($h), ($o), ( &const  &u_int16_t *)($a), ($c) >> 1));
    }' unless defined(&bus_space_write_raw_region_2);
    eval 'sub bus_space_write_raw_region_4 {
        my($t, $h, $o, $a, $c) = @_;
	    eval q( &bus_space_write_region_4(($t), ($h), ($o), ( &const  &u_int32_t *)($a), ($c) >> 2));
    }' unless defined(&bus_space_write_raw_region_4);
    eval 'sub bus_space_set_multi_1 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sm,1,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_multi_1);
    eval 'sub bus_space_set_multi_2 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sm,2,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_multi_2);
    eval 'sub bus_space_set_multi_4 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sm,4,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_multi_4);
    eval 'sub bus_space_set_multi_8 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sm,8,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_multi_8);
    eval 'sub bus_space_set_region_1 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sr,1,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_region_1);
    eval 'sub bus_space_set_region_2 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sr,2,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_region_2);
    eval 'sub bus_space_set_region_4 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sr,4,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_region_4);
    eval 'sub bus_space_set_region_8 {
        my($t, $h, $o, $v, $c) = @_;
	    eval q( &__abs_set( &sr,8,($t),($h),($o),($v),($c)));
    }' unless defined(&bus_space_set_region_8);
    eval 'sub bus_space_copy_1 {
        my($t, $h1, $o1, $h2, $o2, $c) = @_;
	    eval q( &__abs_copy(1, $t, $h1, $o1, $h2, $o2, $c));
    }' unless defined(&bus_space_copy_1);
    eval 'sub bus_space_copy_2 {
        my($t, $h1, $o1, $h2, $o2, $c) = @_;
	    eval q( &__abs_copy(2, $t, $h1, $o1, $h2, $o2, $c));
    }' unless defined(&bus_space_copy_2);
    eval 'sub bus_space_copy_4 {
        my($t, $h1, $o1, $h2, $o2, $c) = @_;
	    eval q( &__abs_copy(4, $t, $h1, $o1, $h2, $o2, $c));
    }' unless defined(&bus_space_copy_4);
    eval 'sub bus_space_copy_8 {
        my($t, $h1, $o1, $h2, $o2, $c) = @_;
	    eval q( &__abs_copy(8, $t, $h1, $o1, $h2, $o2, $c));
    }' unless defined(&bus_space_copy_8);
    eval 'sub BUS_DMA_WAITOK () {0x;}' unless defined(&BUS_DMA_WAITOK);
    eval 'sub BUS_DMA_NOWAIT () {0x1;}' unless defined(&BUS_DMA_NOWAIT);
    eval 'sub BUS_DMA_ALLOCNOW () {0x2;}' unless defined(&BUS_DMA_ALLOCNOW);
    eval 'sub BUS_DMA_COHERENT () {0x4;}' unless defined(&BUS_DMA_COHERENT);
    eval 'sub BUS_DMA_BUS1 () {0x10;}' unless defined(&BUS_DMA_BUS1);
    eval 'sub BUS_DMA_BUS2 () {0x20;}' unless defined(&BUS_DMA_BUS2);
    eval 'sub BUS_DMA_BUS3 () {0x40;}' unless defined(&BUS_DMA_BUS3);
    eval 'sub BUS_DMA_24BIT () {0x80;}' unless defined(&BUS_DMA_24BIT);
    eval 'sub BUS_DMA_STREAMING () {0x100;}' unless defined(&BUS_DMA_STREAMING);
    eval 'sub BUS_DMA_READ () {0x200;}' unless defined(&BUS_DMA_READ);
    eval 'sub BUS_DMA_WRITE () {0x400;}' unless defined(&BUS_DMA_WRITE);
    eval 'sub BUS_DMA_ZERO () {0x1000;}' unless defined(&BUS_DMA_ZERO);
    eval 'sub DMAMAP_NO_COALESCE () {0x40000000;}' unless defined(&DMAMAP_NO_COALESCE);
    eval 'sub BUS_DMASYNC_PREREAD () {0x1;}' unless defined(&BUS_DMASYNC_PREREAD);
    eval 'sub BUS_DMASYNC_POSTREAD () {0x2;}' unless defined(&BUS_DMASYNC_POSTREAD);
    eval 'sub BUS_DMASYNC_PREWRITE () {0x4;}' unless defined(&BUS_DMASYNC_PREWRITE);
    eval 'sub BUS_DMASYNC_POSTWRITE () {0x8;}' unless defined(&BUS_DMASYNC_POSTWRITE);
    eval("sub ALPHA_BUS_TURBOCHANNEL () { 0; }") unless defined(&ALPHA_BUS_TURBOCHANNEL);
    eval("sub ALPHA_BUS_PCI () { 1; }") unless defined(&ALPHA_BUS_PCI);
    eval("sub ALPHA_BUS_EISA () { 2; }") unless defined(&ALPHA_BUS_EISA);
    eval("sub ALPHA_BUS_ISA () { 3; }") unless defined(&ALPHA_BUS_ISA);
    eval("sub ALPHA_BUS_TLSB () { 4; }") unless defined(&ALPHA_BUS_TLSB);
    eval 'sub alphabus_dma_get_tag {
        my($t, $b) = @_;
	    eval q((*($t)-> &_get_tag)($t, $b));
    }' unless defined(&alphabus_dma_get_tag);
    eval 'sub bus_dmamap_create {
        my($t, $s, $n, $m, $b, $f, $p) = @_;
	    eval q((*($t)-> &_dmamap_create)(($t), ($s), ($n), ($m), ($b), ($f), ($p)));
    }' unless defined(&bus_dmamap_create);
    eval 'sub bus_dmamap_destroy {
        my($t, $p) = @_;
	    eval q((*($t)-> &_dmamap_destroy)(($t), ($p)));
    }' unless defined(&bus_dmamap_destroy);
    eval 'sub bus_dmamap_load {
        my($t, $m, $b, $s, $p, $f) = @_;
	    eval q((*($t)-> &_dmamap_load)(($t), ($m), ($b), ($s), ($p), ($f)));
    }' unless defined(&bus_dmamap_load);
    eval 'sub bus_dmamap_load_mbuf {
        my($t, $m, $b, $f) = @_;
	    eval q((*($t)-> &_dmamap_load_mbuf)(($t), ($m), ($b), ($f)));
    }' unless defined(&bus_dmamap_load_mbuf);
    eval 'sub bus_dmamap_load_uio {
        my($t, $m, $u, $f) = @_;
	    eval q((*($t)-> &_dmamap_load_uio)(($t), ($m), ($u), ($f)));
    }' unless defined(&bus_dmamap_load_uio);
    eval 'sub bus_dmamap_load_raw {
        my($t, $m, $sg, $n, $s, $f) = @_;
	    eval q((*($t)-> &_dmamap_load_raw)(($t), ($m), ($sg), ($n), ($s), ($f)));
    }' unless defined(&bus_dmamap_load_raw);
    eval 'sub bus_dmamap_unload {
        my($t, $p) = @_;
	    eval q(( &void)($t), (*($p)-> ($_dm_window->{_dmamap_unload}))(($p)-> &_dm_window, ($p)));
    }' unless defined(&bus_dmamap_unload);
    eval 'sub bus_dmamap_sync {
        my($t, $p, $a, $s, $op) = @_;
	    eval q(( &void)($t), (*($p)-> ($_dm_window->{_dmamap_sync}))(($p)-> &_dm_window, ($p), ($a), ($s), ($op)));
    }' unless defined(&bus_dmamap_sync);
    eval 'sub bus_dmamem_alloc {
        my($t, $s, $a, $b, $sg, $n, $r, $f) = @_;
	    eval q((*($t)-> &_dmamem_alloc)(($t), ($s), ($a), ($b), ($sg), ($n), ($r), ($f)));
    }' unless defined(&bus_dmamem_alloc);
    eval 'sub bus_dmamem_free {
        my($t, $sg, $n) = @_;
	    eval q((*($t)-> &_dmamem_free)(($t), ($sg), ($n)));
    }' unless defined(&bus_dmamem_free);
    eval 'sub bus_dmamem_map {
        my($t, $sg, $n, $s, $k, $f) = @_;
	    eval q((*($t)-> &_dmamem_map)(($t), ($sg), ($n), ($s), ($k), ($f)));
    }' unless defined(&bus_dmamem_map);
    eval 'sub bus_dmamem_unmap {
        my($t, $k, $s) = @_;
	    eval q((*($t)-> &_dmamem_unmap)(($t), ($k), ($s)));
    }' unless defined(&bus_dmamem_unmap);
    eval 'sub bus_dmamem_mmap {
        my($t, $sg, $n, $o, $p, $f) = @_;
	    eval q((*($t)-> &_dmamem_mmap)(($t), ($sg), ($n), ($o), ($p), ($f)));
    }' unless defined(&bus_dmamem_mmap);
    if(defined(&_ALPHA_BUS_DMA_PRIVATE)) {
    }
}
1;
