From: Sascha Hauer <s.hauer@pengutronix.de>
To: michel@reverze.net
Cc: barebox@lists.infradead.org
Subject: Re: [PATCHv3 1/3] common: Allow for I/O mapped I/O
Date: Mon, 7 Apr 2014 09:26:16 +0200 [thread overview]
Message-ID: <20140407072616.GI27055@pengutronix.de> (raw)
In-Reply-To: <1396705058-15047-1-git-send-email-michel@reverze.net>
Hi Michel,
Looks good overall. Some small remaining remarks.
On Sat, Apr 05, 2014 at 03:37:36PM +0200, michel@reverze.net wrote:
> diff --git a/commands/iomemport.c b/commands/iomemport.c
> new file mode 100644
> index 0000000..06bbd92
> --- /dev/null
> +++ b/commands/iomemport.c
> @@ -0,0 +1,64 @@
> +/*
> + * iomem.c - barebox iomem command
> + *
> + * Copyright (c) 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2
> + * as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +#include <common.h>
> +#include <command.h>
> +
> +static void __print_resources(struct resource *res, int indent)
> +{
> + struct resource *r;
> + int i;
> +
> + for (i = 0; i < indent; i++)
> + printf(" ");
> +
> + printf(PRINTF_CONVERSION_RESOURCE " - " PRINTF_CONVERSION_RESOURCE
> + " (size " PRINTF_CONVERSION_RESOURCE ") %s\n",
> + res->start, res->end, resource_size(res), res->name);
> +
> + list_for_each_entry(r, &res->children, sibling)
> + __print_resources(r, indent + 1);
> +}
> +
> +static void print_resources(struct resource *res)
> +{
> + __print_resources(res, 0);
> +}
> +
> +static int do_iomem(int argc, char *argv[])
> +{
> + print_resources(&iomem_resource);
> +
> + return 0;
> +}
> +
> +static int do_ioport(int argc, char *argv[])
> +{
> + print_resources(&ioport_resource);
> +
> + return 0;
> +}
> +
> +BAREBOX_CMD_START(iomem)
> + .cmd = do_iomem,
> + .usage = "show iomem usage",
> +BAREBOX_CMD_END
> +
> +BAREBOX_CMD_START(ioport)
> + .cmd = do_ioport,
> + .usage = "show ioport usage",
> +BAREBOX_CMD_END
Can we surround this with a
#if IOSPACE_LIMIT > 0
So that users of architectures without iospace are not presesnted a
useless command?
BTW In this version there's no whitespace damage anymore. The patches
apply without problems now.
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
prev parent reply other threads:[~2014-04-07 7:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-05 13:37 michel
2014-04-05 13:37 ` [PATCHv3 2/3] x86: Add support for IDE on the legacy I/O ports michel
2014-04-05 13:37 ` [PATCHv3 3/3] x86: ns16550: Rework driver to allow for x86 I/O space michel
2014-04-07 7:26 ` Sascha Hauer [this message]
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=20140407072616.GI27055@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=michel@reverze.net \
/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