VirtualBox

Changeset 61 in vbox for trunk/src/VBox/Devices/Serial


Ignore:
Timestamp:
Jan 16, 2007 1:15:27 PM (18 years ago)
Author:
vboxsync
Message:

Sync with qemu -- fixed sizeof(divider).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/serial.c

    r1 r61  
    119119
    120120struct SerialState {
    121     uint8_t divider;
     121    uint16_t divider;
    122122    uint8_t rbr; /* receive register */
    123123    uint8_t ier;
     
    378378    SerialState *s = opaque;
    379379
    380     qemu_put_8s(f,&s->divider);
     380    qemu_put_be16s(f,&s->divider);
    381381    qemu_put_8s(f,&s->rbr);
    382382    qemu_put_8s(f,&s->ier);
     
    393393    SerialState *s = opaque;
    394394
    395     if(version_id != 1)
     395    if(version_id > 2)
    396396        return -EINVAL;
    397397
    398     qemu_get_8s(f,&s->divider);
     398    if (version_id >= 2)
     399        qemu_get_be16s(f, &s->divider);
     400    else
     401        s->divider = qemu_get_byte(f);
    399402    qemu_get_8s(f,&s->rbr);
    400403    qemu_get_8s(f,&s->ier);
     
    425428    s->msr = UART_MSR_DCD | UART_MSR_DSR | UART_MSR_CTS;
    426429
    427     register_savevm("serial", base, 1, serial_save, serial_load, s);
     430    register_savevm("serial", base, 2, serial_save, serial_load, s);
    428431
    429432    register_ioport_write(base, 8, 1, serial_ioport_write, s);
     
    512515    s->it_shift = it_shift;
    513516
    514     register_savevm("serial", base, 1, serial_save, serial_load, s);
     517    register_savevm("serial", base, 2, serial_save, serial_load, s);
    515518
    516519    s_io_memory = cpu_register_io_memory(0, serial_mm_read,
     
    570573    SerialState *s = PDMINS2DATA (pDevIns, SerialState *);
    571574
    572     if (u32Version != 1) {
     575    if (u32Version != 2) {
    573576        AssertMsgFailed(("u32Version=%d\n", u32Version));
    574577        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
     
    663666        pDevIns->pDevReg->szDeviceName, /* pszName */
    664667        iInstance,              /* u32Instance */
    665         1                       /* u32Version */,
     668        2                       /* u32Version */,
    666669        sizeof (*s),            /* cbGuess */
    667670        NULL,                   /* pfnSavePrep */
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