Fix a typo preventing GNUC builtins usage.
[qemu/mini2440/sniper_sniper_test.git] / target-cris / machine.c
blob3e152e9fbbaef90ba0ea6dd0b9dd168838a86c57
1 #include "hw/hw.h"
2 #include "hw/boards.h"
4 void register_machines(void)
6 qemu_register_machine(&bareetraxfs_machine);
9 void cpu_save(QEMUFile *f, void *opaque)
11 CPUCRISState *env = opaque;
12 int i;
13 int s;
14 int mmu;
16 for (i = 0; i < 16; i++)
17 qemu_put_be32(f, env->regs[i]);
18 for (i = 0; i < 16; i++)
19 qemu_put_be32(f, env->pregs[i]);
21 qemu_put_be32(f, env->pc);
22 qemu_put_be32(f, env->ksp);
24 qemu_put_be32(f, env->dslot);
25 qemu_put_be32(f, env->btaken);
26 qemu_put_be32(f, env->btarget);
28 qemu_put_be32(f, env->cc_op);
29 qemu_put_be32(f, env->cc_mask);
30 qemu_put_be32(f, env->cc_dest);
31 qemu_put_be32(f, env->cc_src);
32 qemu_put_be32(f, env->cc_result);
33 qemu_put_be32(f, env->cc_size);
34 qemu_put_be32(f, env->cc_x);
36 for (s = 0; s < 4; i++) {
37 for (i = 0; i < 16; i++)
38 qemu_put_be32(f, env->sregs[s][i]);
41 qemu_put_be32(f, env->mmu_rand_lfsr);
42 for (mmu = 0; mmu < 2; mmu++) {
43 for (s = 0; s < 4; i++) {
44 for (i = 0; i < 16; i++) {
45 qemu_put_be32(f, env->tlbsets[mmu][s][i].lo);
46 qemu_put_be32(f, env->tlbsets[mmu][s][i].hi);
52 int cpu_load(QEMUFile *f, void *opaque, int version_id)
54 CPUCRISState *env = opaque;
55 int i;
56 int s;
57 int mmu;
59 for (i = 0; i < 16; i++)
60 env->regs[i] = qemu_get_be32(f);
61 for (i = 0; i < 16; i++)
62 env->pregs[i] = qemu_get_be32(f);
64 env->pc = qemu_get_be32(f);
65 env->ksp = qemu_get_be32(f);
67 env->dslot = qemu_get_be32(f);
68 env->btaken = qemu_get_be32(f);
69 env->btarget = qemu_get_be32(f);
71 env->cc_op = qemu_get_be32(f);
72 env->cc_mask = qemu_get_be32(f);
73 env->cc_dest = qemu_get_be32(f);
74 env->cc_src = qemu_get_be32(f);
75 env->cc_result = qemu_get_be32(f);
76 env->cc_size = qemu_get_be32(f);
77 env->cc_x = qemu_get_be32(f);
79 for (s = 0; s < 4; i++) {
80 for (i = 0; i < 16; i++)
81 env->sregs[s][i] = qemu_get_be32(f);
84 env->mmu_rand_lfsr = qemu_get_be32(f);
85 for (mmu = 0; mmu < 2; mmu++) {
86 for (s = 0; s < 4; i++) {
87 for (i = 0; i < 16; i++) {
88 env->tlbsets[mmu][s][i].lo = qemu_get_be32(f);
89 env->tlbsets[mmu][s][i].hi = qemu_get_be32(f);
94 return 0;