All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: Liviu Ionescu <ilg@livius.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Christopher Covington <christopher.covington@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Matthew Fortune <matthew.fortune@imgtec.com>
Subject: Re: [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument
Date: Wed, 20 May 2015 09:51:18 +0100	[thread overview]
Message-ID: <555C4B06.6060608@imgtec.com> (raw)
In-Reply-To: <ED3EE5F9-80D6-4374-ACEB-D7CFE05EB379@livius.net>

On 20/05/2015 09:30, Liviu Ionescu wrote:
> 
>> On 20 May 2015, at 11:11, Leon Alrae <leon.alrae@imgtec.com> wrote:
>>
>> like "If both are specified, -kernel/-append are ignored (-kernel is
>> used to load an image, but the path won't be passed to semihosting)" 
> ...
>> We could initialize semihosting.argv[0] with -kernel
> 
> 
> here you have a small contradiction, both in the current ARM implementation, and in your proposal, the full kernel path is passed as argv[0].

These are two different cases:
1) If both "--semihosting-config arg" and -kernel/-append are specified
in QEMU command line, then -kernel/-append is ignored and
semihosting.argv[0] is set with first arg string instead of -kernel
path, arg[1] with second arg, and so on.
2) If we are in semihosting mode but no "--semihosting-config arg" were
specified then argv[0] is set with full path from -kernel, and argv[1]
is set with -append. This is compatible with what ARM is currently doing
I believe.

The following example would support above two cases arm-semi.c:

-            pstrcpy(output_buffer, output_size,
ts->boot_info->kernel_filename);
-            pstrcat(output_buffer, output_size, " ");
-            pstrcat(output_buffer, output_size,
ts->boot_info->kernel_cmdline);
+            if (semihosting_get_argc()) {
+                pstrcat(output_buffer, output_size,
semihosting_get_arg(0));
+                for (i = 1; i < semihosting_get_argc(); i++) {
+                    pstrcat(output_buffer, output_size, " ");
+                    pstrcat(output_buffer, output_size,
semihosting_get_arg(i));
+                }
+            }

Leon

  reply	other threads:[~2015-05-20  8:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 11:41 [Qemu-devel] [PATCH v3 0/2] semihosting: clean up and add --semihosting-config arg Leon Alrae
2015-05-08 11:41 ` [Qemu-devel] [PATCH v3 1/2] semihosting: create SemihostingConfig structure and semihost.h Leon Alrae
2015-05-08 11:41 ` [Qemu-devel] [PATCH v3 2/2] semihosting: add --semihosting-config arg sub-argument Leon Alrae
2015-05-18 16:18   ` Peter Maydell
2015-05-20  8:11     ` Leon Alrae
2015-05-20  8:30       ` Liviu Ionescu
2015-05-20  8:51         ` Leon Alrae [this message]
2015-05-20 11:12           ` Liviu Ionescu
2015-05-20 13:10             ` Leon Alrae
2015-05-20  8:54       ` Peter Maydell
2015-05-20  9:31         ` Leon Alrae
2015-05-20 13:49           ` Liviu Ionescu
2015-05-20 14:18             ` Peter Maydell
2015-05-20 14:31               ` Liviu Ionescu
2015-05-20 14:40                 ` Peter Maydell
2015-05-20 14:59                   ` Liviu Ionescu
2015-05-20 15:11                     ` Peter Maydell
2015-05-20 15:47                       ` Liviu Ionescu
2015-05-21 13:57         ` Leon Alrae
2015-05-21 14:01           ` Peter Maydell
2015-05-21 14:26             ` Leon Alrae
2015-05-21 14:28           ` Liviu Ionescu
2015-05-21 14:33             ` Peter Maydell
2015-05-21 14:57               ` Liviu Ionescu
2015-05-21 15:06                 ` Peter Maydell
2015-05-21 15:24                   ` Liviu Ionescu
2015-05-21 15:29                     ` Peter Maydell
2015-05-21 15:47                       ` Liviu Ionescu
2015-05-21 15:54                         ` Peter Maydell
2015-05-21 16:36                           ` Liviu Ionescu
2015-05-21 16:56                             ` Peter Maydell
2015-05-21 17:11                               ` Liviu Ionescu
2015-05-21 18:35             ` Maciej W. Rozycki
2015-05-21 18:58               ` Liviu Ionescu

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=555C4B06.6060608@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=christopher.covington@linaro.org \
    --cc=ilg@livius.net \
    --cc=matthew.fortune@imgtec.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 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.