static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib)

{

    int ret, len;



    ret = css_register_io_adapter(S390_PCIPT_ADAPTER,

                                  FIB_DATA_ISC(ldl_p(&fib.data)), true, false,

                                  &pbdev->routes.adapter.adapter_id);

    assert(ret == 0);



    pbdev->summary_ind = get_indicator(ldq_p(&fib.aisb), sizeof(uint64_t));

    len = BITS_TO_LONGS(FIB_DATA_NOI(ldl_p(&fib.data))) * sizeof(unsigned long);

    pbdev->indicator = get_indicator(ldq_p(&fib.aibv), len);



    map_indicator(&pbdev->routes.adapter, pbdev->summary_ind);

    map_indicator(&pbdev->routes.adapter, pbdev->indicator);



    pbdev->routes.adapter.summary_addr = ldq_p(&fib.aisb);

    pbdev->routes.adapter.summary_offset = FIB_DATA_AISBO(ldl_p(&fib.data));

    pbdev->routes.adapter.ind_addr = ldq_p(&fib.aibv);

    pbdev->routes.adapter.ind_offset = FIB_DATA_AIBVO(ldl_p(&fib.data));

    pbdev->isc = FIB_DATA_ISC(ldl_p(&fib.data));

    pbdev->noi = FIB_DATA_NOI(ldl_p(&fib.data));

    pbdev->sum = FIB_DATA_SUM(ldl_p(&fib.data));



    DPRINTF("reg_irqs adapter id %d\n", pbdev->routes.adapter.adapter_id);

    return 0;

}

static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib)

{

    int ret, len;



    ret = css_register_io_adapter(S390_PCIPT_ADAPTER,

                                  FIB_DATA_ISC(ldl_p(&fib.data)), true, false,

                                  &pbdev->routes.adapter.adapter_id);

    assert(ret == 0);



    pbdev->summary_ind = get_indicator(ldq_p(&fib.aisb), sizeof(uint64_t));

    len = BITS_TO_LONGS(FIB_DATA_NOI(ldl_p(&fib.data))) * sizeof(unsigned long);

    pbdev->indicator = get_indicator(ldq_p(&fib.aibv), len);



    map_indicator(&pbdev->routes.adapter, pbdev->summary_ind);

    map_indicator(&pbdev->routes.adapter, pbdev->indicator);



    pbdev->routes.adapter.summary_addr = ldq_p(&fib.aisb);

    pbdev->routes.adapter.summary_offset = FIB_DATA_AISBO(ldl_p(&fib.data));

    pbdev->routes.adapter.ind_addr = ldq_p(&fib.aibv);

    pbdev->routes.adapter.ind_offset = FIB_DATA_AIBVO(ldl_p(&fib.data));

    pbdev->isc = FIB_DATA_ISC(ldl_p(&fib.data));

    pbdev->noi = FIB_DATA_NOI(ldl_p(&fib.data));

    pbdev->sum = FIB_DATA_SUM(ldl_p(&fib.data));



    DPRINTF("reg_irqs adapter id %d\n", pbdev->routes.adapter.adapter_id);

    return 0;

}

static int FUNC_0(CPUS390XState *VAR_0, S390PCIBusDevice *VAR_1, ZpciFib VAR_2)

{

    int VAR_3, VAR_4;



    VAR_3 = css_register_io_adapter(S390_PCIPT_ADAPTER,

                                  FIB_DATA_ISC(ldl_p(&VAR_2.data)), true, false,

                                  &VAR_1->routes.adapter.adapter_id);

    assert(VAR_3 == 0);



    VAR_1->summary_ind = get_indicator(ldq_p(&VAR_2.aisb), sizeof(uint64_t));

    VAR_4 = BITS_TO_LONGS(FIB_DATA_NOI(ldl_p(&VAR_2.data))) * sizeof(unsigned long);

    VAR_1->indicator = get_indicator(ldq_p(&VAR_2.aibv), VAR_4);



    map_indicator(&VAR_1->routes.adapter, VAR_1->summary_ind);

    map_indicator(&VAR_1->routes.adapter, VAR_1->indicator);



    VAR_1->routes.adapter.summary_addr = ldq_p(&VAR_2.aisb);

    VAR_1->routes.adapter.summary_offset = FIB_DATA_AISBO(ldl_p(&VAR_2.data));

    VAR_1->routes.adapter.ind_addr = ldq_p(&VAR_2.aibv);

    VAR_1->routes.adapter.ind_offset = FIB_DATA_AIBVO(ldl_p(&VAR_2.data));

    VAR_1->isc = FIB_DATA_ISC(ldl_p(&VAR_2.data));

    VAR_1->noi = FIB_DATA_NOI(ldl_p(&VAR_2.data));

    VAR_1->sum = FIB_DATA_SUM(ldl_p(&VAR_2.data));



    DPRINTF("FUNC_0 adapter id %d\n", VAR_1->routes.adapter.adapter_id);

    return 0;

}

static int FUNC_0(CPUS390XState *VAR_0, S390PCIBusDevice *VAR_1, ZpciFib VAR_2)
{ int VAR_3, VAR_4; VAR_3 = css_register_io_adapter(S390_PCIPT_ADAPTER,
FIB_DATA_ISC(ldl_p(&VAR_2.data)), true, false,
&VAR_1->routes.adapter.adapter_id); assert(VAR_3 == 0); VAR_1->summary_ind = get_indicator(ldq_p(&VAR_2.aisb), sizeof(uint64_t)); VAR_4 = BITS_TO_LONGS(FIB_DATA_NOI(ldl_p(&VAR_2.data))) * sizeof(unsigned long); VAR_1->indicator = get_indicator(ldq_p(&VAR_2.aibv), VAR_4); map_indicator(&VAR_1->routes.adapter, VAR_1->summary_ind); map_indicator(&VAR_1->routes.adapter, VAR_1->indicator); VAR_1->routes.adapter.summary_addr = ldq_p(&VAR_2.aisb); VAR_1->routes.adapter.summary_offset = FIB_DATA_AISBO(ldl_p(&VAR_2.data)); VAR_1->routes.adapter.ind_addr = ldq_p(&VAR_2.aibv); VAR_1->routes.adapter.ind_offset = FIB_DATA_AIBVO(ldl_p(&VAR_2.data)); VAR_1->isc = FIB_DATA_ISC(ldl_p(&VAR_2.data)); VAR_1->noi = FIB_DATA_NOI(ldl_p(&VAR_2.data)); VAR_1->sum = FIB_DATA_SUM(ldl_p(&VAR_2.data)); DPRINTF("FUNC_0 adapter id %d\n", VAR_1->routes.adapter.adapter_id); return 0; }