X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fio_apic.c;h=0817e9beaa811071fb7d1023f4672ecd04525fa9;hb=357fde035281e8fac28241b2f8c32d12ee3d63fb;hp=b9375a81e2baa2ae3ffa3360357ebc3d41b7e845;hpb=a34051536e91aa7ef3ca7123fc2342771bd34391;p=palacios.git diff --git a/palacios/src/devices/io_apic.c b/palacios/src/devices/io_apic.c index b9375a8..0817e9b 100644 --- a/palacios/src/devices/io_apic.c +++ b/palacios/src/devices/io_apic.c @@ -23,7 +23,7 @@ #include #include -#ifndef CONFIG_DEBUG_IO_APIC +#ifndef V3_CONFIG_DEBUG_IO_APIC #undef PrintDebug #define PrintDebug(fmt, args...) #endif @@ -325,10 +325,42 @@ static int io_apic_free(struct io_apic_state * ioapic) { return 0; } +#ifdef V3_CONFIG_CHECKPOINT +static int io_apic_save(struct v3_chkpt_ctx * ctx, void * private_data) { + struct io_apic_state * io_apic = (struct io_apic_state *)private_data; + + V3_CHKPT_STD_SAVE(ctx, io_apic->base_addr); + V3_CHKPT_STD_SAVE(ctx, io_apic->index_reg); + V3_CHKPT_STD_SAVE(ctx, io_apic->ioapic_id); + V3_CHKPT_STD_SAVE(ctx, io_apic->ioapic_ver); + V3_CHKPT_STD_SAVE(ctx, io_apic->ioapic_arb_id); + V3_CHKPT_STD_SAVE(ctx, io_apic->redir_tbl); + + return 0; +} + +static int io_apic_load(struct v3_chkpt_ctx * ctx, void * private_data) { + struct io_apic_state * io_apic = (struct io_apic_state *)private_data; + + V3_CHKPT_STD_LOAD(ctx, io_apic->base_addr); + V3_CHKPT_STD_LOAD(ctx, io_apic->index_reg); + V3_CHKPT_STD_LOAD(ctx, io_apic->ioapic_id); + V3_CHKPT_STD_LOAD(ctx, io_apic->ioapic_ver); + V3_CHKPT_STD_LOAD(ctx, io_apic->ioapic_arb_id); + V3_CHKPT_STD_LOAD(ctx, io_apic->redir_tbl); + + return 0; +} +#endif + + static struct v3_device_ops dev_ops = { .free = (int (*)(void *))io_apic_free, - +#ifdef V3_CONFIG_CHECKPOINT + .save = io_apic_save, + .load = io_apic_load +#endif };