diff options
author | Alistair Popple <alistair@popple.id.au> | 2018-05-24 13:42:49 +1000 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2018-05-24 13:42:49 +1000 |
commit | 070d7cd51ed14b5c9997524305004de0fbabb7da (patch) | |
tree | 6025dad79e0918c25aba6456ef30c3d7917d98c7 /src/htm.c | |
parent | 9d8dfd7ea4a133c1c14198ba4a00df043ca1911b (diff) | |
download | pdbg-070d7cd51ed14b5c9997524305004de0fbabb7da.tar.gz pdbg-070d7cd51ed14b5c9997524305004de0fbabb7da.zip |
libpdbg: Abstract thread status
There is currently no abstraction of thread status between library and
application. It just passes the hardware specific values down. There is
also no interface exported in the library headers to read status.
This makes it difficult to implement more advanced functionality in the
application as there is no way hardware agnostic way to determine if a
thread is in powersave mode or not for example.
Instead introduce a hardware agnostic thread state so that we can implement
more advanced functionality such as automatically stopping threads if
required.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'src/htm.c')
-rw-r--r-- | src/htm.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -338,9 +338,10 @@ int run_htm(int optind, int argc, char *argv[]) if (pdbg_target_status(target) == PDBG_TARGET_NONEXISTENT) continue; - if ((!(thread_status(target) & THREAD_STATUS_ACTIVE)) || - (thread_status(target) & THREAD_STATUS_STOP)) { - fprintf(stderr, "It appears powersave is on 0x%" PRIx64 "%p\n", thread_status(target), target); + if ((!(thread_status(target).active)) || + (thread_status(target).sleep_state != PDBG_THREAD_STATE_RUN)) { + fprintf(stderr, "It appears powersave is on on %s@%d\n", + pdbg_target_name(target), pdbg_target_index(target)); fprintf(stderr, "core HTM needs to run with powersave off\n"); fprintf(stderr, "Hint: put powersave=off on the kernel commandline\n"); return 0; |