qemu-patch-raspberry4/include/qemu/plugin-memory.h
Alex Bennée 2d93203998 plugins: fix-up handling of internal hostaddr for 32 bit
The compiler rightly complains when we build on 32 bit that casting
uint64_t into a void is a bad idea. We are really dealing with a host
pointer at this point so treat it as such. This does involve
a uintptr_t cast of the result of the TLB addend as we know that has
to point to the host memory.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210709143005.1554-28-alex.bennee@linaro.org>
2021-07-14 14:33:53 +01:00

41 lines
974 B
C

/*
* Plugin Memory API
*
* Copyright (c) 2019 Linaro Ltd
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef PLUGIN_MEMORY_H
#define PLUGIN_MEMORY_H
struct qemu_plugin_hwaddr {
bool is_io;
bool is_store;
union {
struct {
MemoryRegionSection *section;
hwaddr offset;
} io;
struct {
void *hostaddr;
} 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.
*/
bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx,
bool is_store, struct qemu_plugin_hwaddr *data);
#endif /* _PLUGIN_MEMORY_H_ */