usb-ehci: fix ehci_child_detach
[qemu/wangdongxu.git] / target-arm / cpu.c
blobc3ed45b0bc465b3278aae255060f9917419b5c70
1 /*
2 * QEMU ARM CPU
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see
18 * <http://www.gnu.org/licenses/gpl-2.0.html>
21 #include "cpu-qom.h"
22 #include "qemu-common.h"
24 /* CPUClass::reset() */
25 static void arm_cpu_reset(CPUState *s)
27 ARMCPU *cpu = ARM_CPU(s);
28 ARMCPUClass *acc = ARM_CPU_GET_CLASS(cpu);
30 acc->parent_reset(s);
32 /* TODO Inline the current contents of cpu_state_reset(),
33 once cpu_reset_model_id() is eliminated. */
34 cpu_state_reset(&cpu->env);
37 static void arm_cpu_class_init(ObjectClass *oc, void *data)
39 ARMCPUClass *acc = ARM_CPU_CLASS(oc);
40 CPUClass *cc = CPU_CLASS(acc);
42 acc->parent_reset = cc->reset;
43 cc->reset = arm_cpu_reset;
46 static const TypeInfo arm_cpu_type_info = {
47 .name = TYPE_ARM_CPU,
48 .parent = TYPE_CPU,
49 .instance_size = sizeof(ARMCPU),
50 .abstract = false,
51 .class_size = sizeof(ARMCPUClass),
52 .class_init = arm_cpu_class_init,
55 static void arm_cpu_register_types(void)
57 type_register_static(&arm_cpu_type_info);
60 type_init(arm_cpu_register_types)