diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-09-05 16:03:56 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-09-05 16:03:56 +0100 |
commit | f102f224556f292f55b6e25147741bb8c48c9451 (patch) | |
tree | 2b6c86aad7324048cbcd472c3c5cf527d0767654 /exec.c | |
parent | 20dbe6504936adc01e03ed3367b93da2aa1758c1 (diff) | |
parent | c00c94abbdb82c39c22b6dd72875aa1ae0f4b2c0 (diff) | |
download | hqemu-f102f224556f292f55b6e25147741bb8c48c9451.zip hqemu-f102f224556f292f55b6e25147741bb8c48c9451.tar.gz |
Merge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-peter' into staging
QOM CPUState and X86CPU
* Include exception state in CPU VMState
* Fix -cpu *,migratable=foo
* Error out on unknown -cpu *,+foo,-bar
# gpg: Signature made Fri 05 Sep 2014 15:38:14 BST using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg: aka "Andreas Färber <afaerber@suse.com>"
* remotes/afaerber/tags/qom-cpu-for-peter:
target-i386: Reject invalid CPU feature names on the command-line
target-i386: Support migratable=no properly
exec: Save CPUState::exception_index field
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -430,15 +430,50 @@ static int cpu_common_post_load(void *opaque, int version_id) return 0; } +static int cpu_common_pre_load(void *opaque) +{ + CPUState *cpu = opaque; + + cpu->exception_index = 0; + + return 0; +} + +static bool cpu_common_exception_index_needed(void *opaque) +{ + CPUState *cpu = opaque; + + return cpu->exception_index != 0; +} + +static const VMStateDescription vmstate_cpu_common_exception_index = { + .name = "cpu_common/exception_index", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_INT32(exception_index, CPUState), + VMSTATE_END_OF_LIST() + } +}; + const VMStateDescription vmstate_cpu_common = { .name = "cpu_common", .version_id = 1, .minimum_version_id = 1, + .pre_load = cpu_common_pre_load, .post_load = cpu_common_post_load, .fields = (VMStateField[]) { VMSTATE_UINT32(halted, CPUState), VMSTATE_UINT32(interrupt_request, CPUState), VMSTATE_END_OF_LIST() + }, + .subsections = (VMStateSubsection[]) { + { + .vmsd = &vmstate_cpu_common_exception_index, + .needed = cpu_common_exception_index_needed, + } , { + /* empty */ + } } }; |