diff mbox

[v4,2/2] semihosting: add --semihosting-config arg sub-argument

Message ID CAFEAcA-BjuDYuzes9=5U3NijUPOzrh-mK9UMh88WvhRw2LqF4w@mail.gmail.com
State New
Headers show

Commit Message

Peter Maydell June 18, 2015, 12:29 p.m. UTC
On 16 June 2015 at 15:20, Leon Alrae <leon.alrae@imgtec.com> wrote:
> On 16/06/2015 15:03, Peter Maydell wrote:
>> On 16 June 2015 at 13:32, Liviu Ionescu <ilg@livius.net> wrote:
>>> would it be possible to have all the semihosting patches ready for 2.4?
>>
>> Yes, I agree that would be good. Is it just this 2 patch
>> series, or are there others too?
>
> Just to confirm -- the only thing required before applying this 2 patch series
> is testing in ARM context by you, right?

That, and you need to respin it, because the qemu_opt_foreach API
has changed in current master.

Something like this is probably sufficient but you should check:

index 5edfa00..278cd6a 100644
 }
@@ -3727,7 +3729,7 @@ int main(int argc, char **argv, char **envp)
                     }
                     /* Set semihosting argument count and vector */
                     qemu_opt_foreach(opts, add_semihosting_arg,
-                                     &semihosting, 0);
+                                     &semihosting, NULL);
                 } else {
                     fprintf(stderr, "Unsupported semihosting-config %s\n",
                             optarg);


thanks
-- PMM
diff mbox

Patch

--- a/vl.c
+++ b/vl.c
@@ -1292,7 +1292,9 @@  const char *semihosting_get_cmdline(void)
     return semihosting.cmdline;
 }

-static int add_semihosting_arg(const char *name, const char *val, void *opaque)
+static int add_semihosting_arg(void *opaque,
+                               const char *name, const char *val,
+                               Error **errp)
 {
     SemihostingConfig *s = opaque;
     if (strcmp(name, "arg") == 0) {
@@ -1311,12 +1313,12 @@  static inline void
semihosting_arg_fallback(const char *file, const char *cmd)
     char *cmd_token;

     /* argv[0] */
-    add_semihosting_arg("arg", file, &semihosting);
+    add_semihosting_arg(&semihosting, "arg", file, NULL);

     /* split -append and initialize argv[1..n] */
     cmd_token = strtok(g_strdup(cmd), " ");
     while (cmd_token) {
-        add_semihosting_arg("arg", cmd_token, &semihosting);
+        add_semihosting_arg(&semihosting, "arg", cmd_token, NULL);
         cmd_token = strtok(NULL, " ");
     }