VirtualBox

Changeset 49882 in vbox


Ignore:
Timestamp:
Dec 12, 2013 11:01:59 AM (11 years ago)
Author:
vboxsync
Message:

Devices/Input/DevPS2.cpp: eliminate use of vl_vbox.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r49469 r49882  
    4646*******************************************************************************/
    4747#define LOG_GROUP LOG_GROUP_DEV_KBD
    48 #include "vl_vbox.h"
    4948#include <VBox/vmm/pdmdev.h>
    5049#include <iprt/assert.h>
     
    10751074}
    10761075
    1077 static void kbd_save(QEMUFile* f, void* opaque)
     1076static void kbd_save(PSSMHANDLE pSSM, KBDState *s)
    10781077{
    10791078#ifndef VBOX_WITH_NEW_PS2M
     
    10811080    int i;
    10821081#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);
    10891087#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);
    11041102
    11051103    cItems = s->mouse_command_queue.count;
    1106     SSMR3PutU32(f, cItems);
     1104    SSMR3PutU32(pSSM, cItems);
    11071105    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]);
    11091107    Log(("kbd_save: %d mouse command queue items stored\n", s->mouse_command_queue.count));
    11101108
    11111109    cItems = s->mouse_event_queue.count;
    1112     SSMR3PutU32(f, cItems);
     1110    SSMR3PutU32(pSSM, cItems);
    11131111    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]);
    11151113    Log(("kbd_save: %d mouse event queue items stored\n", s->mouse_event_queue.count));
    11161114#endif
    11171115
    11181116    /* 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
     1120static int kbd_load(PSSMHANDLE pSSM, KBDState *s, uint32_t version_id)
    11231121{
    11241122    uint32_t    u32, i;
     
    11261124    uint32_t u32Dummy;
    11271125    int         rc;
    1128     KBDState *s = (KBDState*)opaque;
    11291126
    11301127#if 0
     
    11361133    if (version_id < 2 || version_id > PCKBD_SAVED_STATE_VERSION)
    11371134        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);
    11411138    if (version_id <= 5)
    11421139    {
    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);
    11451142    }
    11461143    else
    11471144    {
    1148         qemu_get_8s(f, &s->dbbout);
     1145        SSMR3GetU8(pSSM, &s->dbbout);
    11491146    }
    11501147#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);
    11611158    if (version_id > 2)
    11621159    {
    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);
    11671164    if (version_id == 4)
    11681165    {
    1169         SSMR3GetU32(f, &u32Dummy);
    1170         SSMR3GetU32(f, &u32Dummy);
     1166        SSMR3GetU32(pSSM, &u32Dummy);
     1167        SSMR3GetU32(pSSM, &u32Dummy);
    11711168    }
    11721169    if (version_id > 3)
    1173         SSMR3GetU8(f, &s->mouse_buttons_reported);
     1170        SSMR3GetU8(pSSM, &s->mouse_buttons_reported);
    11741171    if (version_id == 4)
    1175         SSMR3GetU8(f, &u8Dummy);
     1172        SSMR3GetU8(pSSM, &u8Dummy);
    11761173    s->mouse_command_queue.count = 0;
    11771174    s->mouse_command_queue.rptr = 0;
     
    11901187    if (version_id <= 5)
    11911188    {
    1192         rc = SSMR3GetU32(f, &u32);
     1189        rc = SSMR3GetU32(pSSM, &u32);
    11931190        if (RT_FAILURE(rc))
    11941191            return rc;
    11951192        for (i = 0; i < u32; i++)
    11961193        {
    1197             rc = SSMR3GetU8(f, &u8Dummy);
     1194            rc = SSMR3GetU8(pSSM, &u8Dummy);
    11981195            if (RT_FAILURE(rc))
    11991196                return rc;
     
    12031200
    12041201#ifndef VBOX_WITH_NEW_PS2M
    1205     rc = SSMR3GetU32(f, &u32);
     1202    rc = SSMR3GetU32(pSSM, &u32);
    12061203    if (RT_FAILURE(rc))
    12071204        return rc;
     
    12131210    for (i = 0; i < u32; i++)
    12141211    {
    1215         rc = SSMR3GetU8(f, &s->mouse_command_queue.data[i]);
     1212        rc = SSMR3GetU8(pSSM, &s->mouse_command_queue.data[i]);
    12161213        if (RT_FAILURE(rc))
    12171214            return rc;
     
    12211218    Log(("kbd_load: %d mouse command queue items loaded\n", u32));
    12221219
    1223     rc = SSMR3GetU32(f, &u32);
     1220    rc = SSMR3GetU32(pSSM, &u32);
    12241221    if (RT_FAILURE(rc))
    12251222        return rc;
     
    12311228    for (i = 0; i < u32; i++)
    12321229    {
    1233         rc = SSMR3GetU8(f, &s->mouse_event_queue.data[i]);
     1230        rc = SSMR3GetU8(pSSM, &s->mouse_event_queue.data[i]);
    12341231        if (RT_FAILURE(rc))
    12351232            return rc;
     
    12411238    if (version_id <= 6)
    12421239    {
    1243         rc = SSMR3GetU32(f, &u32);
     1240        rc = SSMR3GetU32(pSSM, &u32);
    12441241        if (RT_FAILURE(rc))
    12451242            return rc;
    12461243        for (i = 0; i < u32; i++)
    12471244        {
    1248             rc = SSMR3GetU8(f, &u8Dummy);
     1245            rc = SSMR3GetU8(pSSM, &u8Dummy);
    12491246            if (RT_FAILURE(rc))
    12501247                return rc;
     
    12551252
    12561253    /* terminator */
    1257     rc = SSMR3GetU32(f, &u32);
     1254    rc = SSMR3GetU32(pSSM, &u32);
    12581255    if (RT_FAILURE(rc))
    12591256        return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette