]>
Commit | Line | Data |
---|---|---|
ae0f5e9e AF |
1 | /* |
2 | * QEMU UniCore32 CPU | |
3 | * | |
4 | * Copyright (c) 2012 SUSE LINUX Products GmbH | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation, or (at your option) any | |
9 | * later version. See the COPYING file in the top-level directory. | |
10 | */ | |
11 | #ifndef QEMU_UC32_CPU_QOM_H | |
12 | #define QEMU_UC32_CPU_QOM_H | |
13 | ||
14 | #include "qemu/cpu.h" | |
15 | #include "cpu.h" | |
16 | ||
17 | #define TYPE_UNICORE32_CPU "unicore32-cpu" | |
18 | ||
19 | #define UNICORE32_CPU_CLASS(klass) \ | |
20 | OBJECT_CLASS_CHECK(UniCore32CPUClass, (klass), TYPE_UNICORE32_CPU) | |
21 | #define UNICORE32_CPU(obj) \ | |
22 | OBJECT_CHECK(UniCore32CPU, (obj), TYPE_UNICORE32_CPU) | |
23 | #define UNICORE32_CPU_GET_CLASS(obj) \ | |
24 | OBJECT_GET_CLASS(UniCore32CPUClass, (obj), TYPE_UNICORE32_CPU) | |
25 | ||
26 | /** | |
27 | * UniCore32CPUClass: | |
28 | * | |
29 | * A UniCore32 CPU model. | |
30 | */ | |
31 | typedef struct UniCore32CPUClass { | |
32 | /*< private >*/ | |
33 | CPUClass parent_class; | |
34 | /*< public >*/ | |
35 | } UniCore32CPUClass; | |
36 | ||
37 | /** | |
38 | * UniCore32CPU: | |
39 | * @env: #CPUUniCore32State | |
40 | * | |
41 | * A UniCore32 CPU. | |
42 | */ | |
43 | typedef struct UniCore32CPU { | |
44 | /*< private >*/ | |
45 | CPUState parent_obj; | |
46 | /*< public >*/ | |
47 | ||
48 | CPUUniCore32State env; | |
49 | } UniCore32CPU; | |
50 | ||
51 | static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env) | |
52 | { | |
53 | return UNICORE32_CPU(container_of(env, UniCore32CPU, env)); | |
54 | } | |
55 | ||
56 | #define ENV_GET_CPU(e) CPU(uc32_env_get_cpu(e)) | |
57 | ||
58 | ||
59 | #endif |