diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rts.c | 21 | ||||
| -rw-r--r-- | lib/rts.h | 8 |
2 files changed, 26 insertions, 3 deletions
@@ -30,6 +30,13 @@ unit sail_exit(unit u) return UNIT; } +static uint64_t g_verbosity = 0; + +mach_bits sail_get_verbosity(const unit u) +{ + return g_verbosity; +} + bool g_sleeping = false; unit sleep_request(const unit u) @@ -434,12 +441,13 @@ void get_cycle_count(sail_int *rop, const unit u) /* ***** Argument Parsing ***** */ static struct option options[] = { - {"elf", required_argument, 0, 'e'}, - {"entry", required_argument, 0, 'n'}, - {"image", required_argument, 0, 'i'}, {"binary", required_argument, 0, 'b'}, {"cyclelimit", required_argument, 0, 'l'}, {"config", required_argument, 0, 'C'}, + {"elf", required_argument, 0, 'e'}, + {"entry", required_argument, 0, 'n'}, + {"image", required_argument, 0, 'i'}, + {"verbosity", required_argument, 0, 'v'}, {0, 0, 0, 0} }; @@ -517,6 +525,13 @@ int process_arguments(int argc, char *argv[]) } break; + case 'v': + if (!sscanf(optarg, "0x%" PRIx64, &g_verbosity)) { + fprintf(stderr, "Could not parse verbosity flags %s\n", optarg); + return -1; + } + break; + default: fprintf(stderr, "Unrecognized option %s\n", optarg); return -1; @@ -21,6 +21,14 @@ unit sail_assert(bool b, sail_string msg); unit sail_exit(unit); /* + * sail_get_verbosity reads a 64-bit value that the C runtime allows you to set + * on the command line. + * The intention is that you can use individual bits to turn on/off different + * pieces of debugging output. + */ +mach_bits sail_get_verbosity(const unit u); + +/* * Put processor to sleep until an external device calls wakeup_request(). */ unit sleep_request(const unit u); |
