xref: /openbmc/qemu/target/sh4/cpu-qom.h (revision fcf5ef2a)
1*fcf5ef2aSThomas Huth /*
2*fcf5ef2aSThomas Huth  * QEMU SuperH CPU
3*fcf5ef2aSThomas Huth  *
4*fcf5ef2aSThomas Huth  * Copyright (c) 2012 SUSE LINUX Products GmbH
5*fcf5ef2aSThomas Huth  *
6*fcf5ef2aSThomas Huth  * This library is free software; you can redistribute it and/or
7*fcf5ef2aSThomas Huth  * modify it under the terms of the GNU Lesser General Public
8*fcf5ef2aSThomas Huth  * License as published by the Free Software Foundation; either
9*fcf5ef2aSThomas Huth  * version 2.1 of the License, or (at your option) any later version.
10*fcf5ef2aSThomas Huth  *
11*fcf5ef2aSThomas Huth  * This library is distributed in the hope that it will be useful,
12*fcf5ef2aSThomas Huth  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*fcf5ef2aSThomas Huth  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14*fcf5ef2aSThomas Huth  * Lesser General Public License for more details.
15*fcf5ef2aSThomas Huth  *
16*fcf5ef2aSThomas Huth  * You should have received a copy of the GNU Lesser General Public
17*fcf5ef2aSThomas Huth  * License along with this library; if not, see
18*fcf5ef2aSThomas Huth  * <http://www.gnu.org/licenses/lgpl-2.1.html>
19*fcf5ef2aSThomas Huth  */
20*fcf5ef2aSThomas Huth #ifndef QEMU_SUPERH_CPU_QOM_H
21*fcf5ef2aSThomas Huth #define QEMU_SUPERH_CPU_QOM_H
22*fcf5ef2aSThomas Huth 
23*fcf5ef2aSThomas Huth #include "qom/cpu.h"
24*fcf5ef2aSThomas Huth 
25*fcf5ef2aSThomas Huth #define TYPE_SUPERH_CPU "superh-cpu"
26*fcf5ef2aSThomas Huth 
27*fcf5ef2aSThomas Huth #define TYPE_SH7750R_CPU "sh7750r-" TYPE_SUPERH_CPU
28*fcf5ef2aSThomas Huth #define TYPE_SH7751R_CPU "sh7751r-" TYPE_SUPERH_CPU
29*fcf5ef2aSThomas Huth #define TYPE_SH7785_CPU "sh7785-" TYPE_SUPERH_CPU
30*fcf5ef2aSThomas Huth 
31*fcf5ef2aSThomas Huth #define SUPERH_CPU_CLASS(klass) \
32*fcf5ef2aSThomas Huth     OBJECT_CLASS_CHECK(SuperHCPUClass, (klass), TYPE_SUPERH_CPU)
33*fcf5ef2aSThomas Huth #define SUPERH_CPU(obj) \
34*fcf5ef2aSThomas Huth     OBJECT_CHECK(SuperHCPU, (obj), TYPE_SUPERH_CPU)
35*fcf5ef2aSThomas Huth #define SUPERH_CPU_GET_CLASS(obj) \
36*fcf5ef2aSThomas Huth     OBJECT_GET_CLASS(SuperHCPUClass, (obj), TYPE_SUPERH_CPU)
37*fcf5ef2aSThomas Huth 
38*fcf5ef2aSThomas Huth /**
39*fcf5ef2aSThomas Huth  * SuperHCPUClass:
40*fcf5ef2aSThomas Huth  * @parent_realize: The parent class' realize handler.
41*fcf5ef2aSThomas Huth  * @parent_reset: The parent class' reset handler.
42*fcf5ef2aSThomas Huth  * @name: The name.
43*fcf5ef2aSThomas Huth  * @pvr: Processor Version Register
44*fcf5ef2aSThomas Huth  * @prr: Processor Revision Register
45*fcf5ef2aSThomas Huth  * @cvr: Cache Version Register
46*fcf5ef2aSThomas Huth  *
47*fcf5ef2aSThomas Huth  * A SuperH CPU model.
48*fcf5ef2aSThomas Huth  */
49*fcf5ef2aSThomas Huth typedef struct SuperHCPUClass {
50*fcf5ef2aSThomas Huth     /*< private >*/
51*fcf5ef2aSThomas Huth     CPUClass parent_class;
52*fcf5ef2aSThomas Huth     /*< public >*/
53*fcf5ef2aSThomas Huth 
54*fcf5ef2aSThomas Huth     DeviceRealize parent_realize;
55*fcf5ef2aSThomas Huth     void (*parent_reset)(CPUState *cpu);
56*fcf5ef2aSThomas Huth 
57*fcf5ef2aSThomas Huth     const char *name;
58*fcf5ef2aSThomas Huth     uint32_t pvr;
59*fcf5ef2aSThomas Huth     uint32_t prr;
60*fcf5ef2aSThomas Huth     uint32_t cvr;
61*fcf5ef2aSThomas Huth } SuperHCPUClass;
62*fcf5ef2aSThomas Huth 
63*fcf5ef2aSThomas Huth typedef struct SuperHCPU SuperHCPU;
64*fcf5ef2aSThomas Huth 
65*fcf5ef2aSThomas Huth #endif
66