[U-Boot] [RFC PATCH] Pre-console buffer for ARM

Mike Frysinger vapier at gentoo.org
Mon Aug 29 22:10:30 CEST 2011


On Monday, August 29, 2011 15:42:23 Simon Glass wrote:
> On Mon, Aug 29, 2011 at 12:20 PM, Mike Frysinger wrote:
> > On Monday, August 29, 2011 13:21:57 Simon Glass wrote:
> >> +     if (gd->con_buf_idx < CONFIG_SYS_TMP_CON_BUF_SZ)
> >> +             buffer[gd->con_buf_idx++] = c;
> > 
> > seems like a circular buffer would make more sense ... usually the part
> > of the log you want is the last chunk and not the first
> 
> Yes I agree, although if you have more than 1KB of data it might be a bug.

give people a foot and they'll take 1MiB :p

it's fairly easy as well:
#define CIRC_BUF_IDX(idx) ((idx) & (CONFIG_SYS_TMP_CON_BUF_SZ-1))
buffer[CIRC_BUF_IDX(gd->conf_buf_idx++)] = c;
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110829/dfa93fa6/attachment.pgp 


More information about the U-Boot mailing list