mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Weitzel <J.Weitzel@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3] xload: get barebox size from barebox_arm_head
Date: Tue, 4 Sep 2012 11:28:31 +0200	[thread overview]
Message-ID: <20120904092831.GV26594@pengutronix.de> (raw)
In-Reply-To: <1346744062.4672.3.camel@lws-weitzel>

On Tue, Sep 04, 2012 at 09:34:22AM +0200, Jan Weitzel wrote:
> Am Mittwoch, den 29.08.2012, 14:21 +0200 schrieb Jean-Christophe
> > > +unsigned int get_image_size(void *head)
> > > +{
> > > +	unsigned int ret = 0;
> > > +	unsigned int *psize = head + HEAD_SIZE_OFFSET;
> > > +	const char *pmagic = head + HEAD_MAGICWORD_OFFSET;
> > > +
> > > +	if (!strcmp(pmagic, "barebox"))
> > > +		ret = *psize;
> > > +	debug("Detected barebox image size %u\n", ret);
> > factorise the code with filetype
> What exactly do you mean? I could factorise it by boot source (mmc / nand) with complete omap_xload_boot_nand.

He means that you should use file_detect_type() To detect whether it's a
barebox image.
I'm unsure I share this opinion. After detecting that it's a barebox
file you have to look into the header anyway to get the actual size.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-09-04  9:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 10:56 [RFC] " Jan Weitzel
2012-08-28  6:54 ` Sascha Hauer
2012-08-28  8:41   ` Jan Weitzel
2012-08-28  9:08     ` Sascha Hauer
2012-08-28 12:36       ` [PATCH v2] " Jan Weitzel
2012-08-29  6:59         ` Sascha Hauer
2012-08-29  8:01           ` Jan Weitzel
2012-08-29  9:10             ` [PATCH v3] " Jan Weitzel
2012-08-29 12:21               ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-04  7:34                 ` Jan Weitzel
2012-09-04  9:28                   ` Sascha Hauer [this message]
2012-09-04 12:27                     ` Jan Weitzel
2012-09-04 14:41                       ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-05  8:22                         ` [PATCH v4] " Jan Weitzel
2012-09-05 10:34                           ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-05 11:37                             ` Suspected ##SPAM## -:Re: " Jan Weitzel
2012-09-05 12:02                               ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120904092831.GV26594@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=J.Weitzel@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox