Statistics
| Branch: | Revision:

root / target-cris / cpu-qom.h @ 327ed10f

History | View | Annotate | Download (2.3 kB)

1 e739a48e Andreas Färber
/*
2 e739a48e Andreas Färber
 * QEMU CRIS CPU
3 e739a48e Andreas Färber
 *
4 e739a48e Andreas Färber
 * Copyright (c) 2012 SUSE LINUX Products GmbH
5 e739a48e Andreas Färber
 *
6 e739a48e Andreas Färber
 * This library is free software; you can redistribute it and/or
7 e739a48e Andreas Färber
 * modify it under the terms of the GNU Lesser General Public
8 e739a48e Andreas Färber
 * License as published by the Free Software Foundation; either
9 e739a48e Andreas Färber
 * version 2.1 of the License, or (at your option) any later version.
10 e739a48e Andreas Färber
 *
11 e739a48e Andreas Färber
 * This library is distributed in the hope that it will be useful,
12 e739a48e Andreas Färber
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 e739a48e Andreas Färber
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 e739a48e Andreas Färber
 * Lesser General Public License for more details.
15 e739a48e Andreas Färber
 *
16 e739a48e Andreas Färber
 * You should have received a copy of the GNU Lesser General Public
17 e739a48e Andreas Färber
 * License along with this library; if not, see
18 e739a48e Andreas Färber
 * <http://www.gnu.org/licenses/lgpl-2.1.html>
19 e739a48e Andreas Färber
 */
20 e739a48e Andreas Färber
#ifndef QEMU_CRIS_CPU_QOM_H
21 e739a48e Andreas Färber
#define QEMU_CRIS_CPU_QOM_H
22 e739a48e Andreas Färber
23 14cccb61 Paolo Bonzini
#include "qom/cpu.h"
24 e739a48e Andreas Färber
25 e739a48e Andreas Färber
#define TYPE_CRIS_CPU "cris-cpu"
26 e739a48e Andreas Färber
27 e739a48e Andreas Färber
#define CRIS_CPU_CLASS(klass) \
28 e739a48e Andreas Färber
    OBJECT_CLASS_CHECK(CRISCPUClass, (klass), TYPE_CRIS_CPU)
29 e739a48e Andreas Färber
#define CRIS_CPU(obj) \
30 e739a48e Andreas Färber
    OBJECT_CHECK(CRISCPU, (obj), TYPE_CRIS_CPU)
31 e739a48e Andreas Färber
#define CRIS_CPU_GET_CLASS(obj) \
32 e739a48e Andreas Färber
    OBJECT_GET_CLASS(CRISCPUClass, (obj), TYPE_CRIS_CPU)
33 e739a48e Andreas Färber
34 e739a48e Andreas Färber
/**
35 e739a48e Andreas Färber
 * CRISCPUClass:
36 ca45f8b0 Andreas Färber
 * @parent_realize: The parent class' realize handler.
37 e739a48e Andreas Färber
 * @parent_reset: The parent class' reset handler.
38 6ae064fc Andreas Färber
 * @vr: Version Register value.
39 e739a48e Andreas Färber
 *
40 e739a48e Andreas Färber
 * A CRIS CPU model.
41 e739a48e Andreas Färber
 */
42 e739a48e Andreas Färber
typedef struct CRISCPUClass {
43 e739a48e Andreas Färber
    /*< private >*/
44 e739a48e Andreas Färber
    CPUClass parent_class;
45 e739a48e Andreas Färber
    /*< public >*/
46 e739a48e Andreas Färber
47 ca45f8b0 Andreas Färber
    DeviceRealize parent_realize;
48 e739a48e Andreas Färber
    void (*parent_reset)(CPUState *cpu);
49 6ae064fc Andreas Färber
50 6ae064fc Andreas Färber
    uint32_t vr;
51 e739a48e Andreas Färber
} CRISCPUClass;
52 e739a48e Andreas Färber
53 e739a48e Andreas Färber
/**
54 e739a48e Andreas Färber
 * CRISCPU:
55 e739a48e Andreas Färber
 * @env: #CPUCRISState
56 e739a48e Andreas Färber
 *
57 e739a48e Andreas Färber
 * A CRIS CPU.
58 e739a48e Andreas Färber
 */
59 e739a48e Andreas Färber
typedef struct CRISCPU {
60 e739a48e Andreas Färber
    /*< private >*/
61 e739a48e Andreas Färber
    CPUState parent_obj;
62 e739a48e Andreas Färber
    /*< public >*/
63 e739a48e Andreas Färber
64 e739a48e Andreas Färber
    CPUCRISState env;
65 e739a48e Andreas Färber
} CRISCPU;
66 e739a48e Andreas Färber
67 e739a48e Andreas Färber
static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
68 e739a48e Andreas Färber
{
69 6e42be7c Andreas Färber
    return container_of(env, CRISCPU, env);
70 e739a48e Andreas Färber
}
71 e739a48e Andreas Färber
72 e739a48e Andreas Färber
#define ENV_GET_CPU(e) CPU(cris_env_get_cpu(e))
73 e739a48e Andreas Färber
74 fadf9825 Andreas Färber
#define ENV_OFFSET offsetof(CRISCPU, env)
75 e739a48e Andreas Färber
76 97a8ea5a Andreas Färber
void cris_cpu_do_interrupt(CPUState *cpu);
77 b21bfeea Andreas Färber
void crisv10_cpu_do_interrupt(CPUState *cpu);
78 97a8ea5a Andreas Färber
79 878096ee Andreas Färber
void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
80 878096ee Andreas Färber
                         int flags);
81 878096ee Andreas Färber
82 00b941e5 Andreas Färber
hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
83 00b941e5 Andreas Färber
84 90431220 Andreas Färber
int crisv10_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
85 5b50e790 Andreas Färber
int cris_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
86 5b50e790 Andreas Färber
int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
87 5b50e790 Andreas Färber
88 e739a48e Andreas Färber
#endif