Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 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 | |
Paolo Bonzini | 14cccb6 | 2012-12-17 18:19:50 +0100 | [diff] [blame] | 14 | #include "qom/cpu.h" |
Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 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: |
Andreas Färber | 088383e | 2013-01-05 14:38:30 +0100 | [diff] [blame] | 28 | * @parent_realize: The parent class' realize handler. |
Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 29 | * |
| 30 | * A UniCore32 CPU model. |
| 31 | */ |
| 32 | typedef struct UniCore32CPUClass { |
| 33 | /*< private >*/ |
| 34 | CPUClass parent_class; |
| 35 | /*< public >*/ |
Andreas Färber | 088383e | 2013-01-05 14:38:30 +0100 | [diff] [blame] | 36 | |
| 37 | DeviceRealize parent_realize; |
Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 38 | } UniCore32CPUClass; |
| 39 | |
| 40 | /** |
| 41 | * UniCore32CPU: |
| 42 | * @env: #CPUUniCore32State |
| 43 | * |
| 44 | * A UniCore32 CPU. |
| 45 | */ |
| 46 | typedef struct UniCore32CPU { |
| 47 | /*< private >*/ |
| 48 | CPUState parent_obj; |
| 49 | /*< public >*/ |
| 50 | |
| 51 | CPUUniCore32State env; |
| 52 | } UniCore32CPU; |
| 53 | |
| 54 | static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env) |
| 55 | { |
Andreas Färber | 6e42be7 | 2013-05-10 16:34:06 +0200 | [diff] [blame] | 56 | return container_of(env, UniCore32CPU, env); |
Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | #define ENV_GET_CPU(e) CPU(uc32_env_get_cpu(e)) |
| 60 | |
Andreas Färber | fadf982 | 2013-02-22 18:10:01 +0000 | [diff] [blame] | 61 | #define ENV_OFFSET offsetof(UniCore32CPU, env) |
Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 62 | |
Andreas Färber | 97a8ea5 | 2013-02-02 10:57:51 +0100 | [diff] [blame] | 63 | void uc32_cpu_do_interrupt(CPUState *cpu); |
Richard Henderson | d8bb915 | 2014-09-13 09:45:24 -0700 | [diff] [blame] | 64 | bool uc32_cpu_exec_interrupt(CPUState *cpu, int int_req); |
Andreas Färber | 878096e | 2013-05-27 01:33:50 +0200 | [diff] [blame] | 65 | void uc32_cpu_dump_state(CPUState *cpu, FILE *f, |
| 66 | fprintf_function cpu_fprintf, int flags); |
Andreas Färber | 00b941e | 2013-06-29 18:55:54 +0200 | [diff] [blame] | 67 | hwaddr uc32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); |
Andreas Färber | 97a8ea5 | 2013-02-02 10:57:51 +0100 | [diff] [blame] | 68 | |
Andreas Färber | ae0f5e9 | 2012-02-14 01:16:17 +0100 | [diff] [blame] | 69 | #endif |