From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Machine description as data prototype, take 4
Date: Wed, 25 Feb 2009 22:11:18 +0200 [thread overview]
Message-ID: <f43fc5580902251211r73f4cb97g4ca4a2026cf6fcf@mail.gmail.com> (raw)
In-Reply-To: <873ae267fq.fsf@pike.pond.sub.org>
On 2/25/09, Markus Armbruster <armbru@redhat.com> wrote:
> Blue Swirl <blauwirbel@gmail.com> writes:
>
> > On 2/23/09, Markus Armbruster <armbru@redhat.com> wrote:
> >> Fourth iteration of the prototype. I'm not asking to consider a merge
> >> at this time.
> >
> >> +static dt_prop_spec dt_cpus_props[] = {
> >> + DT_PROP_SPEC_INIT("model", dt_device_cpus, model, string),
> >> + DT_PROP_SPEC_INIT("num", dt_device_cpus, num, int),
> >> +};
> >
> > Please use "const".
>
> Done.
>
> >> +static void dt_memrng_rom(dt_device_memrng *rng,
> >> + target_phys_addr_t phys_addr, ram_addr_t maxsz,
> >> + const char *dir, const char *image, int top)
> >> +{
> >> + char buf[1024];
> >> + int size;
> >> +
> >> + snprintf(buf, sizeof(buf), "%s/%s", dir, image);
> >> + size = get_image_size(buf);
> >> + if (size < 0 || size > maxsz)
> >> + goto error;
> >> + if (top)
> >> + phys_addr = phys_addr + maxsz - size;
> >> + dt_memrng(rng, phys_addr, size, qemu_ram_alloc(size), IO_MEM_ROM);
> >> + if (load_image(buf, phys_ram_base + rng->host_offs) != size)
> >> + goto error;
> >> + return;
> >> +
> >> +error:
> >> + fprintf(stderr, "qemu: could not load image '%s'\n", buf);
> >> + exit(1);
> >> +}
> >
> > If this is going to be the generic ROM loader, it should also handle
> > ELF format images. But for the PC this is enough.
>
> Yes.
>
> [more const fallout...]
> >> void register_machines(void)
> >> {
> >> + extern QEMUMachine pcdt_machine;
> >
> > Put this into hw/boards.h.
>
> Done. A leftover from the early reckless hacking stage.
>
> >> +tree *tree_new_kid(tree *parent, const char *name, void *user)
> >
> > The OF term for "kid" is "child".
> >
> >> +tree *tree_sibling(const tree *node)
> >
> > Here the OF word is "peer".
>
> Do you mean to recommend renames? Note that right now this is a
> perfectly generic decorated tree, which could be used for anything, not
> just device trees.
>
> While I'm not particular about "kid" vs. "child", I find "peer" clearly
> inferior. "Sibling" is obvious: child of the same parent. "Peer" could
> be anything.
Maybe the function usage is different, "peer" gets passed the child
node and it returns a node from the same level, whereas your function
takes the parent node. Or does it?
Anyway, "sibling" is still unnecessary deviation.
next prev parent reply other threads:[~2009-02-25 20:11 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 15:40 [Qemu-devel] [RFC] Machine description as data Markus Armbruster
2009-02-11 16:31 ` Ian Jackson
2009-02-11 17:43 ` Markus Armbruster
2009-02-11 18:57 ` Hollis Blanchard
2009-02-12 3:50 ` David Gibson
2009-02-11 18:50 ` Hollis Blanchard
2009-02-11 19:34 ` Blue Swirl
2009-02-12 4:01 ` David Gibson
2009-02-12 10:26 ` Markus Armbruster
2009-02-12 12:49 ` Carl-Daniel Hailfinger
2009-02-12 16:46 ` M. Warner Losh
2009-02-12 18:29 ` Markus Armbruster
2009-02-12 23:58 ` Carl-Daniel Hailfinger
2009-02-13 11:19 ` Markus Armbruster
2009-02-13 1:05 ` David Gibson
2009-02-12 23:35 ` Carl-Daniel Hailfinger
2009-02-12 23:58 ` Paul Brook
2009-02-13 0:32 ` Carl-Daniel Hailfinger
2009-02-13 0:47 ` Jamie Lokier
2009-02-13 1:46 ` David Gibson
2009-02-13 14:32 ` Lennart Sorensen
2009-02-13 0:05 ` M. Warner Losh
2009-02-12 17:52 ` Hollis Blanchard
2009-02-12 18:53 ` Markus Armbruster
2009-02-12 19:33 ` Mitch Bradley
2009-02-13 0:59 ` David Gibson
2009-02-13 1:00 ` David Gibson
2009-02-13 0:43 ` David Gibson
2009-02-13 2:11 ` Carl-Daniel Hailfinger
2009-02-13 2:17 ` David Gibson
2009-02-13 2:45 ` DTS syntax and DTC patches (was: Re: [Qemu-devel] [RFC] Machine description as data) Carl-Daniel Hailfinger
2009-02-13 2:51 ` David Gibson
2009-02-13 20:04 ` [Qemu-devel] [RFC] Machine description as data Jon Loeliger
2009-02-13 20:15 ` Carl-Daniel Hailfinger
2009-02-13 20:19 ` Jon Loeliger
2009-02-12 10:26 ` Markus Armbruster
2009-02-12 12:36 ` Carl-Daniel Hailfinger
2009-02-12 16:07 ` Paul Brook
2009-02-12 17:17 ` Blue Swirl
2009-02-12 18:09 ` Marcelo Tosatti
2009-02-13 0:37 ` David Gibson
2009-02-13 11:26 ` Markus Armbruster
2009-02-13 12:06 ` Paul Brook
2009-02-13 12:48 ` Markus Armbruster
2009-02-13 13:33 ` Paul Brook
2009-02-13 14:13 ` Markus Armbruster
2009-02-13 14:25 ` Paul Brook
2009-02-13 15:47 ` Jamie Lokier
2009-02-13 18:36 ` Mitch Bradley
2009-02-13 19:49 ` Markus Armbruster
2009-02-13 19:51 ` Mitch Bradley
2009-02-16 3:42 ` David Gibson
2009-02-16 16:39 ` Markus Armbruster
2009-02-17 3:29 ` David Gibson
2009-02-17 7:54 ` Markus Armbruster
2009-02-17 17:44 ` Paul Brook
2009-02-18 8:36 ` Markus Armbruster
2009-02-11 19:01 ` Anthony Liguori
2009-02-11 19:36 ` Blue Swirl
2009-02-11 19:56 ` Anthony Liguori
2009-02-12 10:25 ` Markus Armbruster
2009-02-16 16:22 ` [Qemu-devel] Machine description as data prototype, take 2 (was: [RFC] Machine description as data) Markus Armbruster
2009-02-17 17:32 ` Paul Brook
2009-02-18 8:42 ` [Qemu-devel] Machine description as data prototype, take 2 Markus Armbruster
2009-02-19 10:29 ` [Qemu-devel] Machine description as data prototype, take 3 (was: [RFC] Machine description as data) Markus Armbruster
2009-02-19 13:53 ` Paul Brook
2009-02-19 14:55 ` [Qemu-devel] Machine description as data prototype, take 3 Markus Armbruster
2009-02-19 15:03 ` Paul Brook
2009-02-19 14:36 ` Anthony Liguori
2009-02-19 15:00 ` Markus Armbruster
2009-02-19 14:49 ` Anthony Liguori
2009-02-23 17:38 ` Markus Armbruster
2009-02-23 18:58 ` Anthony Liguori
2009-02-24 9:08 ` Markus Armbruster
2009-02-19 16:40 ` [Qemu-devel] Machine description as data prototype, take 3 (was: [RFC] Machine description as data) Blue Swirl
2009-02-19 18:30 ` [Qemu-devel] Machine description as data prototype, take 3 Markus Armbruster
2009-02-20 18:14 ` Blue Swirl
2009-02-20 18:20 ` Paul Brook
2009-02-23 12:00 ` Markus Armbruster
2009-02-23 12:18 ` Markus Armbruster
2009-02-23 18:00 ` [Qemu-devel] Machine description as data prototype, take 4 (was: [RFC] Machine description as data) Markus Armbruster
2009-02-24 20:06 ` Blue Swirl
2009-02-25 12:13 ` [Qemu-devel] Machine description as data prototype, take 4 Markus Armbruster
2009-02-25 20:11 ` Blue Swirl [this message]
2009-03-03 17:46 ` [Qemu-devel] Machine description as data prototype, take 5 (was: [RFC] Machine description as data) Markus Armbruster
2009-03-12 18:43 ` [Qemu-devel] Machine description as data prototype, take 6 " Markus Armbruster
2009-03-17 16:06 ` [Qemu-devel] Machine description as data prototype, take 6 Paul Brook
2009-03-17 17:32 ` Markus Armbruster
2009-03-23 15:50 ` [Qemu-devel] Re: [RFC] Machine description as data Markus Armbruster
2009-03-23 15:53 ` Markus Armbruster
2009-03-31 9:16 ` Markus Armbruster
2009-04-17 16:04 ` Markus Armbruster
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=f43fc5580902251211r73f4cb97g4ca4a2026cf6fcf@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.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).