From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Devicetree Discuss
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Subject: Re: [RESEND PATCH v3 2/7] Add utilfdt for common functions
Date: Tue, 20 Sep 2011 11:08:59 +1000 [thread overview]
Message-ID: <20110920010859.GE29197@yookeroo.fritz.box> (raw)
In-Reply-To: <1316463668-976-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
On Mon, Sep 19, 2011 at 01:21:03PM -0700, Simon Glass wrote:
> This adds a new utility library for performing libfdt operations.
>
> This is a separate library from libfdt because it performs OS operations,
> like open/close/read/write, while libfdt is OS-neutral. These utility
> functions are useful within the dtc package, and could potentially even
> be generally useful, but should not be part of libfdt.
>
> Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
> Changes in v2:
> - Remove util_decode_key
> - Add utilfdt_decode_type to be used by fdtget/put
> - Remove limits on device tree binary size
>
> Changes in v3:
> - Change format of -t argument to be more like printf
> - Move utilfdt into its own directory and make it a library
> - Use code closer to testutils.c implementation
> - Use open/close instead of fopen/fclose
[snip]
> diff --git a/Makefile b/Makefile
> index 380a705..4f5ccdd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -15,7 +15,7 @@ EXTRAVERSION =
> LOCAL_VERSION =
> CONFIG_LOCALVERSION =
>
> -CPPFLAGS = -I libfdt
> +CPPFLAGS = -I libfdt -I utilfdt
> WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
> -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls
> CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
> @@ -151,6 +151,35 @@ ifneq ($(DEPTARGETS),)
> -include $(LIBFDT_OBJS:%.o=$(LIBFDT_objdir)/%.d)
> endif
>
> +#
> +# Rules for utilfdt
> +#
> +UTILFDT_objdir = utilfdt
> +UTILFDT_srcdir = utilfdt
> +UTILFDT_archive = $(UTILFDT_objdir)/libutilfdt.a
> +UTILFDT_lib = $(UTILFDT_objdir)/libutilfdt-$(DTC_VERSION).$(SHAREDLIB_EXT)
> +UTILFDT_include = $(addprefix $(UTILFDT_srcdir)/,$(UTILFDT_INCLUDES))
> +
> +include $(UTILFDT_srcdir)/Makefile.utilfdt
> +
> +.PHONY: utilfdt
> +utilfdt: $(UTILFDT_archive) $(UTILFDT_lib)
> +
> +$(UTILFDT_archive): $(addprefix $(UTILFDT_objdir)/,$(UTILFDT_OBJS))
> +$(UTILFDT_lib): $(addprefix $(UTILFDT_objdir)/,$(UTILFDT_OBJS))
Building a shared library out of this is complete overkill. In fact,
so is building a .a of it. This is not an exported library for
general use, but just an internal mini-"library" for use by the fdtget
and fdtput functions. Just have them both link with utilfdt.o.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next prev parent reply other threads:[~2011-09-20 1:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 20:21 [RESEND PATCH v3 0/7] Add fdtget and fdtput for access to fdt from build system Simon Glass
[not found] ` <1316463668-976-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-19 20:21 ` [RESEND PATCH v3 1/7] Create Makefile.utils and move ftdump into it Simon Glass
[not found] ` <1316463668-976-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-20 1:02 ` David Gibson
2011-09-19 20:21 ` [RESEND PATCH v3 2/7] Add utilfdt for common functions Simon Glass
[not found] ` <1316463668-976-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-20 1:08 ` David Gibson [this message]
[not found] ` <20110920010859.GE29197-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-20 3:54 ` Simon Glass
[not found] ` <CAPnjgZ0U_gYkQQR14UNZ0tAOT8jYxzwi_mEYXsT134m14m=8Bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-20 8:12 ` David Gibson
2011-09-19 20:21 ` [RESEND PATCH v3 3/7] Add utilfdt tests Simon Glass
[not found] ` <1316463668-976-4-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-09-20 1:11 ` David Gibson
[not found] ` <20110920011147.GF29197-787xzQ0H9iQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2011-09-21 20:28 ` Simon Glass
2011-09-19 20:21 ` [RESEND PATCH v3 4/7] Make testutils use utilfdt Simon Glass
2011-09-19 20:21 ` [RESEND PATCH v3 5/7] ftdump: use utilfdt to read blob Simon Glass
2011-09-19 20:21 ` [RESEND PATCH v3 6/7] Add fdtget utility to read property values from a device tree Simon Glass
2011-09-19 20:21 ` [RESEND PATCH v3 7/7] Add fdtput utility to write property values to " Simon Glass
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=20110920010859.GE29197@yookeroo.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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;
as well as URLs for NNTP newsgroup(s).