2019-06-19 21:20:08 +02:00
|
|
|
/*
|
|
|
|
* Plugin Memory API
|
|
|
|
*
|
|
|
|
* Copyright (c) 2019 Linaro Ltd
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
2021-06-05 19:49:38 +02:00
|
|
|
#ifndef PLUGIN_MEMORY_H
|
|
|
|
#define PLUGIN_MEMORY_H
|
2019-06-19 21:20:08 +02:00
|
|
|
|
2022-12-22 13:08:11 +01:00
|
|
|
#include "exec/cpu-defs.h"
|
|
|
|
#include "exec/hwaddr.h"
|
|
|
|
|
2019-06-19 21:20:08 +02:00
|
|
|
struct qemu_plugin_hwaddr {
|
|
|
|
bool is_io;
|
|
|
|
bool is_store;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
MemoryRegionSection *section;
|
|
|
|
hwaddr offset;
|
|
|
|
} io;
|
|
|
|
struct {
|
2021-07-09 16:29:52 +02:00
|
|
|
void *hostaddr;
|
2019-06-19 21:20:08 +02:00
|
|
|
} ram;
|
|
|
|
} v;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* tlb_plugin_lookup: query last TLB lookup
|
|
|
|
* @cpu: cpu environment
|
|
|
|
*
|
|
|
|
* This function can be used directly after a memory operation to
|
|
|
|
* query information about the access. It is used by the plugin
|
|
|
|
* infrastructure to expose more information about the address.
|
|
|
|
*
|
|
|
|
* It would only fail if not called from an instrumented memory access
|
|
|
|
* which would be an abuse of the API.
|
|
|
|
*/
|
2023-06-21 15:56:22 +02:00
|
|
|
bool tlb_plugin_lookup(CPUState *cpu, vaddr addr, int mmu_idx,
|
2019-06-19 21:20:08 +02:00
|
|
|
bool is_store, struct qemu_plugin_hwaddr *data);
|
|
|
|
|
2022-05-06 15:49:11 +02:00
|
|
|
#endif /* PLUGIN_MEMORY_H */
|