[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 05/11] target/alpha: call plugin trap callbacks
From: |
Julian Ganz |
Subject: |
[RFC PATCH v3 05/11] target/alpha: call plugin trap callbacks |
Date: |
Mon, 2 Dec 2024 20:26:46 +0100 |
We recently introduced API for registering callbacks for trap related
events as well as the corresponding hook functions. Due to differences
between architectures, the latter need to be called from target specific
code.
This change places hooks for Alpha targets.
---
target/alpha/helper.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 2f1000c99f..acc92402af 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -25,6 +25,7 @@
#include "fpu/softfloat-types.h"
#include "exec/helper-proto.h"
#include "qemu/qemu-print.h"
+#include "qemu/plugin.h"
#define CONVERT_BIT(X, SRC, DST) \
@@ -326,6 +327,7 @@ void alpha_cpu_do_interrupt(CPUState *cs)
{
CPUAlphaState *env = cpu_env(cs);
int i = cs->exception_index;
+ uint64_t last_pc = env->pc;
if (qemu_loglevel_mask(CPU_LOG_INT)) {
static int count;
@@ -429,6 +431,16 @@ void alpha_cpu_do_interrupt(CPUState *cs)
/* Switch to PALmode. */
env->flags |= ENV_FLAG_PAL_MODE;
+
+ switch (i) {
+ case EXCP_SMP_INTERRUPT:
+ case EXCP_CLK_INTERRUPT:
+ case EXCP_DEV_INTERRUPT:
+ qemu_plugin_vcpu_interrupt_cb(cs, last_pc, env->pc);
+ break;
+ qemu_plugin_vcpu_exception_cb(cs, last_pc, env->pc);
+ default:
+ }
}
bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
--
2.45.2
- Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, (continued)
Re: [RFC PATCH v3 01/11] plugins: add types for callbacks related to certain discontinuities, Pierrick Bouvier, 2024/12/04
[RFC PATCH v3 06/11] target/arm: call plugin trap callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 03/11] plugins: add hooks for new discontinuity related callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 05/11] target/alpha: call plugin trap callbacks,
Julian Ganz <=
[RFC PATCH v3 02/11] plugins: add API for registering discontinuity callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 07/11] target/avr: call plugin trap callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 08/11] target/mips: call plugin trap callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 09/11] target/riscv: call plugin trap callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 10/11] target/sparc: call plugin trap callbacks, Julian Ganz, 2024/12/02
[RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc, Julian Ganz, 2024/12/02