예제 #1
0
LM32CPU *cpu_lm32_init(const char *cpu_model)
{
    LM32CPU *cpu;
    CPULM32State *env;
    const LM32Def *def;
    static int tcg_initialized;

    def = cpu_lm32_find_by_name(cpu_model);
    if (!def) {
        return NULL;
    }

    cpu = LM32_CPU(object_new(TYPE_LM32_CPU));
    env = &cpu->env;

    env->features = def->features;
    env->num_bps = def->num_breakpoints;
    env->num_wps = def->num_watchpoints;
    env->cfg = cfg_by_def(def);

    qemu_init_vcpu(env);

    if (tcg_enabled() && !tcg_initialized) {
        tcg_initialized = 1;
        lm32_translate_init();
    }

    return cpu;
}
예제 #2
0
파일: helper.c 프로젝트: dsqmoore/qemu-1
CPUState *cpu_lm32_init(const char *cpu_model)
{
    CPUState *env;
    const LM32Def *def;
    static int tcg_initialized;

    def = cpu_lm32_find_by_name(cpu_model);
    if (!def) {
        return NULL;
    }

    env = qemu_mallocz(sizeof(CPUState));

    env->features = def->features;
    env->num_bps = def->num_breakpoints;
    env->num_wps = def->num_watchpoints;
    env->cfg = cfg_by_def(def);
    env->flags = 0;

    cpu_exec_init(env);
    cpu_reset(env);

    if (!tcg_initialized) {
        tcg_initialized = 1;
        lm32_translate_init();
    }

    return env;
}
예제 #3
0
파일: helper.c 프로젝트: agraf/qemu
LM32CPU *cpu_lm32_init(const char *cpu_model)
{
    LM32CPU *cpu;
    CPULM32State *env;
    const LM32Def *def;

    def = cpu_lm32_find_by_name(cpu_model);
    if (!def) {
        return NULL;
    }

    cpu = LM32_CPU(object_new(TYPE_LM32_CPU));
    env = &cpu->env;

    env->features = def->features;
    env->num_bps = def->num_breakpoints;
    env->num_wps = def->num_watchpoints;
    env->cfg = cfg_by_def(def);

    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

    return cpu;
}