diff options
author | Aaron Lindsay | 2018-04-26 12:04:39 +0200 |
---|---|---|
committer | Peter Maydell | 2018-04-26 12:04:39 +0200 |
commit | 08267487c99e8150382420936ab72c1e0ad74ce3 (patch) | |
tree | 92ff492c7951003e73f853727e659bf176c3995d /target/arm/cpu.h | |
parent | target/arm: Fetch GICv3 state directly from CPUARMState (diff) | |
download | qemu-08267487c99e8150382420936ab72c1e0ad74ce3.tar.gz qemu-08267487c99e8150382420936ab72c1e0ad74ce3.tar.xz qemu-08267487c99e8150382420936ab72c1e0ad74ce3.zip |
target/arm: Support multiple EL change hooks
Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org>
Message-id: 1523997485-1905-7-git-send-email-alindsay@codeaurora.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/cpu.h')
-rw-r--r-- | target/arm/cpu.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 6bd8ff5917..b3def5afad 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -632,12 +632,17 @@ typedef struct CPUARMState { } CPUARMState; /** - * ARMELChangeHook: + * ARMELChangeHookFn: * type of a function which can be registered via arm_register_el_change_hook() * to get callbacks when the CPU changes its exception level or mode. */ -typedef void ARMELChangeHook(ARMCPU *cpu, void *opaque); - +typedef void ARMELChangeHookFn(ARMCPU *cpu, void *opaque); +typedef struct ARMELChangeHook ARMELChangeHook; +struct ARMELChangeHook { + ARMELChangeHookFn *hook; + void *opaque; + QLIST_ENTRY(ARMELChangeHook) node; +}; /* These values map onto the return values for * QEMU_PSCI_0_2_FN_AFFINITY_INFO */ @@ -826,8 +831,7 @@ struct ARMCPU { */ bool cfgend; - ARMELChangeHook *el_change_hook; - void *el_change_hook_opaque; + QLIST_HEAD(, ARMELChangeHook) el_change_hooks; int32_t node_id; /* NUMA node this CPU belongs to */ @@ -2894,12 +2898,8 @@ static inline AddressSpace *arm_addressspace(CPUState *cs, MemTxAttrs attrs) * CPU changes exception level or mode. The hook function will be * passed a pointer to the ARMCPU and the opaque data pointer passed * to this function when the hook was registered. - * - * Note that we currently only support registering a single hook function, - * and will assert if this function is called twice. - * This facility is intended for the use of the GICv3 emulation. */ -void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHook *hook, +void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void *opaque); /** |