From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] ARM: Add support for semihosting
Date: Mon, 19 Oct 2015 09:36:43 +0200 [thread overview]
Message-ID: <20151019073643.GI14476@pengutronix.de> (raw)
In-Reply-To: <1445232837-22317-1-git-send-email-andrew.smirnov@gmail.com>
Hi Andrey,
On Sun, Oct 18, 2015 at 10:33:57PM -0700, Andrey Smirnov wrote:
> Add semihosting API implementation and implement a filesystem driver
> to access debugging host filesystem using it.
Neat. I didn't know semihosting can be used for file transfer.
> +File I/O over ARM semihosting support
> +=====================================
> +
> +barebox can communicate with debug programms attached via SWD/JTAG by
> +means of ARM semihosting protocol.
> +
> +Not all of the I/O primitives neccessary to implement a full
> +filesystem are exposed in ARM semihosting API and because of that some
> +aspects of filesystem funcionality are missing. Implementation does
> +not have support for listing directories. This means a
> +:ref:`command_ls` to a SMHFS-mounted path will show an empty
> +directory. Nevertheless, the files are there.
Is adding ls support a matter of implementing it? Does the semihosting
protocol support ls?
> +
> +Example::
> +
> + mount -t smhfs /dev/null /mnt/smhfs
Are actions on the host required to do that? Maybe some example for
using this with openocd would be useful.
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 304b6e6..1bccca3 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -326,6 +326,15 @@ config ARM_UNWIND
> the performance is not affected. Currently, this feature
> only works with EABI compilers. If unsure say Y.
>
> +config ARM_SEMIHOSTING
> + bool "enable ARM semihosting support"
> + help
> + This option enables ARM semihosting support in barebox. ARM
> + semihosting is a communication discipline that allows code
> + running on target ARM cpu perform system calls and access
> + the data on the host computer connected to the target via
> + debugging channel (JTAG, SWD). If unsure say N
> +
> endmenu
>
> +static int smhfs_remove(struct device_d __always_unused *dev,
> + const char *pathname)
> +{
> + /* Get rid of leading '/' */
> + pathname = &pathname[1];
> +
> + if (semihosting_remove(pathname) != 0)
> + return semihosting_errno();
Are the errnos semihosting returns compatible with the barebox errnos?
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
next prev parent reply other threads:[~2015-10-19 7:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 5:33 Andrey Smirnov
2015-10-19 7:26 ` Antony Pavlov
2015-10-19 17:48 ` Andrey Smirnov
2015-10-19 7:36 ` Sascha Hauer [this message]
2015-10-21 1:14 ` Andrey Smirnov
2015-10-21 7:26 ` Sascha Hauer
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=20151019073643.GI14476@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=andrew.smirnov@gmail.com \
--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