VirtualBox

Ignore:
Timestamp:
Sep 22, 2011 5:51:53 PM (13 years ago)
Author:
vboxsync
Message:

Do not just loop forever.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS-new/ps2mouse.c

    r38699 r38832  
    6363uint8_t send_to_mouse_ctrl(uint8_t sendbyte)
    6464{
     65    BX_DEBUG_INT15_MS("send %02x to mouse:\n", sendbyte);
    6566    // wait for chance to write to ctrl
    66     if ( inb(0x64) & 0x02 )
     67    if (inb(0x64) & 0x02)
    6768        BX_PANIC(panic_msg_keyb_buffer_full,"sendmouse");
    6869    outb(0x64, 0xD4);
     
    7475uint8_t get_mouse_data(uint8_t __far *data)
    7576{
     77    int         retries = 10000;
    7678    uint8_t     response;
    7779
    78     //@todo: timeout?
    79     while ((inb(0x64) & 0x21) != 0x21)
    80         ;
    81    
     80    while ((inb(0x64) & 0x21) != 0x21 && retries)
     81        --retries;
     82   
     83    if (!retries)
     84        return(1);
     85
    8286    response = inb(0x60);
    8387    *data = response;
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