]> git.proxmox.com Git - mirror_qemu.git/blame - include/qemu/plugin-memory.h
Clean up decorations and whitespace around header guards
[mirror_qemu.git] / include / qemu / plugin-memory.h
CommitLineData
235537fa
AB
1/*
2 * Plugin Memory API
3 *
4 * Copyright (c) 2019 Linaro Ltd
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
e52ee00d
AA
9#ifndef PLUGIN_MEMORY_H
10#define PLUGIN_MEMORY_H
235537fa
AB
11
12struct qemu_plugin_hwaddr {
13 bool is_io;
14 bool is_store;
15 union {
16 struct {
17 MemoryRegionSection *section;
18 hwaddr offset;
19 } io;
20 struct {
2d932039 21 void *hostaddr;
235537fa
AB
22 } ram;
23 } v;
24};
25
26/**
27 * tlb_plugin_lookup: query last TLB lookup
28 * @cpu: cpu environment
29 *
30 * This function can be used directly after a memory operation to
31 * query information about the access. It is used by the plugin
32 * infrastructure to expose more information about the address.
33 *
34 * It would only fail if not called from an instrumented memory access
35 * which would be an abuse of the API.
36 */
37bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
38 bool is_store, struct qemu_plugin_hwaddr *data);
39
ea9cea93 40#endif /* PLUGIN_MEMORY_H */