/*
 * Writes the contents of the console to the specified offset in flash.
 * Returns number of bytes written
 */
static int mtd_ipanic_write_console(struct mtd_info *mtd, unsigned int off)
{
    #define __LOG_BUF_LEN	(1 << CONFIG_LOG_BUF_SHIFT)
    if (log_end > __LOG_BUF_LEN)
	    return ipanic_write_log_buf(mtd, off, log_end-__LOG_BUF_LEN, log_end);
	else
	    return ipanic_write_log_buf(mtd, off, 0, log_end);
}
static int ipanic_write_oops_detail(struct mtd_info *mtd, unsigned int off)
{
	return ipanic_write_log_buf(mtd, off, ipanic_detail_start, ipanic_detail_end);
}
static int mtd_ipanic_write_console(struct mtd_info *mtd, unsigned int off)
{
    #define __LOG_BUF_LEN	(1 << CONFIG_LOG_BUF_SHIFT)

  return ipanic_write_log_buf(mtd, off, ipanic_get_log_start(), ipanic_get_log_end());
}