target/hexagon: Add guest, system reg number state
Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
Brian Cain committed
Jun 22, 2026 at 15:28 UTC
d873cf46d46b2d4961a4776ea6caf6905205a0a8
2 files changed
+16
target/hexagon/cpu.c
+5
@@ -299,6 +299,11 @@ static void hexagon_cpu_reset_hold(Object *obj, ResetType type)
299
set_float_detect_tininess(float_tininess_before_rounding, &env->fp_status);
300
/* Default NaN value: sign bit set, all frac bits set */
301
set_float_default_nan_pattern(0b11111111, &env->fp_status);
302
+#ifndef CONFIG_USER_ONLY
303
+ memset(env->t_sreg, 0, sizeof(uint32_t) * NUM_SREGS);
304
+ memset(env->greg, 0, sizeof(uint32_t) * NUM_GREGS);
305
+ env->wait_next_pc = 0;
306
+#endif
307
env->cause_code = HEX_EVENT_NONE;
308
}
309
target/hexagon/cpu.h
+11
@@ -100,6 +100,17 @@ typedef struct CPUArchState {
100
target_ulong stack_start;
101
102
uint8_t slot_cancelled;
103
+
104
+#ifndef CONFIG_USER_ONLY
105
+ /* Some system registers are per thread and some are global. */
106
+ uint32_t t_sreg[NUM_SREGS];
107
+
108
+ uint32_t greg[NUM_GREGS];
109
+ uint32_t wait_next_pc;
110
+
111
+ /* This alias of CPUState.cpu_index is used by imported sources: */
112
+ uint32_t threadId;
113
+#endif
114
target_ulong new_value_usr;
115
116
MemLog mem_log_stores[STORES_MAX];