static int vapic_enable(VAPICROMState *s, CPUX86State *env)

{

    int cpu_number = get_kpcr_number(env);

    target_phys_addr_t vapic_paddr;

    static const uint8_t enabled = 1;



    if (cpu_number < 0) {

        return -1;

    }

    vapic_paddr = s->vapic_paddr +

        (((target_phys_addr_t)cpu_number) << VAPIC_CPU_SHIFT);

    cpu_physical_memory_rw(vapic_paddr + offsetof(VAPICState, enabled),

                           (void *)&enabled, sizeof(enabled), 1);

    apic_enable_vapic(env->apic_state, vapic_paddr);



    s->state = VAPIC_ACTIVE;



    return 0;

}

static int vapic_enable(VAPICROMState *s, CPUX86State *env)

{

    int cpu_number = get_kpcr_number(env);

    target_phys_addr_t vapic_paddr;

    static const uint8_t enabled = 1;



    if (cpu_number < 0) {

        return -1;

    }

    vapic_paddr = s->vapic_paddr +

        (((target_phys_addr_t)cpu_number) << VAPIC_CPU_SHIFT);

    cpu_physical_memory_rw(vapic_paddr + offsetof(VAPICState, enabled),

                           (void *)&enabled, sizeof(enabled), 1);

    apic_enable_vapic(env->apic_state, vapic_paddr);



    s->state = VAPIC_ACTIVE;



    return 0;

}

static int FUNC_0(VAPICROMState *VAR_0, CPUX86State *VAR_1)

{

    int VAR_2 = get_kpcr_number(VAR_1);

    target_phys_addr_t vapic_paddr;

    static const uint8_t VAR_3 = 1;



    if (VAR_2 < 0) {

        return -1;

    }

    vapic_paddr = VAR_0->vapic_paddr +

        (((target_phys_addr_t)VAR_2) << VAPIC_CPU_SHIFT);

    cpu_physical_memory_rw(vapic_paddr + offsetof(VAPICState, VAR_3),

                           (void *)&VAR_3, sizeof(VAR_3), 1);

    apic_enable_vapic(VAR_1->apic_state, vapic_paddr);



    VAR_0->state = VAPIC_ACTIVE;



    return 0;

}

static int FUNC_0(VAPICROMState *VAR_0, CPUX86State *VAR_1)
{ int VAR_2 = get_kpcr_number(VAR_1); target_phys_addr_t vapic_paddr; static const uint8_t VAR_3 = 1; if (VAR_2 < 0) { return -1; } vapic_paddr = VAR_0->vapic_paddr +
(((target_phys_addr_t)VAR_2) << VAPIC_CPU_SHIFT); cpu_physical_memory_rw(vapic_paddr + offsetof(VAPICState, VAR_3),
(void *)&VAR_3, sizeof(VAR_3), 1); apic_enable_vapic(VAR_1->apic_state, vapic_paddr); VAR_0->state = VAPIC_ACTIVE; return 0; }