VirtualBox

Ignore:
Timestamp:
Sep 9, 2009 10:12:39 AM (15 years ago)
Author:
vboxsync
Message:

Devices/Input/DevPS2: cleaned out all non-VBox-code

File:
1 edited

Legend:

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

    r22810 r22858  
    1 #ifdef VBOX
    21/* $Id: $ */
    32/** @file
     
    7170RT_C_DECLS_END
    7271#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
    73 #endif /* VBOX */
    74 
    75 
    76 #ifndef VBOX
    77 #include "vl.h"
    78 #endif
    79 
    80 #ifdef VBOX
     72
    8173/* debug PC keyboard */
    8274#define DEBUG_KBD
     
    8476/* debug PC keyboard : only mouse */
    8577#define DEBUG_MOUSE
    86 #endif /* VBOX */
    8778
    8879/*      Keyboard Controller Commands */
     
    161152#define AUX_RESET               0xFF    /* Reset aux device */
    162153#define AUX_ACK                 0xFA    /* Command byte ACK. */
    163 #ifdef VBOX
    164 #define AUX_NACK                        0xFE    /* Command byte NACK. */
    165 #endif
     154#define AUX_NACK                0xFE    /* Command byte NACK. */
    166155
    167156#define MOUSE_STATUS_REMOTE     0x40
     
    171160#define KBD_QUEUE_SIZE 256
    172161
    173 #ifdef VBOX
    174162# define MOUSE_REPORT_HORIZONTAL  0x01
    175163# define MOUSE_OUTSTANDING_CLICK  0x02
    176 #endif
    177164
    178165typedef struct {
    179 #ifndef VBOX
    180     uint8_t aux[KBD_QUEUE_SIZE];
    181 #endif /* !VBOX */
    182166    uint8_t data[KBD_QUEUE_SIZE];
    183167    int rptr, wptr, count;
    184168} KBDQueue;
    185 
    186 #ifdef VBOX
    187169
    188170#define MOUSE_CMD_QUEUE_SIZE 8
     
    201183} MouseEventQueue;
    202184
    203 #endif /* VBOX */
    204 
    205185typedef struct KBDState {
    206186    KBDQueue queue;
    207 #ifdef VBOX
    208187    MouseCmdQueue mouse_command_queue;
    209188    MouseEventQueue mouse_event_queue;
    210 #endif /* VBOX */
    211189    uint8_t write_cmd; /* if non zero, write data to port 60 is expected */
    212190    uint8_t status;
     
    226204    int32_t mouse_dy;
    227205    int32_t mouse_dz;
    228 #ifdef VBOX
    229206    int32_t mouse_dw;
    230207    int32_t mouse_flags;
    231 #endif
    232208    uint8_t mouse_buttons;
    233209
    234 #ifdef VBOX
    235210    /** Pointer to the device instance - RC. */
    236211    PPDMDEVINSRC                pDevInsRC;
     
    272247        R3PTRTYPE(PPDMIMOUSECONNECTOR)      pDrv;
    273248    } Mouse;
    274 #endif
    275249} KBDState;
    276250
    277251#ifndef VBOX_DEVICE_STRUCT_TESTCASE
    278 #ifndef VBOX
    279 KBDState kbd_state;
    280 #endif
    281252
    282253/* update irq and KBD_STAT_[MOUSE_]OBF */
     
    286257{
    287258    KBDQueue *q = &s->queue;
    288 #ifdef VBOX
    289259    MouseCmdQueue *mcq = &s->mouse_command_queue;
    290260    MouseEventQueue *meq = &s->mouse_event_queue;
    291 #endif /* VBOX */
    292261    int irq12_level, irq1_level;
    293262
     
    295264    irq12_level = 0;
    296265    s->status &= ~(KBD_STAT_OBF | KBD_STAT_MOUSE_OBF);
    297 #ifdef VBOX
    298266    if (q->count != 0)
    299267    {
     
    308276            irq12_level = 1;
    309277    }
    310 #else /* !VBOX */
    311     if (q->count != 0) {
    312         s->status |= KBD_STAT_OBF;
    313         if (q->aux[q->rptr]) {
    314             s->status |= KBD_STAT_MOUSE_OBF;
    315             if (s->mode & KBD_MODE_MOUSE_INT)
    316                 irq12_level = 1;
    317         } else {
    318             if ((s->mode & KBD_MODE_KBD_INT) &&
    319                 !(s->mode & KBD_MODE_DISABLE_KBD))
    320                 irq1_level = 1;
    321         }
    322     }
    323 #endif /* !VBOX */
    324 #ifndef VBOX
    325     pic_set_irq(1, irq1_level);
    326     pic_set_irq(12, irq12_level);
    327 #else /* VBOX */
    328278    PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, irq1_level);
    329279    PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, irq12_level);
    330 #endif /* VBOX */
    331280}
    332281
     
    334283{
    335284    KBDQueue *q = &s->queue;
    336 #ifdef VBOX
    337285    MouseCmdQueue *mcq = &s->mouse_command_queue;
    338286    MouseEventQueue *meq = &s->mouse_event_queue;
    339 #endif /* VBOX */
    340287
    341288#if defined(DEBUG_MOUSE) || defined(DEBUG_KBD)
     
    349296#endif
    350297#endif
    351 #ifdef VBOX
    352298    switch (aux)
    353299    {
     
    379325            AssertMsgFailed(("aux=%d\n", aux));
    380326    }
    381 #else /* !VBOX */
    382     if (q->count >= KBD_QUEUE_SIZE)
    383         return;
    384     q->aux[q->wptr] = aux;
    385     q->data[q->wptr] = b;
    386     if (++q->wptr == KBD_QUEUE_SIZE)
    387         q->wptr = 0;
    388     q->count++;
    389 #endif /* !VBOX */
    390327    kbd_update_irq(s);
    391328}
     
    410347}
    411348
    412 #ifndef VBOX
    413 static void kbd_write_command(void *opaque, uint32_t addr, uint32_t val)
    414 {
    415 #else /* VBOX (we need VMReset return code passed back) */
    416349static int kbd_write_command(void *opaque, uint32_t addr, uint32_t val)
    417350{
    418351    int rc = VINF_SUCCESS;
    419 #endif /* VBOX */
    420352    KBDState *s = (KBDState*)opaque;
    421353
     
    464396        /* XXX: check that */
    465397#ifdef TARGET_I386
    466 # ifndef VBOX
    467         val = 0x01 | (ioport_get_a20() << 1);
    468 # else /* VBOX */
    469398        val = 0x01 | (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) << 1);
    470 # endif /* VBOX */
    471399#else
    472400        val = 0x01;
     
    480408#ifdef TARGET_I386
    481409    case KBD_CCMD_ENABLE_A20:
    482 #ifndef VBOX
    483         ioport_set_a20(1);
    484 #else /* VBOX */
    485410# ifndef IN_RING3
    486411        if (!PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
     
    489414        PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), true);
    490415# endif /* IN_RING3 */
    491 #endif /* VBOX */
    492416        break;
    493417    case KBD_CCMD_DISABLE_A20:
    494 #ifndef VBOX
    495         ioport_set_a20(0);
    496 #else /* VBOX */
    497418# ifndef IN_RING3
    498419        if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)))
     
    501422        PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), false);
    502423# endif /* !IN_RING3 */
    503 #endif /* VBOX */
    504424        break;
    505425#endif
     
    510430        break;
    511431    case KBD_CCMD_RESET:
    512 #ifndef VBOX
    513         qemu_system_reset_request();
    514 #else /* VBOX */
    515 # ifndef IN_RING3
     432#ifndef IN_RING3
    516433        rc = VINF_IOM_HC_IOPORT_WRITE;
    517 # else /* IN_RING3 */
     434#else /* IN_RING3 */
    518435        rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns));
    519 # endif /* !IN_RING3 */
    520 #endif /* VBOX */
     436#endif /* !IN_RING3 */
    521437        break;
    522438    case 0xff:
    523439        /* ignore that - I don't know what is its use */
    524440        break;
    525 #ifdef VBOX /* Make OS/2 happy. */
     441    /* Make OS/2 happy. */
    526442    /* The 8042 RAM is readble using commands 0x20 thru 0x3f, and writable
    527443       by 0x60 thru 0x7f. Now days only the firs byte, the mode, is used.
     
    535451        Log(("kbd: reading non-standard RAM addr %#x\n", val & 0x1f));
    536452        break;
    537 #endif
    538453    default:
    539454        Log(("kbd: unsupported keyboard cmd=0x%02x\n", val));
    540455        break;
    541456    }
    542 #ifdef VBOX
    543457    return rc;
    544 #endif
    545458}
    546459
     
    549462    KBDState *s = (KBDState*)opaque;
    550463    KBDQueue *q;
    551 #ifdef VBOX
    552464    MouseCmdQueue *mcq;
    553465    MouseEventQueue *meq;
    554 #endif /* VBOX */
    555466    int val, index, aux;
    556467
    557468    q = &s->queue;
    558 #ifdef VBOX
    559469    mcq = &s->mouse_command_queue;
    560470    meq = &s->mouse_event_queue;
    561471    if (q->count == 0 && mcq->count == 0 && meq->count == 0) {
    562 #else /* !VBOX */
    563     if (q->count == 0) {
    564 #endif /* !VBOX */
    565472        /* NOTE: if no data left, we return the last keyboard one
    566473           (needed for EMM386) */
     
    571478        val = q->data[index];
    572479    } else {
    573 #ifdef VBOX
    574480        aux = (s->status & KBD_STAT_MOUSE_OBF);
    575481        if (!aux)
     
    597503            }
    598504        }
    599 #else /* !VBOX */
    600         aux = q->aux[q->rptr];
    601         val = q->data[q->rptr];
    602         if (++q->rptr == KBD_QUEUE_SIZE)
    603             q->rptr = 0;
    604         q->count--;
    605 #endif /* !VBOX */
    606505        /* reading deasserts IRQ */
    607 #ifndef VBOX
    608         if (aux)
    609             pic_set_irq(12, 0);
    610         else
    611             pic_set_irq(1, 0);
    612 #else /* VBOX */
    613506        if (aux)
    614507            PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 12, 0);
    615508        else
    616509            PDMDevHlpISASetIrq(s->CTX_SUFF(pDevIns), 1, 0);
    617 #endif /* VBOX */
    618510    }
    619511    /* reassert IRQs if data left */
     
    630522}
    631523
    632 #ifndef VBOX
    633 static void kbd_write_keyboard(KBDState *s, int val)
    634 #else
    635524static int  kbd_write_keyboard(KBDState *s, int val)
    636 #endif
    637525{
    638526    switch(s->kbd_write_cmd) {
     
    710598}
    711599
    712 #ifdef VBOX
    713600static void kbd_mouse_send_packet(KBDState *s, bool fToCmdQueue)
    714 #else /* !VBOX */
    715 static void kbd_mouse_send_packet(KBDState *s)
    716 #endif /* !VBOX */
    717 {
    718 #ifdef VBOX
     601{
    719602    int aux = fToCmdQueue ? 1 : 2;
    720 #endif /* VBOX */
    721603    unsigned int b;
    722604    int dx1, dy1, dz1, dw1;
     
    738620        dy1 = -127;
    739621    b = 0x08 | ((dx1 < 0) << 4) | ((dy1 < 0) << 5) | (s->mouse_buttons & 0x07);
    740 #ifdef VBOX
    741622    kbd_queue(s, b, aux);
    742623    kbd_queue(s, dx1 & 0xff, aux);
    743624    kbd_queue(s, dy1 & 0xff, aux);
    744 #else /* !VBOX */
    745     kbd_queue(s, b, 1);
    746     kbd_queue(s, dx1 & 0xff, 1);
    747     kbd_queue(s, dy1 & 0xff, 1);
    748 #endif /* !VBOX */
    749625    /* extra byte for IMPS/2 or IMEX */
    750626    switch(s->mouse_type) {
     
    756632        else if (dz1 < -127)
    757633                dz1 = -127;
    758 #ifdef VBOX
    759634        kbd_queue(s, dz1 & 0xff, aux);
    760 #else /* !VBOX */
    761         kbd_queue(s, dz1 & 0xff, 1);
    762 #endif /* !VBOX */
    763635        break;
    764636    case 4:
    765 #ifndef VBOX
    766         if (dz1 > 7)
    767             dz1 = 7;
    768         else if (dz1 < -7)
    769             dz1 = -7;
    770 #else
    771637        if (dz1 > 1)
    772638            dz1 = 1;
     
    779645        if (dz1)
    780646            dw1 = 0;
    781 #endif
    782 #ifdef VBOX
    783647        if ((s->mouse_flags & MOUSE_REPORT_HORIZONTAL) && dw1)
    784648            b = 0x40 | (dw1 & 0x3f);
     
    790654        }
    791655        kbd_queue(s, b, aux);
    792 #else /* !VBOX */
    793         b = (dz1 & 0x0f) | ((s->mouse_buttons & 0x18) << 1);
    794         kbd_queue(s, b, 1);
    795 #endif /* !VBOX */
    796656        break;
    797657    }
     
    801661    s->mouse_dy -= dy1;
    802662    s->mouse_dz -= dz1;
    803 #ifdef VBOX
    804663    s->mouse_dw -= dw1;
    805 #endif
    806664}
    807665
    808666#ifdef IN_RING3
    809 #ifndef VBOX
    810 static void pc_kbd_mouse_event(void *opaque,
    811                                int dx, int dy, int dz, int buttons_state)
    812 #else
    813667static void pc_kbd_mouse_event(void *opaque,
    814668                               int dx, int dy, int dz, int dw, int buttons_state)
    815 #endif
    816669{
    817670    KBDState *s = (KBDState*)opaque;
     
    824677    s->mouse_dy -= dy;
    825678    s->mouse_dz += dz;
    826 #ifdef VBOX
    827679    s->mouse_dw += dw;
    828 #endif
    829 #ifndef VBOX
    830     /* XXX: SDL sometimes generates nul events: we delete them */
    831     if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0 &&
    832         s->mouse_buttons == buttons_state)
    833         return;
    834 #else
    835680    /* The issue described above does not affect VBox, and under some
    836681     * circumstances (which?) we may even wish to send null events to make
     
    841686    if ((s->mouse_buttons & 0x18) != (buttons_state & 0x18))
    842687        s->mouse_flags |= MOUSE_OUTSTANDING_CLICK;
    843 #endif
    844688    s->mouse_buttons = buttons_state;
    845689
    846 #ifdef VBOX
    847690    if (!(s->mouse_status & MOUSE_STATUS_REMOTE) &&
    848691        (s->mouse_event_queue.count < (MOUSE_EVENT_QUEUE_SIZE - 4))) {
     
    855698        }
    856699    }
    857 #else /* !VBOX */
    858     if (!(s->mouse_status & MOUSE_STATUS_REMOTE) &&
    859         (s->queue.count < (KBD_QUEUE_SIZE - 16))) {
    860         for(;;) {
    861             /* if not remote, send event. Multiple events are sent if
    862                too big deltas */
    863             kbd_mouse_send_packet(s);
    864             if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0)
    865                 break;
    866         }
    867     }
    868 #endif /* !VBOX */
    869700}
    870701#endif /* IN_RING3 */
     
    875706    LogRelFlowFunc(("kbd: write mouse 0x%02x\n", val));
    876707#endif
    877 #ifdef VBOX
    878708    /* Flush the mouse command response queue. */
    879709    s->mouse_command_queue.count = 0;
    880710    s->mouse_command_queue.rptr = 0;
    881711    s->mouse_command_queue.wptr = 0;
    882 #endif /* VBOX */
    883712    switch(s->mouse_write_cmd) {
    884713    default:
     
    933762        case AUX_POLL:
    934763            kbd_queue(s, AUX_ACK, 1);
    935 #ifdef VBOX
    936764            kbd_mouse_send_packet(s, true);
    937 #else /* !VBOX */
    938             kbd_mouse_send_packet(s);
    939 #endif /* !VBOX */
    940765            break;
    941766        case AUX_ENABLE_DEV:
     
    946771            s->mouse_status &= ~MOUSE_STATUS_ENABLED;
    947772            kbd_queue(s, AUX_ACK, 1);
    948 #ifdef VBOX
    949773            /* Flush the mouse events queue. */
    950774            s->mouse_event_queue.count = 0;
    951775            s->mouse_event_queue.rptr = 0;
    952776            s->mouse_event_queue.wptr = 0;
    953 #endif /* VBOX */
    954777            break;
    955778        case AUX_SET_DEFAULT:
     
    967790            kbd_queue(s, 0xaa, 1);
    968791            kbd_queue(s, s->mouse_type, 1);
    969 #ifdef VBOX
    970792            /* Flush the mouse events queue. */
    971793            s->mouse_event_queue.count = 0;
    972794            s->mouse_event_queue.rptr = 0;
    973795            s->mouse_event_queue.wptr = 0;
    974 #endif /* VBOX */
    975796            break;
    976797        default:
    977 #ifdef VBOX
    978798            /* NACK all commands we don't know.
    979799
     
    994814            /** @todo send error if we NACKed the previous command? */
    995815            kbd_queue(s, AUX_NACK, 1);
    996 #endif
    997816            break;
    998817        }
     
    1001820        s->mouse_sample_rate = val;
    1002821        /* detect IMPS/2 or IMEX */
    1003 #ifdef VBOX
    1004822        /* And enable horizontal scrolling reporting when requested */
    1005 #endif
    1006823        switch(s->mouse_detect_state) {
    1007824        default:
     
    1015832            else if (val == 200)
    1016833                s->mouse_detect_state = 3;
    1017 #ifdef VBOX
    1018834            else if ((val == 80) && s->mouse_type == 4 /* IMEX */)
    1019835                /* enable horizontal scrolling, byte two */
    1020836                s->mouse_detect_state = 4;
    1021 #endif
    1022837            else
    1023838                s->mouse_detect_state = 0;
    1024839            break;
    1025840        case 2:
    1026 #ifdef VBOX
    1027841            if (val == 80)
    1028842            {
     
    1030844                s->mouse_type = 3; /* IMPS/2 */
    1031845            }
    1032 #else
    1033             if (val == 80)
    1034                 s->mouse_type = 3; /* IMPS/2 */
    1035 #endif
    1036846            s->mouse_detect_state = 0;
    1037847            break;
    1038848        case 3:
    1039 #ifdef VBOX
    1040849            if (val == 80)
    1041850            {
     
    1043852                s->mouse_type = 4; /* IMEX */
    1044853            }
    1045 #else
    1046             if (val == 80)
    1047                 s->mouse_type = 4; /* IMEX */
    1048 #endif
    1049854            s->mouse_detect_state = 0;
    1050855            break;
    1051 #ifdef VBOX
    1052856        case 4:
    1053857            if (val == 40)
     
    1058862            s->mouse_detect_state = 0;
    1059863            break;
    1060 #endif
    1061864        }
    1062865        kbd_queue(s, AUX_ACK, 1);
     
    1071874}
    1072875
    1073 #ifndef VBOX
    1074 static void kbd_write_data(void *opaque, uint32_t addr, uint32_t val)
    1075 {
    1076 #else /* VBOX */
    1077876static int kbd_write_data(void *opaque, uint32_t addr, uint32_t val)
    1078877{
    1079878    int rc = VINF_SUCCESS;
    1080 #endif /* VBOX */
    1081879    KBDState *s = (KBDState*)opaque;
    1082880
     
    1101899    case KBD_CCMD_WRITE_OUTPORT:
    1102900#ifdef TARGET_I386
    1103 # ifndef VBOX
    1104         ioport_set_a20((val >> 1) & 1);
    1105 # else /* VBOX */
    1106901#  ifndef IN_RING3
    1107902        if (PDMDevHlpA20IsEnabled(s->CTX_SUFF(pDevIns)) != !!(val & 2))
     
    1110905        PDMDevHlpA20Set(s->CTX_SUFF(pDevIns), !!(val & 2));
    1111906#  endif /* !IN_RING3 */
    1112 # endif /* VBOX */
    1113907#endif
    1114908        if (!(val & 1)) {
    1115 #ifndef VBOX
    1116             qemu_system_reset_request();
    1117 #else /* VBOX */
    1118909# ifndef IN_RING3
    1119910            rc = VINF_IOM_HC_IOPORT_WRITE;
     
    1121912            rc = PDMDevHlpVMReset(s->CTX_SUFF(pDevIns));
    1122913# endif
    1123 #endif /* VBOX */
    1124914        }
    1125915        break;
     
    1131921    }
    1132922    s->write_cmd = 0;
    1133 
    1134 #ifdef VBOX
    1135923    return rc;
    1136 #endif
    1137924}
    1138925
     
    1143930    KBDState *s = (KBDState*)opaque;
    1144931    KBDQueue *q;
    1145 #ifdef VBOX
    1146932    MouseCmdQueue *mcq;
    1147933    MouseEventQueue *meq;
    1148 #endif /* VBOX */
    1149934
    1150935    s->kbd_write_cmd = -1;
     
    1152937    s->mode = KBD_MODE_KBD_INT | KBD_MODE_MOUSE_INT;
    1153938    s->status = KBD_STAT_CMD | KBD_STAT_UNLOCKED;
    1154 #ifdef VBOX /* Resetting everything, keyword was not working right on NT4 reboot. */
     939    /* Resetting everything, keyword was not working right on NT4 reboot. */
    1155940    s->write_cmd = 0;
    1156941    s->scan_enabled = 0;
     
    1167952    s->mouse_flags = 0;
    1168953    s->mouse_buttons = 0;
    1169 #endif
    1170954    q = &s->queue;
    1171955    q->rptr = 0;
    1172956    q->wptr = 0;
    1173957    q->count = 0;
    1174 #ifdef VBOX
    1175958    mcq = &s->mouse_command_queue;
    1176959    mcq->rptr = 0;
     
    1181964    meq->wptr = 0;
    1182965    meq->count = 0;
    1183 #endif /* VBOX */
    1184966}
    1185967
    1186968static void kbd_save(QEMUFile* f, void* opaque)
    1187969{
    1188 #ifdef VBOX
    1189970    uint32_t    cItems;
    1190971    int i;
    1191 #endif /* VBOX */
    1192972    KBDState *s = (KBDState*)opaque;
    1193973
     
    1207987    qemu_put_be32s(f, &s->mouse_dy);
    1208988    qemu_put_be32s(f, &s->mouse_dz);
    1209 #ifdef VBOX
    1210989    qemu_put_be32s(f, &s->mouse_dw);
    1211990    qemu_put_be32s(f, &s->mouse_flags);
    1212 #endif
    1213991    qemu_put_8s(f, &s->mouse_buttons);
    1214992
    1215 #ifdef VBOX
    1216993    /*
    1217994     * We have to save the queues too.
     
    12371014    /* terminator */
    12381015    SSMR3PutU32(f, ~0);
    1239 #endif /* VBOX */
    12401016}
    12411017
    12421018static int kbd_load(QEMUFile* f, void* opaque, int version_id)
    12431019{
    1244 #ifdef VBOX
    12451020    uint32_t    u32, i;
    12461021    int         rc;
    1247 #endif
    12481022    KBDState *s = (KBDState*)opaque;
    12491023
    12501024    if (version_id < 2 || version_id > PCKBD_SAVED_STATE_VERSION)
    1251 #ifndef VBOX
    1252         return -EINVAL;
    1253 #else
    12541025        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
    1255 #endif
    12561026    qemu_get_8s(f, &s->write_cmd);
    12571027    qemu_get_8s(f, &s->status);
     
    12691039    qemu_get_be32s(f, (uint32_t *)&s->mouse_dy);
    12701040    qemu_get_be32s(f, (uint32_t *)&s->mouse_dz);
    1271 #ifdef VBOX
    12721041    if (version_id > 2)
    12731042    {
     
    12751044        qemu_get_be32s(f, (uint32_t *)&s->mouse_flags);
    12761045    }
    1277 #endif
    12781046    qemu_get_8s(f, &s->mouse_buttons);
    1279 #ifdef VBOX
    12801047    s->queue.count = 0;
    12811048    s->queue.rptr = 0;
     
    13541121        return VERR_SSM_DATA_UNIT_FORMAT_CHANGED;
    13551122    }
    1356 #endif /* VBOX */
    13571123    return 0;
    13581124}
    1359 
    1360 #ifndef VBOX
    1361 void kbd_init(void)
    1362 {
    1363     KBDState *s = &kbd_state;
    1364 
    1365     kbd_reset(s);
    1366     register_savevm("pckbd", 0, 1, kbd_save, kbd_load, s);
    1367     register_ioport_read(0x60, 1, 1, kbd_read_data, s);
    1368     register_ioport_write(0x60, 1, 1, kbd_write_data, s);
    1369     register_ioport_read(0x64, 1, 1, kbd_read_status, s);
    1370     register_ioport_write(0x64, 1, 1, kbd_write_command, s);
    1371 
    1372     qemu_add_kbd_event_handler(pc_kbd_put_keycode, s);
    1373     qemu_add_mouse_event_handler(pc_kbd_mouse_event, s);
    1374     qemu_register_reset(kbd_reset, s);
    1375 }
    1376 #endif /* !VBOX */
    1377 
    13781125#endif /* IN_RING3 */
    13791126
    13801127
    1381 #ifdef VBOX /* VirtualBox code start */
     1128/* VirtualBox code start */
    13821129
    13831130/* -=-=-=-=-=- wrappers -=-=-=-=-=- */
     
    19611708
    19621709#endif /* IN_RING3 */
    1963 #endif /* VBOX */
    19641710#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
    19651711
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