mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
cputlb: introduce get_page_addr_code_hostp
This will be used by plugins to get the host address of instructions. Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
8c01eb78c6
commit
4b2190dabd
2 changed files with 51 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "cpu.h"
|
||||
#include "exec/tb-context.h"
|
||||
#include "exec/cpu_ldst.h"
|
||||
#include "sysemu/cpus.h"
|
||||
|
||||
/* allow to see translation results - the slowdown should be negligible, so we leave it */
|
||||
|
@ -516,6 +517,26 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env,
|
|||
{
|
||||
return addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_page_addr_code_hostp() - user-mode version
|
||||
* @env: CPUArchState
|
||||
* @addr: guest virtual address of guest code
|
||||
*
|
||||
* Returns @addr.
|
||||
*
|
||||
* If @hostp is non-NULL, sets *@hostp to the host address where @addr's content
|
||||
* is kept.
|
||||
*/
|
||||
static inline tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env,
|
||||
target_ulong addr,
|
||||
void **hostp)
|
||||
{
|
||||
if (hostp) {
|
||||
*hostp = g2h(addr);
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
#else
|
||||
static inline void mmap_lock(void) {}
|
||||
static inline void mmap_unlock(void) {}
|
||||
|
@ -533,6 +554,23 @@ static inline void mmap_unlock(void) {}
|
|||
*/
|
||||
tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr);
|
||||
|
||||
/**
|
||||
* get_page_addr_code_hostp() - full-system version
|
||||
* @env: CPUArchState
|
||||
* @addr: guest virtual address of guest code
|
||||
*
|
||||
* See get_page_addr_code() (full-system version) for documentation on the
|
||||
* return value.
|
||||
*
|
||||
* Sets *@hostp (when @hostp is non-NULL) as follows.
|
||||
* If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp
|
||||
* to the host address where @addr's content is kept.
|
||||
*
|
||||
* Note: this function can trigger an exception.
|
||||
*/
|
||||
tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr,
|
||||
void **hostp);
|
||||
|
||||
void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
|
||||
void tlb_set_dirty(CPUState *cpu, target_ulong vaddr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue