Revision 24ebf5f3 cpu-exec.c

b/cpu-exec.c
210 210

  
211 211
int cpu_exec(CPUState *env1)
212 212
{
213
#define DECLARE_HOST_REGS 1
214
#include "hostregs_helper.h"
213
    host_reg_t saved_env_reg;
215 214
    int ret, interrupt_request;
216 215
    TranslationBlock *tb;
217 216
    uint8_t *tc_ptr;
......
222 221

  
223 222
    cpu_single_env = env1;
224 223

  
225
    /* first we save global registers */
226
#define SAVE_HOST_REGS 1
227
#include "hostregs_helper.h"
224
    /* the access to env below is actually saving the global register's
225
       value, so that files not including target-xyz/exec.h are free to
226
       use it.  */
227
    QEMU_BUILD_BUG_ON (sizeof (saved_env_reg) != sizeof (env));
228
    saved_env_reg = (host_reg_t) env;
229
    asm("");
228 230
    env = env1;
229 231

  
230 232
#if defined(TARGET_I386)
......
669 671
#endif
670 672

  
671 673
    /* restore global registers */
672
#include "hostregs_helper.h"
674
    asm("");
675
    env = (void *) saved_env_reg;
673 676

  
674 677
    /* fail safe : never use cpu_single_env outside cpu_exec() */
675 678
    cpu_single_env = NULL;

Also available in: Unified diff