Support flushing translation blocks and flush when we don't need count hook

This commit is contained in:
2022-04-26 00:45:49 +02:00
parent fbf4078d65
commit 4e22744679
4 changed files with 27 additions and 2 deletions

View File

@@ -530,7 +530,10 @@ typedef enum uc_control_type {
UC_CTL_TB_REQUEST_CACHE,
// Invalidate a tb cache at a specific address
// Write: @args = (uint64_t, uint64_t)
UC_CTL_TB_REMOVE_CACHE
UC_CTL_TB_REMOVE_CACHE,
// Invalidate all translation blocks.
// No arguments.
UC_CTL_TB_FLUSH
} uc_control_type;
@@ -605,7 +608,7 @@ See sample_ctl.c for a detailed example.
uc_ctl(uc, UC_CTL_WRITE(UC_CTL_TB_REMOVE_CACHE, 2), (address), (end))
#define uc_ctl_request_cache(uc, address, tb) \
uc_ctl(uc, UC_CTL_READ_WRITE(UC_CTL_TB_REQUEST_CACHE, 2), (address), (tb))
#define uc_ctl_flush_tlb(uc) uc_ctl(uc, UC_CTL_WRITE(UC_CTL_TB_FLUSH, 0))
// Opaque storage for CPU context, used with uc_context_*()
struct uc_context;
typedef struct uc_context uc_context;