Changeset 49882 in vbox
- Timestamp:
- Dec 12, 2013 11:01:59 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r49469 r49882 46 46 *******************************************************************************/ 47 47 #define LOG_GROUP LOG_GROUP_DEV_KBD 48 #include "vl_vbox.h"49 48 #include <VBox/vmm/pdmdev.h> 50 49 #include <iprt/assert.h> … … 1075 1074 } 1076 1075 1077 static void kbd_save( QEMUFile* f, void* opaque)1076 static void kbd_save(PSSMHANDLE pSSM, KBDState *s) 1078 1077 { 1079 1078 #ifndef VBOX_WITH_NEW_PS2M … … 1081 1080 int i; 1082 1081 #endif 1083 KBDState *s = (KBDState*)opaque; 1084 1085 qemu_put_8s(f, &s->write_cmd); 1086 qemu_put_8s(f, &s->status); 1087 qemu_put_8s(f, &s->mode); 1088 qemu_put_8s(f, &s->dbbout); 1082 1083 SSMR3PutU8(pSSM, s->write_cmd); 1084 SSMR3PutU8(pSSM, s->status); 1085 SSMR3PutU8(pSSM, s->mode); 1086 SSMR3PutU8(pSSM, s->dbbout); 1089 1087 #ifndef VBOX_WITH_NEW_PS2M 1090 qemu_put_be32s(f, &s->mouse_write_cmd);1091 qemu_put_8s(f, &s->mouse_status);1092 qemu_put_8s(f, &s->mouse_resolution);1093 qemu_put_8s(f, &s->mouse_sample_rate);1094 qemu_put_8s(f, &s->mouse_wrap);1095 qemu_put_8s(f, &s->mouse_type);1096 qemu_put_8s(f, &s->mouse_detect_state);1097 qemu_put_be32s(f, &s->mouse_dx);1098 qemu_put_be32s(f, &s->mouse_dy);1099 qemu_put_be32s(f, &s->mouse_dz);1100 qemu_put_be32s(f, &s->mouse_dw);1101 qemu_put_be32s(f, &s->mouse_flags);1102 qemu_put_8s(f, &s->mouse_buttons);1103 qemu_put_8s(f, &s->mouse_buttons_reported);1088 SSMR3PutU32(pSSM, s->mouse_write_cmd); 1089 SSMR3PutU8(pSSM, s->mouse_status); 1090 SSMR3PutU8(pSSM, s->mouse_resolution); 1091 SSMR3PutU8(pSSM, s->mouse_sample_rate); 1092 SSMR3PutU8(pSSM, s->mouse_wrap); 1093 SSMR3PutU8(pSSM, s->mouse_type); 1094 SSMR3PutU8(pSSM, s->mouse_detect_state); 1095 SSMR3PutU32(pSSM, s->mouse_dx); 1096 SSMR3PutU32(pSSM, s->mouse_dy); 1097 SSMR3PutU32(pSSM, s->mouse_dz); 1098 SSMR3PutU32(pSSM, s->mouse_dw); 1099 SSMR3PutU32(pSSM, s->mouse_flags); 1100 SSMR3PutU8(pSSM, s->mouse_buttons); 1101 SSMR3PutU8(pSSM, s->mouse_buttons_reported); 1104 1102 1105 1103 cItems = s->mouse_command_queue.count; 1106 SSMR3PutU32( f, cItems);1104 SSMR3PutU32(pSSM, cItems); 1107 1105 for (i = s->mouse_command_queue.rptr; cItems-- > 0; i = (i + 1) % RT_ELEMENTS(s->mouse_command_queue.data)) 1108 SSMR3PutU8( f, s->mouse_command_queue.data[i]);1106 SSMR3PutU8(pSSM, s->mouse_command_queue.data[i]); 1109 1107 Log(("kbd_save: %d mouse command queue items stored\n", s->mouse_command_queue.count)); 1110 1108 1111 1109 cItems = s->mouse_event_queue.count; 1112 SSMR3PutU32( f, cItems);1110 SSMR3PutU32(pSSM, cItems); 1113 1111 for (i = s->mouse_event_queue.rptr; cItems-- > 0; i = (i + 1) % RT_ELEMENTS(s->mouse_event_queue.data)) 1114 SSMR3PutU8( f, s->mouse_event_queue.data[i]);1112 SSMR3PutU8(pSSM, s->mouse_event_queue.data[i]); 1115 1113 Log(("kbd_save: %d mouse event queue items stored\n", s->mouse_event_queue.count)); 1116 1114 #endif 1117 1115 1118 1116 /* terminator */ 1119 SSMR3PutU32( f, ~0);1120 } 1121 1122 static int kbd_load( QEMUFile* f, void* opaque, int version_id)1117 SSMR3PutU32(pSSM, ~0); 1118 } 1119 1120 static int kbd_load(PSSMHANDLE pSSM, KBDState *s, uint32_t version_id) 1123 1121 { 1124 1122 uint32_t u32, i; … … 1126 1124 uint32_t u32Dummy; 1127 1125 int rc; 1128 KBDState *s = (KBDState*)opaque;1129 1126 1130 1127 #if 0 … … 1136 1133 if (version_id < 2 || version_id > PCKBD_SAVED_STATE_VERSION) 1137 1134 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 1138 qemu_get_8s(f, &s->write_cmd);1139 qemu_get_8s(f, &s->status);1140 qemu_get_8s(f, &s->mode);1135 SSMR3GetU8(pSSM, &s->write_cmd); 1136 SSMR3GetU8(pSSM, &s->status); 1137 SSMR3GetU8(pSSM, &s->mode); 1141 1138 if (version_id <= 5) 1142 1139 { 1143 qemu_get_be32s(f, (uint32_t *)&u32Dummy);1144 qemu_get_be32s(f, (uint32_t *)&u32Dummy);1140 SSMR3GetU32(pSSM, (uint32_t *)&u32Dummy); 1141 SSMR3GetU32(pSSM, (uint32_t *)&u32Dummy); 1145 1142 } 1146 1143 else 1147 1144 { 1148 qemu_get_8s(f, &s->dbbout);1145 SSMR3GetU8(pSSM, &s->dbbout); 1149 1146 } 1150 1147 #ifndef VBOX_WITH_NEW_PS2M 1151 qemu_get_be32s(f, (uint32_t *)&s->mouse_write_cmd);1152 qemu_get_8s(f, &s->mouse_status);1153 qemu_get_8s(f, &s->mouse_resolution);1154 qemu_get_8s(f, &s->mouse_sample_rate);1155 qemu_get_8s(f, &s->mouse_wrap);1156 qemu_get_8s(f, &s->mouse_type);1157 qemu_get_8s(f, &s->mouse_detect_state);1158 qemu_get_be32s(f, (uint32_t *)&s->mouse_dx);1159 qemu_get_be32s(f, (uint32_t *)&s->mouse_dy);1160 qemu_get_be32s(f, (uint32_t *)&s->mouse_dz);1148 SSMR3GetU32(pSSM, (uint32_t *)&s->mouse_write_cmd); 1149 SSMR3GetU8(pSSM, &s->mouse_status); 1150 SSMR3GetU8(pSSM, &s->mouse_resolution); 1151 SSMR3GetU8(pSSM, &s->mouse_sample_rate); 1152 SSMR3GetU8(pSSM, &s->mouse_wrap); 1153 SSMR3GetU8(pSSM, &s->mouse_type); 1154 SSMR3GetU8(pSSM, &s->mouse_detect_state); 1155 SSMR3GetU32(pSSM, (uint32_t *)&s->mouse_dx); 1156 SSMR3GetU32(pSSM, (uint32_t *)&s->mouse_dy); 1157 SSMR3GetU32(pSSM, (uint32_t *)&s->mouse_dz); 1161 1158 if (version_id > 2) 1162 1159 { 1163 SSMR3GetS32( f, &s->mouse_dw);1164 SSMR3GetS32( f, &s->mouse_flags);1165 } 1166 qemu_get_8s(f, &s->mouse_buttons);1160 SSMR3GetS32(pSSM, &s->mouse_dw); 1161 SSMR3GetS32(pSSM, &s->mouse_flags); 1162 } 1163 SSMR3GetU8(pSSM, &s->mouse_buttons); 1167 1164 if (version_id == 4) 1168 1165 { 1169 SSMR3GetU32( f, &u32Dummy);1170 SSMR3GetU32( f, &u32Dummy);1166 SSMR3GetU32(pSSM, &u32Dummy); 1167 SSMR3GetU32(pSSM, &u32Dummy); 1171 1168 } 1172 1169 if (version_id > 3) 1173 SSMR3GetU8( f, &s->mouse_buttons_reported);1170 SSMR3GetU8(pSSM, &s->mouse_buttons_reported); 1174 1171 if (version_id == 4) 1175 SSMR3GetU8( f, &u8Dummy);1172 SSMR3GetU8(pSSM, &u8Dummy); 1176 1173 s->mouse_command_queue.count = 0; 1177 1174 s->mouse_command_queue.rptr = 0; … … 1190 1187 if (version_id <= 5) 1191 1188 { 1192 rc = SSMR3GetU32( f, &u32);1189 rc = SSMR3GetU32(pSSM, &u32); 1193 1190 if (RT_FAILURE(rc)) 1194 1191 return rc; 1195 1192 for (i = 0; i < u32; i++) 1196 1193 { 1197 rc = SSMR3GetU8( f, &u8Dummy);1194 rc = SSMR3GetU8(pSSM, &u8Dummy); 1198 1195 if (RT_FAILURE(rc)) 1199 1196 return rc; … … 1203 1200 1204 1201 #ifndef VBOX_WITH_NEW_PS2M 1205 rc = SSMR3GetU32( f, &u32);1202 rc = SSMR3GetU32(pSSM, &u32); 1206 1203 if (RT_FAILURE(rc)) 1207 1204 return rc; … … 1213 1210 for (i = 0; i < u32; i++) 1214 1211 { 1215 rc = SSMR3GetU8( f, &s->mouse_command_queue.data[i]);1212 rc = SSMR3GetU8(pSSM, &s->mouse_command_queue.data[i]); 1216 1213 if (RT_FAILURE(rc)) 1217 1214 return rc; … … 1221 1218 Log(("kbd_load: %d mouse command queue items loaded\n", u32)); 1222 1219 1223 rc = SSMR3GetU32( f, &u32);1220 rc = SSMR3GetU32(pSSM, &u32); 1224 1221 if (RT_FAILURE(rc)) 1225 1222 return rc; … … 1231 1228 for (i = 0; i < u32; i++) 1232 1229 { 1233 rc = SSMR3GetU8( f, &s->mouse_event_queue.data[i]);1230 rc = SSMR3GetU8(pSSM, &s->mouse_event_queue.data[i]); 1234 1231 if (RT_FAILURE(rc)) 1235 1232 return rc; … … 1241 1238 if (version_id <= 6) 1242 1239 { 1243 rc = SSMR3GetU32( f, &u32);1240 rc = SSMR3GetU32(pSSM, &u32); 1244 1241 if (RT_FAILURE(rc)) 1245 1242 return rc; 1246 1243 for (i = 0; i < u32; i++) 1247 1244 { 1248 rc = SSMR3GetU8( f, &u8Dummy);1245 rc = SSMR3GetU8(pSSM, &u8Dummy); 1249 1246 if (RT_FAILURE(rc)) 1250 1247 return rc; … … 1255 1252 1256 1253 /* terminator */ 1257 rc = SSMR3GetU32( f, &u32);1254 rc = SSMR3GetU32(pSSM, &u32); 1258 1255 if (RT_FAILURE(rc)) 1259 1256 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.