From: riku voipio <riku.voipio@iki.fi>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Schildbach, Wolfgang" <WSCHI@dolby.com>,
qemu-devel@nongnu.org, Nathan Froyd <froydnj@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH 0/2] ARM: fix commandline handling forsemihosted executables
Date: Fri, 07 Jan 2011 18:29:36 +0200 [thread overview]
Message-ID: <4D273F70.6050606@iki.fi> (raw)
In-Reply-To: <AANLkTin9nP1A5+Of_MEQdwM9Zuy=qt9cXFfQnt2hnFuW@mail.gmail.com>
On 01/07/2011 05:56 PM, Peter Maydell wrote:
> Or you can just test "by hand":
Got it. For anyone wondering into this thread, if you use ubuntu/linaro
toolchains to compile the example below, you need a -marm flag for the
compiler or you'll get a weird error on swi...
Looks good, I'll add these the next batch of patches.
> #include<stdio.h>
>
> struct datablock {
> char *string;
> int buflen;
> };
>
> char buf[20];
>
> int main(int argc, char **argv) {
> int r, i;
> struct datablock datablock;
> printf("semihosting-cmd test: argc %d\n", argc);
> for (i = 0; i< argc; i++) {
> printf("argv[%d]: %s\n", i, argv[i]);
> }
> datablock.string = buf;
> datablock.buflen = sizeof(buf);
> {
> register int r0 asm ("r0") = 0x15;
> register void * r1 asm ("r1") =&datablock;
> register int result asm ("r0");
> __asm__ __volatile__ (
> "svc 0x123456"
> : "=r" (result)
> : "r" (r0), "r" (r1)
> : "cc", "memory");
> r = result;
> }
> printf("semihosting returned status %d\n", r);
> if (r == 0) {
> printf("and string '%s'\n", datablock.string);
> }
> return 0;
> }
>
> -- PMM
prev parent reply other threads:[~2011-01-07 16:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 15:06 [Qemu-devel] [PATCH 0/2] ARM: fix commandline handling for semihosted executables Peter Maydell
2010-12-06 15:06 ` [Qemu-devel] [PATCH 1/2] Fix commandline handling for ARM " Peter Maydell
2010-12-06 15:06 ` [Qemu-devel] [PATCH 2/2] Remove dead code for ARM semihosting commandline handling Peter Maydell
2010-12-23 12:58 ` [Qemu-devel] [PATCH 0/2] ARM: fix commandline handling forsemihosted executables Schildbach, Wolfgang
2010-12-23 14:09 ` Peter Maydell
2011-01-07 15:34 ` riku voipio
2011-01-07 15:46 ` Schildbach, Wolfgang
2011-01-07 15:56 ` Peter Maydell
2011-01-07 16:29 ` riku voipio [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=4D273F70.6050606@iki.fi \
--to=riku.voipio@iki.fi \
--cc=WSCHI@dolby.com \
--cc=froydnj@codesourcery.com \
--cc=peter.maydell@linaro.org \
--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).