On 3/12/2025 12:32 PM, [email protected] wrote:

-----Original Message-----
From: Brian Cain <[email protected]>
Sent: Friday, February 28, 2025 11:26 PM
To: [email protected]
Cc: [email protected]; [email protected];
[email protected]; [email protected]; [email protected]; [email protected];
[email protected]; [email protected];
[email protected]; [email protected];
[email protected]; Brian Cain <[email protected]>; Michael Lambert
<[email protected]>
Subject: [PATCH 38/38] target/hexagon: Add hex_interrupts support

From: Brian Cain <[email protected]>

Co-authored-by: Taylor Simpson <[email protected]>
Co-authored-by: Sid Manning <[email protected]>
Co-authored-by: Michael Lambert <[email protected]>
Signed-off-by: Brian Cain <[email protected]>

diff --git a/target/hexagon/hex_interrupts.c
b/target/hexagon/hex_interrupts.c new file mode 100644 index
0000000000..fd00bcfb9a

+bool hex_check_interrupts(CPUHexagonState *env) {
+    CPUState *cs = env_cpu(env);
+    bool int_handled = false;
+    bool ssr_ex = get_ssr_ex(env);
+    int max_ints = 32;
+    bool schedcfgen;
+
+    /* Early exit if nothing pending */
+    if (get_ipend(env) == 0) {
+        restore_state(env, false);
+        return false;
+    }
+
+    BQL_LOCK_GUARD();
+    /* Only check priorities when schedcfgen is set */
+    schedcfgen = get_schedcfgen(env);
+    for (int i = 0; i < max_ints; i++) {
+        if (!get_iad_bit(env, i) && get_ipend_bit(env, i)) {
+            qemu_log_mask(CPU_LOG_INT,
+                          "%s: thread[%d] pc = 0x%x found int %d\n", __func__,
+                          env->threadId, env->gpr[HEX_REG_PC], i);
Don't use %d - use PRI* instead.  Several instances ...

I believe I have mitigated all of these in v2.


Reply via email to