Revision a2247f8e linux-user/elfload.c

b/linux-user/elfload.c
125 125
static const char *get_elf_platform(void)
126 126
{
127 127
    static char elf_platform[] = "i386";
128
    int family = (thread_env->cpuid_version >> 8) & 0xff;
128
    int family = object_property_get_int(OBJECT(thread_cpu), "family", NULL);
129 129
    if (family > 6)
130 130
        family = 6;
131 131
    if (family >= 3)
......
137 137

  
138 138
static uint32_t get_elf_hwcap(void)
139 139
{
140
    return thread_env->features[FEAT_1_EDX];
140
    X86CPU *cpu = X86_CPU(thread_cpu);
141

  
142
    return cpu->env.features[FEAT_1_EDX];
141 143
}
142 144

  
143 145
#ifdef TARGET_X86_64
......
404 406

  
405 407
static uint32_t get_elf_hwcap(void)
406 408
{
407
    CPUARMState *e = thread_env;
409
    ARMCPU *cpu = ARM_CPU(thread_cpu);
408 410
    uint32_t hwcaps = 0;
409 411

  
410 412
    hwcaps |= ARM_HWCAP_ARM_SWP;
......
415 417

  
416 418
    /* probe for the extra features */
417 419
#define GET_FEATURE(feat, hwcap) \
418
    do {if (arm_feature(e, feat)) { hwcaps |= hwcap; } } while (0)
420
    do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0)
419 421
    GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP);
420 422
    GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT);
421 423
    GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE);
......
619 621

  
620 622
static uint32_t get_elf_hwcap(void)
621 623
{
622
    CPUPPCState *e = thread_env;
624
    PowerPCCPU *cpu = POWERPC_CPU(thread_cpu);
623 625
    uint32_t features = 0;
624 626

  
625 627
    /* We don't have to be terribly complete here; the high points are
626 628
       Altivec/FP/SPE support.  Anything else is just a bonus.  */
627 629
#define GET_FEATURE(flag, feature)                                      \
628
    do {if (e->insns_flags & flag) features |= feature; } while(0)
630
    do { if (cpu->env.insns_flags & flag) { features |= feature; } } while (0)
629 631
    GET_FEATURE(PPC_64B, QEMU_PPC_FEATURE_64);
630 632
    GET_FEATURE(PPC_FLOAT, QEMU_PPC_FEATURE_HAS_FPU);
631 633
    GET_FEATURE(PPC_ALTIVEC, QEMU_PPC_FEATURE_HAS_ALTIVEC);
......
2667 2669
    /* read and fill status of all threads */
2668 2670
    cpu_list_lock();
2669 2671
    for (cpu = first_cpu; cpu != NULL; cpu = cpu->next_cpu) {
2670
        if (cpu == ENV_GET_CPU(thread_env)) {
2672
        if (cpu == thread_cpu) {
2671 2673
            continue;
2672 2674
        }
2673 2675
        fill_thread_info(info, (CPUArchState *)cpu->env_ptr);

Also available in: Unified diff