New feature: registers can be bulk saved/restored in an opaque blob

This commit is contained in:
Andrew Dutcher
2016-08-20 04:14:07 -07:00
parent 236b6e9085
commit 0ef2b5fd71
14 changed files with 94 additions and 0 deletions

View File

@ -19,4 +19,7 @@ void arm_uc_init(struct uc_struct* uc);
__attribute__ ((visibility ("default")))
void arm64_uc_init(struct uc_struct* uc);
extern const int ARM_REGS_STORAGE_SIZE;
extern const int ARM64_REGS_STORAGE_SIZE;
#endif

View File

@ -10,6 +10,8 @@
#include "uc_priv.h"
const int ARM64_REGS_STORAGE_SIZE = offsetof(CPUARMState, tlb_table);
static void arm64_set_pc(struct uc_struct *uc, uint64_t address)
{
((CPUARMState *)uc->current_cpu->env_ptr)->pc = address;

View File

@ -10,6 +10,8 @@
#include "uc_priv.h"
const int ARM_REGS_STORAGE_SIZE = offsetof(CPUARMState, tlb_table);
static void arm_set_pc(struct uc_struct *uc, uint64_t address)
{
((CPUARMState *)uc->current_cpu->env_ptr)->pc = address;

View File

@ -12,6 +12,8 @@
#include "uc_priv.h"
const int X86_REGS_STORAGE_SIZE = offsetof(CPUX86State, tlb_table);
static void x86_set_pc(struct uc_struct *uc, uint64_t address)
{
((CPUX86State *)uc->current_cpu->env_ptr)->eip = address;

View File

@ -12,4 +12,6 @@ void x86_reg_reset(struct uc_struct *uc);
void x86_uc_init(struct uc_struct* uc);
int x86_uc_machine_init(struct uc_struct *uc);
extern const int X86_REGS_STORAGE_SIZE;
#endif

View File

@ -10,6 +10,8 @@
#include "uc_priv.h"
const int M68K_REGS_STORAGE_SIZE = offsetof(CPUM68KState, tlb_table);
static void m68k_set_pc(struct uc_struct *uc, uint64_t address)
{
((CPUM68KState *)uc->current_cpu->env_ptr)->pc = address;

View File

@ -12,4 +12,5 @@ void m68k_reg_reset(struct uc_struct *uc);
void m68k_uc_init(struct uc_struct* uc);
extern const int M68K_REGS_STORAGE_SIZE;
#endif

View File

@ -9,6 +9,14 @@
#include "unicorn_common.h"
#include "uc_priv.h"
// prevent the lines from being compiled twice
#ifdef TARGET_WORDS_BIGENDIAN
#ifdef TARGET_MIPS64
const int MIPS64_REGS_STORAGE_SIZE = offsetof(CPUMIPSState, tlb_table);
#else // MIPS32
const int MIPS_REGS_STORAGE_SIZE = offsetof(CPUMIPSState, tlb_table);
#endif
#endif
static uint64_t mips_mem_redirect(uint64_t address)
{

View File

@ -15,4 +15,7 @@ void mipsel_uc_init(struct uc_struct* uc);
void mips64_uc_init(struct uc_struct* uc);
void mips64el_uc_init(struct uc_struct* uc);
extern const int MIPS_REGS_STORAGE_SIZE;
extern const int MIPS64_REGS_STORAGE_SIZE;
#endif

View File

@ -10,6 +10,8 @@
#include "uc_priv.h"
const int SPARC_REGS_STORAGE_SIZE = offsetof(CPUSPARCState, tlb_table);
static bool sparc_stop_interrupt(int intno)
{
switch(intno) {

View File

@ -13,4 +13,7 @@ void sparc_reg_reset(struct uc_struct *uc);
void sparc_uc_init(struct uc_struct* uc);
void sparc64_uc_init(struct uc_struct* uc);
extern const int SPARC_REGS_STORAGE_SIZE;
extern const int SPARC64_REGS_STORAGE_SIZE;
#endif

View File

@ -10,6 +10,8 @@
#include "uc_priv.h"
const int SPARC64_REGS_STORAGE_SIZE = offsetof(CPUSPARCState, tlb_table);
static bool sparc_stop_interrupt(int intno)
{
switch(intno) {