pc: make pc_init1() not refer ferr_irq directly.
[qemu/aliguori-queue.git] / target-cris / machine.c
blob8f9c0dd59f724fed3345964038f5625e9320cdc8
1 #include "hw/hw.h"
2 #include "hw/boards.h"
4 void cpu_save(QEMUFile *f, void *opaque)
6 CPUCRISState *env = opaque;
7 int i;
8 int s;
9 int mmu;
11 for (i = 0; i < 16; i++)
12 qemu_put_be32(f, env->regs[i]);
13 for (i = 0; i < 16; i++)
14 qemu_put_be32(f, env->pregs[i]);
16 qemu_put_be32(f, env->pc);
17 qemu_put_be32(f, env->ksp);
19 qemu_put_be32(f, env->dslot);
20 qemu_put_be32(f, env->btaken);
21 qemu_put_be32(f, env->btarget);
23 qemu_put_be32(f, env->cc_op);
24 qemu_put_be32(f, env->cc_mask);
25 qemu_put_be32(f, env->cc_dest);
26 qemu_put_be32(f, env->cc_src);
27 qemu_put_be32(f, env->cc_result);
28 qemu_put_be32(f, env->cc_size);
29 qemu_put_be32(f, env->cc_x);
31 for (s = 0; s < 4; s++) {
32 for (i = 0; i < 16; i++)
33 qemu_put_be32(f, env->sregs[s][i]);
36 qemu_put_be32(f, env->mmu_rand_lfsr);
37 for (mmu = 0; mmu < 2; mmu++) {
38 for (s = 0; s < 4; s++) {
39 for (i = 0; i < 16; i++) {
40 qemu_put_be32(f, env->tlbsets[mmu][s][i].lo);
41 qemu_put_be32(f, env->tlbsets[mmu][s][i].hi);
47 int cpu_load(QEMUFile *f, void *opaque, int version_id)
49 CPUCRISState *env = opaque;
50 int i;
51 int s;
52 int mmu;
54 for (i = 0; i < 16; i++)
55 env->regs[i] = qemu_get_be32(f);
56 for (i = 0; i < 16; i++)
57 env->pregs[i] = qemu_get_be32(f);
59 env->pc = qemu_get_be32(f);
60 env->ksp = qemu_get_be32(f);
62 env->dslot = qemu_get_be32(f);
63 env->btaken = qemu_get_be32(f);
64 env->btarget = qemu_get_be32(f);
66 env->cc_op = qemu_get_be32(f);
67 env->cc_mask = qemu_get_be32(f);
68 env->cc_dest = qemu_get_be32(f);
69 env->cc_src = qemu_get_be32(f);
70 env->cc_result = qemu_get_be32(f);
71 env->cc_size = qemu_get_be32(f);
72 env->cc_x = qemu_get_be32(f);
74 for (s = 0; s < 4; s++) {
75 for (i = 0; i < 16; i++)
76 env->sregs[s][i] = qemu_get_be32(f);
79 env->mmu_rand_lfsr = qemu_get_be32(f);
80 for (mmu = 0; mmu < 2; mmu++) {
81 for (s = 0; s < 4; s++) {
82 for (i = 0; i < 16; i++) {
83 env->tlbsets[mmu][s][i].lo = qemu_get_be32(f);
84 env->tlbsets[mmu][s][i].hi = qemu_get_be32(f);
89 return 0;