コード例 #1
0
ファイル: reboot_record.c プロジェクト: foric/lk-lollipop
static void mrdump_query_bootinfo(void)
{
    if (mrdump_cb == NULL) {
        struct mrdump_control_block *bufp = (struct mrdump_control_block *)MRDUMP_CB_ADDR;
        if (memcmp(bufp->sig, "MRDUMP01", 8) == 0) {
            voprintf_debug("Boot record found at %p\n", bufp);
            mrdump_cb = bufp;
            bufp->sig[0] = 'X';
            aee_mrdump_flush_cblock();
        }
	else {
            voprintf_debug("No boot record found at %p[%02x%02x]\n", bufp, bufp->sig[0], bufp->sig[1]);
        }
    }
}
コード例 #2
0
static void kdump_ui(struct mrdump_control_block *mrdump_cblock)
{
    video_clean_screen();
    video_set_cursor(0, 0);

    mrdump_status_error("Unknown error\n");
    voprintf_info("Kdump triggerd by '%s'\n", mrdump_mode2string(mrdump_cblock->crash_record.reboot_mode));

    struct aee_timer elapse_time;
    aee_timer_init(&elapse_time);

    uint32_t total_dump_size = memory_size();
    
    aee_timer_start(&elapse_time);
    switch (mrdump_cblock->machdesc.output_device) {
    case MRDUMP_DEV_NULL:
        kdump_null_output(mrdump_cblock, total_dump_size);
        break;
#if 0
    case MRDUMP_DEV_SDCARD:
        kdump_sdcard_output(mrdump_cblock, total_dump_size);
        break;
#endif
    case MRDUMP_DEV_EMMC:
        kdump_emmc_output(mrdump_cblock, total_dump_size);
        break;

    default:
        voprintf_error("Unknown device id %d\n", mrdump_cblock->machdesc.output_device);
    }

    aee_timer_stop(&elapse_time);
    
    voprintf_info("Reset count down %d ...\n", MRDUMP_DELAY_TIME);
    mtk_wdt_restart();

    int timeout = MRDUMP_DELAY_TIME;
    while(timeout-- >= 0) {
        mdelay(1000);
        mtk_wdt_restart();
	voprintf_info("\rsec %d", timeout);
    }
    aee_mrdump_flush_cblock();

    video_clean_screen();
    video_set_cursor(0, 0);
}