Paolo Bonzini | 1e00b8d | 2016-03-15 12:51:18 +0100 | [diff] [blame] | 1 | /* Declarations for use for CPU state serialization. */ |
Markus Armbruster | ec150c7 | 2019-08-12 07:23:31 +0200 | [diff] [blame] | 2 | |
Paolo Bonzini | 1e00b8d | 2016-03-15 12:51:18 +0100 | [diff] [blame] | 3 | #ifndef MIGRATION_CPU_H |
| 4 | #define MIGRATION_CPU_H |
| 5 | |
Markus Armbruster | ec150c7 | 2019-08-12 07:23:31 +0200 | [diff] [blame] | 6 | #include "exec/cpu-defs.h" |
Markus Armbruster | ca77ee2 | 2019-08-12 07:23:39 +0200 | [diff] [blame] | 7 | #include "migration/qemu-file-types.h" |
Markus Armbruster | d645427 | 2019-08-12 07:23:45 +0200 | [diff] [blame] | 8 | #include "migration/vmstate.h" |
Markus Armbruster | ec150c7 | 2019-08-12 07:23:31 +0200 | [diff] [blame] | 9 | |
Paolo Bonzini | 1e00b8d | 2016-03-15 12:51:18 +0100 | [diff] [blame] | 10 | #if TARGET_LONG_BITS == 64 |
| 11 | #define qemu_put_betl qemu_put_be64 |
| 12 | #define qemu_get_betl qemu_get_be64 |
| 13 | #define qemu_put_betls qemu_put_be64s |
| 14 | #define qemu_get_betls qemu_get_be64s |
| 15 | #define qemu_put_sbetl qemu_put_sbe64 |
| 16 | #define qemu_get_sbetl qemu_get_sbe64 |
| 17 | #define qemu_put_sbetls qemu_put_sbe64s |
| 18 | #define qemu_get_sbetls qemu_get_sbe64s |
| 19 | |
| 20 | #define VMSTATE_UINTTL_V(_f, _s, _v) \ |
| 21 | VMSTATE_UINT64_V(_f, _s, _v) |
| 22 | #define VMSTATE_UINTTL_EQUAL_V(_f, _s, _v) \ |
| 23 | VMSTATE_UINT64_EQUAL_V(_f, _s, _v) |
| 24 | #define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \ |
| 25 | VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) |
Stafford Horne | 4597992 | 2017-04-16 06:05:58 +0900 | [diff] [blame] | 26 | #define VMSTATE_UINTTL_2DARRAY_V(_f, _s, _n1, _n2, _v) \ |
| 27 | VMSTATE_UINT64_2DARRAY_V(_f, _s, _n1, _n2, _v) |
David Gibson | 3fed86e | 2016-11-21 10:50:02 +1100 | [diff] [blame] | 28 | #define VMSTATE_UINTTL_TEST(_f, _s, _t) \ |
| 29 | VMSTATE_UINT64_TEST(_f, _s, _t) |
Paolo Bonzini | 1e00b8d | 2016-03-15 12:51:18 +0100 | [diff] [blame] | 30 | #define vmstate_info_uinttl vmstate_info_uint64 |
| 31 | #else |
| 32 | #define qemu_put_betl qemu_put_be32 |
| 33 | #define qemu_get_betl qemu_get_be32 |
| 34 | #define qemu_put_betls qemu_put_be32s |
| 35 | #define qemu_get_betls qemu_get_be32s |
| 36 | #define qemu_put_sbetl qemu_put_sbe32 |
| 37 | #define qemu_get_sbetl qemu_get_sbe32 |
| 38 | #define qemu_put_sbetls qemu_put_sbe32s |
| 39 | #define qemu_get_sbetls qemu_get_sbe32s |
| 40 | |
| 41 | #define VMSTATE_UINTTL_V(_f, _s, _v) \ |
| 42 | VMSTATE_UINT32_V(_f, _s, _v) |
| 43 | #define VMSTATE_UINTTL_EQUAL_V(_f, _s, _v) \ |
| 44 | VMSTATE_UINT32_EQUAL_V(_f, _s, _v) |
| 45 | #define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \ |
| 46 | VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) |
Stafford Horne | 4597992 | 2017-04-16 06:05:58 +0900 | [diff] [blame] | 47 | #define VMSTATE_UINTTL_2DARRAY_V(_f, _s, _n1, _n2, _v) \ |
| 48 | VMSTATE_UINT32_2DARRAY_V(_f, _s, _n1, _n2, _v) |
David Gibson | 3fed86e | 2016-11-21 10:50:02 +1100 | [diff] [blame] | 49 | #define VMSTATE_UINTTL_TEST(_f, _s, _t) \ |
| 50 | VMSTATE_UINT32_TEST(_f, _s, _t) |
Paolo Bonzini | 1e00b8d | 2016-03-15 12:51:18 +0100 | [diff] [blame] | 51 | #define vmstate_info_uinttl vmstate_info_uint32 |
| 52 | #endif |
| 53 | |
| 54 | #define VMSTATE_UINTTL(_f, _s) \ |
| 55 | VMSTATE_UINTTL_V(_f, _s, 0) |
| 56 | #define VMSTATE_UINTTL_EQUAL(_f, _s) \ |
| 57 | VMSTATE_UINTTL_EQUAL_V(_f, _s, 0) |
| 58 | #define VMSTATE_UINTTL_ARRAY(_f, _s, _n) \ |
| 59 | VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0) |
Stafford Horne | 4597992 | 2017-04-16 06:05:58 +0900 | [diff] [blame] | 60 | #define VMSTATE_UINTTL_2DARRAY(_f, _s, _n1, _n2) \ |
| 61 | VMSTATE_UINTTL_2DARRAY_V(_f, _s, _n1, _n2, 0) |
| 62 | |
Paolo Bonzini | 1e00b8d | 2016-03-15 12:51:18 +0100 | [diff] [blame] | 63 | |
| 64 | #endif |