Exemplo n.º 1
0
int
main(int argc, char** argv)
{
    int max = 1000;
    int step;

    step = 0;
    while (step <= max)
    {
        progress_print("the first bar", step, max, 80);
        step++;
        usleep(20000);
    }
    fprintf(stdout, "\n");

    step = 0;
    while (step <= max)
    {
        progress_print("the second bar", step, max, 80);
        step++;
        usleep(30000);
    }
    fprintf(stdout, "\n");

    return 0;
}
Exemplo n.º 2
0
/*
 * Dump all memory to DASD partition
 */
void dt_dump_mem(void)
{
    unsigned long blk, addr, page;

    ccw_program_init();
    blk = device.blk_start;
    page = get_zeroed_page();

    /* Write dump header */
    writeblock(blk, __pa(dump_hdr), m2b(DF_S390_HDR_SIZE), 0);
    blk += DF_S390_HDR_SIZE / BLK_SIZE;

    /* Write memory */
    for (addr = 0; addr < dump_hdr->mem_size; addr += b2m(BLK_PWRT)) {
        writeblock(blk, addr, BLK_PWRT, page);
        progress_print(addr);
        blk += BLK_PWRT;
    }
    progress_print(addr);

    /* Write end marker */
    df_s390_em_page_init(page);
    writeblock(blk, page, 1, 0);
    free_page(page);
}