[MINI2440] Force the amount of memory
[qemu/mini2440/sniper_sniper_test.git] / target-cris / machine.c
blob2d3396d8b35882421c43e3ddae8ccdc7caa2e31b
1 #include "hw/hw.h"
2 #include "hw/boards.h"
4 void register_machines(void)
6 qemu_register_machine(&bareetraxfs_machine);
7 qemu_register_machine(&axisdev88_machine);
10 void cpu_save(QEMUFile *f, void *opaque)
12 CPUCRISState *env = opaque;
13 int i;
14 int s;
15 int mmu;
17 for (i = 0; i < 16; i++)
18 qemu_put_be32(f, env->regs[i]);
19 for (i = 0; i < 16; i++)
20 qemu_put_be32(f, env->pregs[i]);
22 qemu_put_be32(f, env->pc);
23 qemu_put_be32(f, env->ksp);
25 qemu_put_be32(f, env->dslot);
26 qemu_put_be32(f, env->btaken);
27 qemu_put_be32(f, env->btarget);
29 qemu_put_be32(f, env->cc_op);
30 qemu_put_be32(f, env->cc_mask);
31 qemu_put_be32(f, env->cc_dest);
32 qemu_put_be32(f, env->cc_src);
33 qemu_put_be32(f, env->cc_result);
34 qemu_put_be32(f, env->cc_size);
35 qemu_put_be32(f, env->cc_x);
37 for (s = 0; s < 4; s++) {
38 for (i = 0; i < 16; i++)
39 qemu_put_be32(f, env->sregs[s][i]);
42 qemu_put_be32(f, env->mmu_rand_lfsr);
43 for (mmu = 0; mmu < 2; mmu++) {
44 for (s = 0; s < 4; s++) {
45 for (i = 0; i < 16; i++) {
46 qemu_put_be32(f, env->tlbsets[mmu][s][i].lo);
47 qemu_put_be32(f, env->tlbsets[mmu][s][i].hi);
53 int cpu_load(QEMUFile *f, void *opaque, int version_id)
55 CPUCRISState *env = opaque;
56 int i;
57 int s;
58 int mmu;
60 for (i = 0; i < 16; i++)
61 env->regs[i] = qemu_get_be32(f);
62 for (i = 0; i < 16; i++)
63 env->pregs[i] = qemu_get_be32(f);
65 env->pc = qemu_get_be32(f);
66 env->ksp = qemu_get_be32(f);
68 env->dslot = qemu_get_be32(f);
69 env->btaken = qemu_get_be32(f);
70 env->btarget = qemu_get_be32(f);
72 env->cc_op = qemu_get_be32(f);
73 env->cc_mask = qemu_get_be32(f);
74 env->cc_dest = qemu_get_be32(f);
75 env->cc_src = qemu_get_be32(f);
76 env->cc_result = qemu_get_be32(f);
77 env->cc_size = qemu_get_be32(f);
78 env->cc_x = qemu_get_be32(f);
80 for (s = 0; s < 4; s++) {
81 for (i = 0; i < 16; i++)
82 env->sregs[s][i] = qemu_get_be32(f);
85 env->mmu_rand_lfsr = qemu_get_be32(f);
86 for (mmu = 0; mmu < 2; mmu++) {
87 for (s = 0; s < 4; s++) {
88 for (i = 0; i < 16; i++) {
89 env->tlbsets[mmu][s][i].lo = qemu_get_be32(f);
90 env->tlbsets[mmu][s][i].hi = qemu_get_be32(f);
95 return 0;