]> git.proxmox.com Git - mirror_qemu.git/blame - target-alpha/machine.c
qcow2: Inform block layer about discard boundaries
[mirror_qemu.git] / target-alpha / machine.c
CommitLineData
e2e5e114 1#include "qemu/osdep.h"
33c11879
PB
2#include "qemu-common.h"
3#include "cpu.h"
b758aca1
RH
4#include "hw/hw.h"
5#include "hw/boards.h"
1e00b8d5 6#include "migration/cpu.h"
b758aca1
RH
7
8static int get_fpcr(QEMUFile *f, void *opaque, size_t size)
9{
10 CPUAlphaState *env = opaque;
11 cpu_alpha_store_fpcr(env, qemu_get_be64(f));
12 return 0;
13}
14
15static void put_fpcr(QEMUFile *f, void *opaque, size_t size)
16{
17 CPUAlphaState *env = opaque;
18 qemu_put_be64(f, cpu_alpha_load_fpcr(env));
19}
20
21static const VMStateInfo vmstate_fpcr = {
22 .name = "fpcr",
23 .get = get_fpcr,
24 .put = put_fpcr,
25};
26
fe31e737 27static VMStateField vmstate_env_fields[] = {
4d5712f1
AF
28 VMSTATE_UINTTL_ARRAY(ir, CPUAlphaState, 31),
29 VMSTATE_UINTTL_ARRAY(fir, CPUAlphaState, 31),
b758aca1
RH
30 /* Save the architecture value of the fpcr, not the internally
31 expanded version. Since this architecture value does not
32 exist in memory to be stored, this requires a but of hoop
33 jumping. We want OFFSET=0 so that we effectively pass ENV
34 to the helper functions, and we need to fill in the name by
35 hand since there's no field of that name. */
36 {
37 .name = "fpcr",
38 .version_id = 0,
39 .size = sizeof(uint64_t),
40 .info = &vmstate_fpcr,
41 .flags = VMS_SINGLE,
42 .offset = 0
43 },
4d5712f1
AF
44 VMSTATE_UINTTL(pc, CPUAlphaState),
45 VMSTATE_UINTTL(unique, CPUAlphaState),
46 VMSTATE_UINTTL(lock_addr, CPUAlphaState),
47 VMSTATE_UINTTL(lock_value, CPUAlphaState),
b758aca1
RH
48 /* Note that lock_st_addr is not saved; it is a temporary
49 used during the execution of the st[lq]_c insns. */
50
4d5712f1
AF
51 VMSTATE_UINT8(ps, CPUAlphaState),
52 VMSTATE_UINT8(intr_flag, CPUAlphaState),
53 VMSTATE_UINT8(pal_mode, CPUAlphaState),
54 VMSTATE_UINT8(fen, CPUAlphaState),
26b46094 55
4d5712f1 56 VMSTATE_UINT32(pcc_ofs, CPUAlphaState),
b758aca1 57
4d5712f1
AF
58 VMSTATE_UINTTL(trap_arg0, CPUAlphaState),
59 VMSTATE_UINTTL(trap_arg1, CPUAlphaState),
60 VMSTATE_UINTTL(trap_arg2, CPUAlphaState),
b758aca1 61
4d5712f1
AF
62 VMSTATE_UINTTL(exc_addr, CPUAlphaState),
63 VMSTATE_UINTTL(palbr, CPUAlphaState),
64 VMSTATE_UINTTL(ptbr, CPUAlphaState),
65 VMSTATE_UINTTL(vptptr, CPUAlphaState),
66 VMSTATE_UINTTL(sysval, CPUAlphaState),
67 VMSTATE_UINTTL(usp, CPUAlphaState),
26b46094 68
4d5712f1
AF
69 VMSTATE_UINTTL_ARRAY(shadow, CPUAlphaState, 8),
70 VMSTATE_UINTTL_ARRAY(scratch, CPUAlphaState, 24),
26b46094 71
b758aca1
RH
72 VMSTATE_END_OF_LIST()
73};
74
fe31e737
AF
75static const VMStateDescription vmstate_env = {
76 .name = "env",
59124384
RH
77 .version_id = 2,
78 .minimum_version_id = 2,
fe31e737 79 .fields = vmstate_env_fields,
b758aca1
RH
80};
81
fe31e737
AF
82static VMStateField vmstate_cpu_fields[] = {
83 VMSTATE_CPU(),
84 VMSTATE_STRUCT(env, AlphaCPU, 1, vmstate_env, CPUAlphaState),
85 VMSTATE_END_OF_LIST()
86};
b758aca1 87
fe31e737
AF
88const VMStateDescription vmstate_alpha_cpu = {
89 .name = "cpu",
90 .version_id = 1,
91 .minimum_version_id = 1,
fe31e737
AF
92 .fields = vmstate_cpu_fields,
93};