static void x86_cpu_common_class_init(ObjectClass *oc, void *data)

{

    X86CPUClass *xcc = X86_CPU_CLASS(oc);

    CPUClass *cc = CPU_CLASS(oc);

    DeviceClass *dc = DEVICE_CLASS(oc);



    xcc->parent_realize = dc->realize;

    dc->realize = x86_cpu_realizefn;

    dc->bus_type = TYPE_ICC_BUS;

    dc->props = x86_cpu_properties;



    xcc->parent_reset = cc->reset;

    cc->reset = x86_cpu_reset;

    cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP;



    cc->class_by_name = x86_cpu_class_by_name;

    cc->parse_features = x86_cpu_parse_featurestr;

    cc->has_work = x86_cpu_has_work;

    cc->do_interrupt = x86_cpu_do_interrupt;

    cc->cpu_exec_interrupt = x86_cpu_exec_interrupt;

    cc->dump_state = x86_cpu_dump_state;

    cc->set_pc = x86_cpu_set_pc;

    cc->synchronize_from_tb = x86_cpu_synchronize_from_tb;

    cc->gdb_read_register = x86_cpu_gdb_read_register;

    cc->gdb_write_register = x86_cpu_gdb_write_register;

    cc->get_arch_id = x86_cpu_get_arch_id;

    cc->get_paging_enabled = x86_cpu_get_paging_enabled;

#ifdef CONFIG_USER_ONLY

    cc->handle_mmu_fault = x86_cpu_handle_mmu_fault;

#else

    cc->get_memory_mapping = x86_cpu_get_memory_mapping;

    cc->get_phys_page_debug = x86_cpu_get_phys_page_debug;

    cc->write_elf64_note = x86_cpu_write_elf64_note;

    cc->write_elf64_qemunote = x86_cpu_write_elf64_qemunote;

    cc->write_elf32_note = x86_cpu_write_elf32_note;

    cc->write_elf32_qemunote = x86_cpu_write_elf32_qemunote;

    cc->vmsd = &vmstate_x86_cpu;

#endif

    cc->gdb_num_core_regs = CPU_NB_REGS * 2 + 25;

#ifndef CONFIG_USER_ONLY

    cc->debug_excp_handler = breakpoint_handler;

#endif

    cc->cpu_exec_enter = x86_cpu_exec_enter;

    cc->cpu_exec_exit = x86_cpu_exec_exit;

}
