Statistics
| Branch: | Revision:

root / target-cris / machine.c @ 877d8ad7

History | View | Annotate | Download (2.3 kB)

1 8dd3dca3 aurel32
#include "hw/hw.h"
2 8dd3dca3 aurel32
#include "hw/boards.h"
3 8dd3dca3 aurel32
4 8dd3dca3 aurel32
void register_machines(void)
5 8dd3dca3 aurel32
{
6 8dd3dca3 aurel32
    qemu_register_machine(&bareetraxfs_machine);
7 8dd3dca3 aurel32
}
8 877d8ad7 edgar_igl
9 877d8ad7 edgar_igl
void cpu_save(QEMUFile *f, void *opaque)
10 877d8ad7 edgar_igl
{
11 877d8ad7 edgar_igl
    CPUCRISState *env = opaque;
12 877d8ad7 edgar_igl
    int i;
13 877d8ad7 edgar_igl
    int s;
14 877d8ad7 edgar_igl
    int mmu;
15 877d8ad7 edgar_igl
16 877d8ad7 edgar_igl
    for (i = 0; i < 16; i++)
17 877d8ad7 edgar_igl
        qemu_put_be32(f, env->regs[i]);
18 877d8ad7 edgar_igl
    for (i = 0; i < 16; i++)
19 877d8ad7 edgar_igl
        qemu_put_be32(f, env->pregs[i]);
20 877d8ad7 edgar_igl
21 877d8ad7 edgar_igl
    qemu_put_be32(f, env->pc);
22 877d8ad7 edgar_igl
    qemu_put_be32(f, env->ksp);
23 877d8ad7 edgar_igl
24 877d8ad7 edgar_igl
    qemu_put_be32(f, env->dslot);
25 877d8ad7 edgar_igl
    qemu_put_be32(f, env->btaken);
26 877d8ad7 edgar_igl
    qemu_put_be32(f, env->btarget);
27 877d8ad7 edgar_igl
28 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_op);
29 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_mask);
30 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_dest);
31 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_src);
32 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_result);
33 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_size);
34 877d8ad7 edgar_igl
    qemu_put_be32(f, env->cc_x);
35 877d8ad7 edgar_igl
36 877d8ad7 edgar_igl
    for (s = 0; s < 4; i++) {
37 877d8ad7 edgar_igl
        for (i = 0; i < 16; i++)
38 877d8ad7 edgar_igl
            qemu_put_be32(f, env->sregs[s][i]);
39 877d8ad7 edgar_igl
    }
40 877d8ad7 edgar_igl
41 877d8ad7 edgar_igl
    qemu_put_be32(f, env->mmu_rand_lfsr);
42 877d8ad7 edgar_igl
    for (mmu = 0; mmu < 2; mmu++) {
43 877d8ad7 edgar_igl
        for (s = 0; s < 4; i++) {
44 877d8ad7 edgar_igl
            for (i = 0; i < 16; i++) {
45 877d8ad7 edgar_igl
                qemu_put_be32(f, env->tlbsets[mmu][s][i].lo);
46 877d8ad7 edgar_igl
                qemu_put_be32(f, env->tlbsets[mmu][s][i].hi);
47 877d8ad7 edgar_igl
            }
48 877d8ad7 edgar_igl
        }
49 877d8ad7 edgar_igl
    }
50 877d8ad7 edgar_igl
}
51 877d8ad7 edgar_igl
52 877d8ad7 edgar_igl
int cpu_load(QEMUFile *f, void *opaque, int version_id)
53 877d8ad7 edgar_igl
{
54 877d8ad7 edgar_igl
        CPUCRISState *env = opaque;
55 877d8ad7 edgar_igl
    int i;
56 877d8ad7 edgar_igl
    int s;
57 877d8ad7 edgar_igl
    int mmu;
58 877d8ad7 edgar_igl
59 877d8ad7 edgar_igl
    for (i = 0; i < 16; i++)
60 877d8ad7 edgar_igl
        env->regs[i] = qemu_get_be32(f);
61 877d8ad7 edgar_igl
    for (i = 0; i < 16; i++)
62 877d8ad7 edgar_igl
        env->pregs[i] = qemu_get_be32(f);
63 877d8ad7 edgar_igl
64 877d8ad7 edgar_igl
    env->pc = qemu_get_be32(f);
65 877d8ad7 edgar_igl
    env->ksp = qemu_get_be32(f);
66 877d8ad7 edgar_igl
67 877d8ad7 edgar_igl
    env->dslot = qemu_get_be32(f);
68 877d8ad7 edgar_igl
    env->btaken = qemu_get_be32(f);
69 877d8ad7 edgar_igl
    env->btarget = qemu_get_be32(f);
70 877d8ad7 edgar_igl
71 877d8ad7 edgar_igl
    env->cc_op = qemu_get_be32(f);
72 877d8ad7 edgar_igl
    env->cc_mask = qemu_get_be32(f);
73 877d8ad7 edgar_igl
    env->cc_dest = qemu_get_be32(f);
74 877d8ad7 edgar_igl
    env->cc_src = qemu_get_be32(f);
75 877d8ad7 edgar_igl
    env->cc_result = qemu_get_be32(f);
76 877d8ad7 edgar_igl
    env->cc_size = qemu_get_be32(f);
77 877d8ad7 edgar_igl
    env->cc_x = qemu_get_be32(f);
78 877d8ad7 edgar_igl
79 877d8ad7 edgar_igl
    for (s = 0; s < 4; i++) {
80 877d8ad7 edgar_igl
        for (i = 0; i < 16; i++)
81 877d8ad7 edgar_igl
            env->sregs[s][i] = qemu_get_be32(f);
82 877d8ad7 edgar_igl
    }
83 877d8ad7 edgar_igl
84 877d8ad7 edgar_igl
    env->mmu_rand_lfsr = qemu_get_be32(f);
85 877d8ad7 edgar_igl
    for (mmu = 0; mmu < 2; mmu++) {
86 877d8ad7 edgar_igl
        for (s = 0; s < 4; i++) {
87 877d8ad7 edgar_igl
            for (i = 0; i < 16; i++) {
88 877d8ad7 edgar_igl
                env->tlbsets[mmu][s][i].lo = qemu_get_be32(f);
89 877d8ad7 edgar_igl
                env->tlbsets[mmu][s][i].hi = qemu_get_be32(f);
90 877d8ad7 edgar_igl
            }
91 877d8ad7 edgar_igl
        }
92 877d8ad7 edgar_igl
    }
93 877d8ad7 edgar_igl
94 877d8ad7 edgar_igl
    return 0;
95 877d8ad7 edgar_igl
}