From: Brian Cain <[email protected]> {TLB,k0}lock counts are used to represent the TLB, k0 locks among hardware threads.
wait_next_pc represents the program counter to set when resuming from a wait-for-interrupts state. cause_code contains the precise exception cause.This will be used by subsequent commits. Reviewed-by: Taylor Simpson <[email protected]> Signed-off-by: Brian Cain <[email protected]> --- target/hexagon/cpu.h | 3 +++ target/hexagon/cpu.c | 4 ++++ target/hexagon/machine.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index e1c654dc93e..41865d853eb 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -130,11 +130,14 @@ typedef struct CPUArchState { target_ulong t_sreg[NUM_SREGS]; target_ulong greg[NUM_GREGS]; + target_ulong wait_next_pc; /* This alias of CPUState.cpu_index is used by imported sources: */ target_ulong threadId; hex_lock_state_t tlb_lock_state; hex_lock_state_t k0_lock_state; + target_ulong tlb_lock_count; + target_ulong k0_lock_count; #endif target_ulong next_PC; target_ulong new_value_usr; diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index a8904b651ac..7469d8a1966 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -317,7 +317,11 @@ static void hexagon_cpu_reset_hold(Object *obj, ResetType type) env->threadId = cs->cpu_index; env->tlb_lock_state = HEX_LOCK_UNLOCKED; env->k0_lock_state = HEX_LOCK_UNLOCKED; + env->tlb_lock_count = 0; + env->k0_lock_count = 0; env->next_PC = 0; + env->wait_next_pc = 0; + env->cause_code = HEX_EVENT_NONE; #endif env->cause_code = HEX_EVENT_NONE; } diff --git a/target/hexagon/machine.c b/target/hexagon/machine.c index e6e420b9899..78152184569 100644 --- a/target/hexagon/machine.c +++ b/target/hexagon/machine.c @@ -24,6 +24,8 @@ const VMStateDescription vmstate_hexagon_cpu = { VMSTATE_UINTTL(env.tlb_lock_count, HexagonCPU), VMSTATE_UINTTL(env.k0_lock_count, HexagonCPU), VMSTATE_UINTTL(env.threadId, HexagonCPU), + VMSTATE_UINTTL(env.cause_code, HexagonCPU), + VMSTATE_UINTTL(env.wait_next_pc, HexagonCPU), VMSTATE_END_OF_LIST() }, }; -- 2.34.1
