2 * QEMU Motorola 68k CPU
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see
18 * <http://www.gnu.org/licenses/lgpl-2.1.html>
22 #include "qemu-common.h"
25 /* CPUClass::reset() */
26 static void m68k_cpu_reset(CPUState
*s
)
28 M68kCPU
*cpu
= M68K_CPU(s
);
29 M68kCPUClass
*mcc
= M68K_CPU_GET_CLASS(cpu
);
30 CPUM68KState
*env
= &cpu
->env
;
32 if (qemu_loglevel_mask(CPU_LOG_RESET
)) {
33 qemu_log("CPU Reset (CPU %d)\n", env
->cpu_index
);
34 log_cpu_state(env
, 0);
39 memset(env
, 0, offsetof(CPUM68KState
, breakpoints
));
40 #if !defined(CONFIG_USER_ONLY)
44 /* ??? FP regs should be initialized to NaN. */
45 env
->cc_op
= CC_OP_FLAGS
;
46 /* TODO: We should set PC from the interrupt vector. */
51 static void m68k_cpu_class_init(ObjectClass
*c
, void *data
)
53 M68kCPUClass
*mcc
= M68K_CPU_CLASS(c
);
54 CPUClass
*cc
= CPU_CLASS(c
);
56 mcc
->parent_reset
= cc
->reset
;
57 cc
->reset
= m68k_cpu_reset
;
60 static const TypeInfo m68k_cpu_type_info
= {
61 .name
= TYPE_M68K_CPU
,
63 .instance_size
= sizeof(M68kCPU
),
65 .class_size
= sizeof(M68kCPUClass
),
66 .class_init
= m68k_cpu_class_init
,
69 static void m68k_cpu_register_types(void)
71 type_register_static(&m68k_cpu_type_info
);
74 type_init(m68k_cpu_register_types
)