diff options
Diffstat (limited to 'lib/rts.c')
| -rw-r--r-- | lib/rts.c | 41 |
1 files changed, 11 insertions, 30 deletions
@@ -369,17 +369,6 @@ static struct option options[] = { {0, 0, 0, 0} }; -void z__SetConfig(char* arg, char* value) -{ - fprintf(stderr, "Warning: ignoring option -C %s=%s\n", arg, value); -} - -void z__ListConfig() -{ - fprintf(stderr, "Unable to list configuration options\n"); -} - - int process_arguments(int argc, char *argv[]) { int c; @@ -395,28 +384,20 @@ int process_arguments(int argc, char *argv[]) switch (c) { case 'C': { char arg[100]; - char value[100]; - if (!sscanf(optarg, "%99[a-zA-Z0-9_.]=%99s", arg, value)) { + uint64_t value; + if (sscanf(optarg, "%99[a-zA-Z0-9_-.]=%" PRId64, arg, &value)) { + // do nothing + } else if (sscanf(optarg, "%99[a-zA-Z0-9_.]=0x%" PRIx64, arg, &value)) { + // do nothing + } else { fprintf(stderr, "Could not parse argument %s\n", optarg); - z__ListConfig(); + // z__ListConfig(); return -1; }; - -#ifndef NO_AARCH64 - // Vile AArch64-specific hack to read the start address from standard - // command line option. This will not be needed once the official - // __SetConfig function is used. - if (strcmp(arg, "cpu.cpu0.RVBAR") == 0) { - if (!sscanf(value, "0x%" PRIx64, &elf_entry)) { - fprintf(stderr, "Could not parse RVBAR address %s\n", value); - exit(1); - } - elf_entry_set = true; - break; - } -#endif - - z__SetConfig(arg, value); + mpz_t s_value; + mpz_init_set_ui(s_value, value); + z__SetConfig(arg, s_value); + mpz_clear(s_value); } break; |
