Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / include / qemu / plugin-memory.h
blob6fd539022ac1bd16584307c35cc7871cb5919e5f
1 /*
2 * Plugin Memory API
4 * Copyright (c) 2019 Linaro Ltd
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #ifndef PLUGIN_MEMORY_H
10 #define PLUGIN_MEMORY_H
12 #include "exec/cpu-defs.h"
13 #include "exec/hwaddr.h"
15 struct qemu_plugin_hwaddr {
16 bool is_io;
17 bool is_store;
18 union {
19 struct {
20 MemoryRegionSection *section;
21 hwaddr offset;
22 } io;
23 struct {
24 void *hostaddr;
25 } ram;
26 } v;
29 /**
30 * tlb_plugin_lookup: query last TLB lookup
31 * @cpu: cpu environment
33 * This function can be used directly after a memory operation to
34 * query information about the access. It is used by the plugin
35 * infrastructure to expose more information about the address.
37 * It would only fail if not called from an instrumented memory access
38 * which would be an abuse of the API.
40 bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
41 bool is_store, struct qemu_plugin_hwaddr *data);
43 #endif /* PLUGIN_MEMORY_H */