儲存庫 vbox 的更動 12381
- 時間撮記:
- 2008-9-10 下午11:37:41 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r12380 r12381 74 74 75 75 /** Size of the send fifo queue (in bytes) */ 76 #define CHAR_MAX_SEND_QUEUE 0x80 77 #define CHAR_MAX_SEND_QUEUE_MASK 0x7f 76 #ifdef RT_OS_DARWIN 77 # define CHAR_MAX_SEND_QUEUE 0x400 78 # define CHAR_MAX_SEND_QUEUE_MASK 0x3ff 79 #else 80 # define CHAR_MAX_SEND_QUEUE 0x80 81 # define CHAR_MAX_SEND_QUEUE_MASK 0x7f 82 #endif 78 83 79 84 /******************************************************************************* … … 107 112 /** the device handle */ 108 113 RTFILE DeviceFile; 114 # ifdef RT_OS_DARWIN 115 /** The device handle used for reading. */ 116 RTFILE DeviceFileR; 117 # endif 109 118 /** The read end of the control pipe */ 110 119 RTFILE WakeupPipeR; … … 524 533 FD_ZERO(&WrSet); 525 534 FD_SET(pThis->DeviceFile, &WrSet); 526 //FD_SET(pThis->WakeupPipeR, &WrSet);527 535 fd_set XcptSet; 528 536 FD_ZERO(&XcptSet); 529 537 FD_SET(pThis->DeviceFile, &XcptSet); 530 //FD_SET(pThis->WakeupPipeR, &XcptSet); 531 rc = select(RT_MAX(pThis->WakeupPipeR, pThis->DeviceFile) + 1, NULL, &WrSet, &XcptSet, NULL); 538 rc = select(pThis->DeviceFile + 1, NULL, &WrSet, &XcptSet, NULL); 532 539 /** @todo check rc? */ 533 540 … … 700 707 fd_set RdSet; 701 708 FD_ZERO(&RdSet); 702 FD_SET(pThis->DeviceFile , &RdSet);709 FD_SET(pThis->DeviceFileR, &RdSet); 703 710 FD_SET(pThis->WakeupPipeR, &RdSet); 704 711 fd_set XcptSet; 705 712 FD_ZERO(&XcptSet); 706 FD_SET(pThis->DeviceFile , &XcptSet);713 FD_SET(pThis->DeviceFileR, &XcptSet); 707 714 FD_SET(pThis->WakeupPipeR, &XcptSet); 708 715 # if 1 /* it seems like this select is blocking the write... */ 709 rc = select(RT_MAX(pThis->WakeupPipeR, pThis->DeviceFile ) + 1, &RdSet, NULL, &XcptSet, NULL);716 rc = select(RT_MAX(pThis->WakeupPipeR, pThis->DeviceFileR) + 1, &RdSet, NULL, &XcptSet, NULL); 710 717 # else 711 718 struct timeval tv = { 0, 1000 }; 712 rc = select(RT_MAX(pThis->WakeupPipeR, pThis->DeviceFile ) + 1, &RdSet, NULL, &XcptSet, &tv);719 rc = select(RT_MAX(pThis->WakeupPipeR, pThis->DeviceFileR) + 1, &RdSet, NULL, &XcptSet, &tv); 713 720 # endif 714 721 if (rc == -1) … … 742 749 743 750 /* read data from the serial port. */ 744 rc = RTFileRead(pThis->DeviceFile , abBuffer, sizeof(abBuffer), &cbRead);751 rc = RTFileRead(pThis->DeviceFileR, abBuffer, sizeof(abBuffer), &cbRead); 745 752 if (RT_FAILURE(rc)) 746 753 { … … 980 987 if (!((statusLines ^ pThis->fStatusLines) & uStatusLinesToCheck)) 981 988 { 982 PDMR3ThreadSleep(pThread, 1000); /* 1sec */989 PDMR3ThreadSleep(pThread, 500); /* 0.5 sec */ 983 990 continue; 984 991 } … … 1209 1216 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) 1210 1217 pThis->DeviceFile = NIL_RTFILE; 1218 # ifdef RT_OS_DARWIN 1219 pThis->DeviceFileR = NIL_RTFILE; 1220 # endif 1211 1221 pThis->WakeupPipeR = NIL_RTFILE; 1212 1222 pThis->WakeupPipeW = NIL_RTFILE; … … 1270 1280 1271 1281 rc = RTFileOpen(&pThis->DeviceFile, pThis->pszDevicePath, RTFILE_O_OPEN | RTFILE_O_READWRITE); 1282 # ifdef RT_OS_DARWIN 1283 if (RT_SUCCESS(rc)) 1284 rc = RTFileOpen(&pThis->DeviceFileR, pThis->pszDevicePath, RTFILE_O_OPEN | RTFILE_O_READ); 1285 # endif 1286 1272 1287 1273 1288 #endif … … 1301 1316 1302 1317 fcntl(pThis->DeviceFile, F_SETFL, O_NONBLOCK); 1318 # ifdef RT_OS_DARWIN 1319 fcntl(pThis->DeviceFileR, F_SETFL, O_NONBLOCK); 1320 # endif 1303 1321 int aFDs[2]; 1304 1322 if (pipe(aFDs) != 0) … … 1404 1422 pThis->WakeupPipeR = NIL_RTFILE; 1405 1423 } 1424 # if defined(RT_OS_DARWIN) 1425 if (pThis->DeviceFileR != NIL_RTFILE) 1426 { 1427 if (pThis->DeviceFile != pThis->DeviceFileR) 1428 { 1429 int rc = RTFileClose(pThis->DeviceFileR); 1430 AssertRC(rc); 1431 } 1432 pThis->DeviceFileR = NIL_RTFILE; 1433 } 1434 # endif 1406 1435 if (pThis->DeviceFile != NIL_RTFILE) 1407 1436 {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器