static void rtas_get_time_of_day(sPAPREnvironment *spapr,

                                 uint32_t token, uint32_t nargs,

                                 target_ulong args,

                                 uint32_t nret, target_ulong rets)

{

    struct tm tm;



    if (nret != 8) {

        rtas_st(rets, 0, -3);

        return;

    }



    qemu_get_timedate(&tm, spapr->rtc_offset);



    rtas_st(rets, 0, 0); /* Success */

    rtas_st(rets, 1, tm.tm_year + 1900);

    rtas_st(rets, 2, tm.tm_mon + 1);

    rtas_st(rets, 3, tm.tm_mday);

    rtas_st(rets, 4, tm.tm_hour);

    rtas_st(rets, 5, tm.tm_min);

    rtas_st(rets, 6, tm.tm_sec);

    rtas_st(rets, 7, 0); /* we don't do nanoseconds */

}

static void rtas_get_time_of_day(sPAPREnvironment *spapr,

                                 uint32_t token, uint32_t nargs,

                                 target_ulong args,

                                 uint32_t nret, target_ulong rets)

{

    struct tm tm;



    if (nret != 8) {

        rtas_st(rets, 0, -3);

        return;

    }



    qemu_get_timedate(&tm, spapr->rtc_offset);



    rtas_st(rets, 0, 0); 

    rtas_st(rets, 1, tm.tm_year + 1900);

    rtas_st(rets, 2, tm.tm_mon + 1);

    rtas_st(rets, 3, tm.tm_mday);

    rtas_st(rets, 4, tm.tm_hour);

    rtas_st(rets, 5, tm.tm_min);

    rtas_st(rets, 6, tm.tm_sec);

    rtas_st(rets, 7, 0); 

}

static void FUNC_0(sPAPREnvironment *VAR_0,

                                 uint32_t VAR_1, uint32_t VAR_2,

                                 target_ulong VAR_3,

                                 uint32_t VAR_4, target_ulong VAR_5)

{

    struct VAR_6 VAR_6;



    if (VAR_4 != 8) {

        rtas_st(VAR_5, 0, -3);

        return;

    }



    qemu_get_timedate(&VAR_6, VAR_0->rtc_offset);



    rtas_st(VAR_5, 0, 0); 

    rtas_st(VAR_5, 1, VAR_6.tm_year + 1900);

    rtas_st(VAR_5, 2, VAR_6.tm_mon + 1);

    rtas_st(VAR_5, 3, VAR_6.tm_mday);

    rtas_st(VAR_5, 4, VAR_6.tm_hour);

    rtas_st(VAR_5, 5, VAR_6.tm_min);

    rtas_st(VAR_5, 6, VAR_6.tm_sec);

    rtas_st(VAR_5, 7, 0); 

}

static void FUNC_0(sPAPREnvironment *VAR_0,
uint32_t VAR_1, uint32_t VAR_2,
target_ulong VAR_3,
uint32_t VAR_4, target_ulong VAR_5)
{ struct VAR_6 VAR_6; if (VAR_4 != 8) { rtas_st(VAR_5, 0, -3); return; } qemu_get_timedate(&VAR_6, VAR_0->rtc_offset); rtas_st(VAR_5, 0, 0); rtas_st(VAR_5, 1, VAR_6.tm_year + 1900); rtas_st(VAR_5, 2, VAR_6.tm_mon + 1); rtas_st(VAR_5, 3, VAR_6.tm_mday); rtas_st(VAR_5, 4, VAR_6.tm_hour); rtas_st(VAR_5, 5, VAR_6.tm_min); rtas_st(VAR_5, 6, VAR_6.tm_sec); rtas_st(VAR_5, 7, 0); }