Statistics
| Branch: | Revision:

root / target-openrisc / machine.c @ 478032a9

History | View | Annotate | Download (1.6 kB)

1 e67db06e Jia Liu
/*
2 e67db06e Jia Liu
 * OpenRISC Machine
3 e67db06e Jia Liu
 *
4 e67db06e Jia Liu
 * Copyright (c) 2011-2012 Jia Liu <proljc@gmail.com>
5 e67db06e Jia Liu
 *
6 e67db06e Jia Liu
 * This library is free software; you can redistribute it and/or
7 e67db06e Jia Liu
 * modify it under the terms of the GNU Lesser General Public
8 e67db06e Jia Liu
 * License as published by the Free Software Foundation; either
9 e67db06e Jia Liu
 * version 2 of the License, or (at your option) any later version.
10 e67db06e Jia Liu
 *
11 e67db06e Jia Liu
 * This library is distributed in the hope that it will be useful,
12 e67db06e Jia Liu
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 e67db06e Jia Liu
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 e67db06e Jia Liu
 * Lesser General Public License for more details.
15 e67db06e Jia Liu
 *
16 e67db06e Jia Liu
 * You should have received a copy of the GNU Lesser General Public
17 e67db06e Jia Liu
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 e67db06e Jia Liu
 */
19 e67db06e Jia Liu
20 e67db06e Jia Liu
#include "hw/hw.h"
21 e67db06e Jia Liu
#include "hw/boards.h"
22 e67db06e Jia Liu
23 e67db06e Jia Liu
static const VMStateDescription vmstate_cpu = {
24 e67db06e Jia Liu
    .name = "cpu",
25 e67db06e Jia Liu
    .fields = (VMStateField[]) {
26 e67db06e Jia Liu
        VMSTATE_UINT32_ARRAY(gpr, CPUOpenRISCState, 32),
27 e67db06e Jia Liu
        VMSTATE_UINT32(sr, CPUOpenRISCState),
28 e67db06e Jia Liu
        VMSTATE_UINT32(epcr, CPUOpenRISCState),
29 e67db06e Jia Liu
        VMSTATE_UINT32(eear, CPUOpenRISCState),
30 e67db06e Jia Liu
        VMSTATE_UINT32(esr, CPUOpenRISCState),
31 e67db06e Jia Liu
        VMSTATE_UINT32(fpcsr, CPUOpenRISCState),
32 e67db06e Jia Liu
        VMSTATE_UINT32(pc, CPUOpenRISCState),
33 e67db06e Jia Liu
        VMSTATE_UINT32(npc, CPUOpenRISCState),
34 e67db06e Jia Liu
        VMSTATE_UINT32(ppc, CPUOpenRISCState),
35 e67db06e Jia Liu
        VMSTATE_END_OF_LIST()
36 e67db06e Jia Liu
    }
37 e67db06e Jia Liu
};
38 e67db06e Jia Liu
39 e67db06e Jia Liu
void cpu_save(QEMUFile *f, void *opaque)
40 e67db06e Jia Liu
{
41 e67db06e Jia Liu
    vmstate_save_state(f, &vmstate_cpu, opaque);
42 e67db06e Jia Liu
}
43 e67db06e Jia Liu
44 e67db06e Jia Liu
int cpu_load(QEMUFile *f, void *opaque, int version_id)
45 e67db06e Jia Liu
{
46 e67db06e Jia Liu
    return vmstate_load_state(f, &vmstate_cpu, opaque, version_id);
47 e67db06e Jia Liu
}