X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fkeyboard.c;h=794e8b312a3790e222a8cec9de192098bf987385;hb=f7e83e5d2d00ba107ccda346da4660ab523471bb;hp=6d398782c6969b99938403bd99413edc8e0e755c;hpb=5d1bbcc86de011e3f0d115b6f10fd8645cdf855e;p=palacios.git diff --git a/palacios/src/devices/keyboard.c b/palacios/src/devices/keyboard.c index 6d39878..794e8b3 100644 --- a/palacios/src/devices/keyboard.c +++ b/palacios/src/devices/keyboard.c @@ -211,8 +211,8 @@ struct keyboard_internal { // Data for system uint8_t wrap; - int mouse_enabled; - int scancode_set; + uint8_t mouse_enabled; + uint8_t scancode_set; struct queue kbd_queue; struct queue mouse_queue; @@ -388,7 +388,7 @@ static int key_event_handler(struct v3_vm_info * vm, #ifdef V3_CONFIG_TELEMETRY else if (evt->scan_code == 0x41) { // F7 telemetry dump - v3_print_telemetry(vm); + v3_print_global_telemetry(vm); } #endif #ifdef V3_CONFIG_SYMMOD @@ -573,7 +573,7 @@ static int mouse_write_output(struct keyboard_internal * kbd, uint8_t data) { #if KEYBOARD_DEBUG_80H -static int keyboard_write_delay(ushort_t port, void * src, uint_t length, void * priv_data) { +static int keyboard_write_delay(struct guest_info *core, ushort_t port, void * src, uint_t length, void * priv_data) { if (length == 1) { PrintDebug("keyboard: write of 0x%x to 80h\n", *((uint8_t*)src)); @@ -1053,6 +1053,18 @@ static int keyboard_reset_device(struct keyboard_internal * kbd) { #ifdef V3_CONFIG_CHECKPOINT static int keyboard_save(struct v3_chkpt_ctx * ctx, void * private_data) { + struct keyboard_internal * kbd = (struct keyboard_internal *)private_data; + + v3_chkpt_save_8(ctx, "CMD_REG", &(kbd->cmd.val)); + v3_chkpt_save_8(ctx, "STATUS_REG", &(kbd->status.val)); + v3_chkpt_save_8(ctx, "STATE", &(kbd->state)); + v3_chkpt_save_8(ctx, "MOUSE_STATE", &(kbd->mouse_state)); + v3_chkpt_save_8(ctx, "OUTPUT", &(kbd->output_byte)); + v3_chkpt_save_8(ctx, "INPUT", &(kbd->input_byte)); + v3_chkpt_save_8(ctx, "SCANCODE_SET", &(kbd->scancode_set)); + v3_chkpt_save_8(ctx, "MOUSE_ENABLED", &(kbd->mouse_enabled)); + + return 0; } @@ -1060,6 +1072,17 @@ static int keyboard_save(struct v3_chkpt_ctx * ctx, void * private_data) { static int keyboard_load(struct v3_chkpt_ctx * ctx, void * private_data) { struct keyboard_internal * kbd = (struct keyboard_internal *)private_data; keyboard_reset_device(kbd); + + v3_chkpt_load_8(ctx, "CMD_REG", &(kbd->cmd.val)); + v3_chkpt_load_8(ctx, "STATUS_REG", &(kbd->status.val)); + v3_chkpt_load_8(ctx, "STATE", &(kbd->state)); + v3_chkpt_load_8(ctx, "MOUSE_STATE", &(kbd->mouse_state)); + v3_chkpt_load_8(ctx, "OUTPUT", &(kbd->output_byte)); + v3_chkpt_load_8(ctx, "INPUT", &(kbd->input_byte)); + v3_chkpt_load_8(ctx, "SCANCODE_SET", &(kbd->scancode_set)); + v3_chkpt_load_8(ctx, "MOUSE_ENABLED", &(kbd->mouse_enabled)); + + return 0; }