From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH] INIT_FUNC - List madness
Date: Thu, 12 Apr 2012 15:28:02 +0200 [thread overview]
Message-ID: <20120412132803.06249202AAF@gemini.denx.de> (raw)
In-Reply-To: <4F86CDF0.2030208@gmail.com>
Dear Graeme Russ,
In message <4F86CDF0.2030208@gmail.com> you wrote:
>
> This patch is a little heads-up for my upcomming INIT_FUNC patch series
>
> This is the INIT_FUNC 'engine' - It processes a file which consists of
> entries created by the following macros:
>
> #define INIT_FUNC(fn, init_name, man_reqs, pre_reqs, post_reqs) \
> static const char __init_func_ ## fn[] __used \
> __attribute__((__section__(".initfuncs"))) = \
> "(f:" #fn ":" #init_name ":" #man_reqs " | " #pre_reqs " | " #post_reqs ")\n";
>
> #define SKIP_INIT(init_name) \
> static const char __skip_init_ ## req[] __used \
> __attribute__((__section__(".initfuncs"))) = \
> "(s:" #init_name ")\n";
>
> #define REPLACE_INIT(old_func, new_func) \
> static const char __replace_init_ ## old_func[] __used \
> __attribute__((__section__(".initfuncs"))) = \
> "(r:" #old_func ":" #new_func ")\n";
>
> So an 'function' entry will look like
> (f:function_name:init_step:mandatory_req_1 mandatory_req_2 | optional_req_1 optional_req_2 | post_req_1 post_req_2)
Looks OK so far...
> So far this seems to work - It creates a list of functions with each
> having a list of dependent functions (steps are expanded so the dependency
> lists only have functions in them)
>
> Now I just need to write the code that will order the function list
>
> I think this single patch will more than double the use of struct list_head
> in U-Boot. It took a while to get used to it's sematics, but the Linux
> kernel list data structure is incredible
Umm... why are you writing such code in C yourself? Don't we have
sufficient tools to perform such sorting? Detlev already recommended
"tsort" when we discussed this befopre, and now again. This should
allow you to avoid most of this code.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Success in marriage is not so much finding the right person as it is
being the right person.
next prev parent reply other threads:[~2012-04-12 13:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 12:43 [U-Boot] [RFC][PATCH] INIT_FUNC - List madness Graeme Russ
2012-04-12 13:01 ` Detlev Zundel
2012-04-12 13:28 ` Wolfgang Denk [this message]
2012-04-12 23:19 ` Graeme Russ
2012-04-13 3:32 ` Graeme Russ
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=20120412132803.06249202AAF@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.