4 * Copyright (c) 2009 Ulrich Hecht
5 * Copyright (c) 2011 Alexander Graf
6 * Copyright (c) 2012 SUSE LINUX Products GmbH
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, see
20 * <http://www.gnu.org/licenses/lgpl-2.1.html>
24 #include "qemu-common.h"
25 #include "qemu-timer.h"
28 /* CPUClass::reset() */
29 static void s390_cpu_reset(CPUState
*s
)
31 S390CPU
*cpu
= S390_CPU(s
);
32 S390CPUClass
*scc
= S390_CPU_GET_CLASS(cpu
);
33 CPUS390XState
*env
= &cpu
->env
;
35 if (qemu_loglevel_mask(CPU_LOG_RESET
)) {
36 qemu_log("CPU Reset (CPU %d)\n", env
->cpu_index
);
37 log_cpu_state(env
, 0);
42 memset(env
, 0, offsetof(CPUS390XState
, breakpoints
));
43 /* FIXME: reset vector? */
45 s390_add_running_cpu(env
);
48 static void s390_cpu_class_init(ObjectClass
*oc
, void *data
)
50 S390CPUClass
*scc
= S390_CPU_CLASS(oc
);
51 CPUClass
*cc
= CPU_CLASS(scc
);
53 scc
->parent_reset
= cc
->reset
;
54 cc
->reset
= s390_cpu_reset
;
57 static const TypeInfo s390_cpu_type_info
= {
58 .name
= TYPE_S390_CPU
,
60 .instance_size
= sizeof(S390CPU
),
62 .class_size
= sizeof(S390CPUClass
),
63 .class_init
= s390_cpu_class_init
,
66 static void s390_cpu_register_types(void)
68 type_register_static(&s390_cpu_type_info
);
71 type_init(s390_cpu_register_types
)