Changeset 103281 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Feb 8, 2024 2:37:11 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r103241 r103281 1391 1391 /** @todo r=klaus move this to a (system-specific) driver */ 1392 1392 #ifdef RT_OS_LINUX 1393 /** @todo r=andy Use #defines / enums(?) for all those uPassthroughSpeaker below. */ 1393 1394 int fd = -1; 1394 if ( (uPassthroughSpeaker == 1 || uPassthroughSpeaker == 100) && fd == -1)1395 if (uPassthroughSpeaker == 1 || uPassthroughSpeaker == 100) 1395 1396 fd = pitR3TryDeviceOpenSanitizeIoctl("/dev/input/by-path/platform-pcspkr-event-spkr", O_WRONLY); 1396 if ((uPassthroughSpeaker == 2 || uPassthroughSpeaker == 100) && fd == -1) 1397 1398 if (fd == -1 && (uPassthroughSpeaker == 2 || uPassthroughSpeaker == 100)) 1397 1399 fd = pitR3TryDeviceOpenSanitizeIoctl("/dev/tty", O_WRONLY); 1398 if ((uPassthroughSpeaker == 3 || uPassthroughSpeaker == 100) && fd == -1) 1400 1401 if (fd == -1 && (uPassthroughSpeaker == 3 || uPassthroughSpeaker == 100)) 1399 1402 { 1400 1403 fd = pitR3TryDeviceOpenSanitizeIoctl("/dev/tty0", O_WRONLY); … … 1402 1405 fd = pitR3TryDeviceOpenSanitizeIoctl("/dev/vc/0", O_WRONLY); 1403 1406 } 1404 if ((uPassthroughSpeaker == 9 || uPassthroughSpeaker == 100) && pszPassthroughSpeakerDevice && fd == -1) 1407 1408 if (fd == -1 && (uPassthroughSpeaker == 9 || uPassthroughSpeaker == 100) && pszPassthroughSpeakerDevice) 1405 1409 fd = pitR3TryDeviceOpenSanitizeIoctl(pszPassthroughSpeakerDevice, O_WRONLY); 1406 if (pThisCC->enmSpeakerEmu == PIT_SPEAKER_EMU_NONE && fd != -1) 1410 1411 if (fd != -1) 1407 1412 { 1408 pThisCC->hHostSpeaker = fd;1409 1413 if (ioctl(fd, EVIOCGSND(0)) != -1) 1410 1414 { … … 1417 1421 LogRel(("PIT: speaker: emulation mode console\n")); 1418 1422 } 1423 pThisCC->hHostSpeaker = fd; 1419 1424 } 1420 if ((uPassthroughSpeaker == 70 || uPassthroughSpeaker == 100) && fd == -1) 1421 fd = pitR3TryDeviceOpen("/dev/tty", O_WRONLY); 1422 if ((uPassthroughSpeaker == 79 || uPassthroughSpeaker == 100) && pszPassthroughSpeakerDevice && fd == -1) 1423 fd = pitR3TryDeviceOpen(pszPassthroughSpeakerDevice, O_WRONLY); 1424 if (pThisCC->enmSpeakerEmu == PIT_SPEAKER_EMU_NONE && fd != -1) 1425 else 1425 1426 { 1426 pThisCC->hHostSpeaker = fd; 1427 pThisCC->enmSpeakerEmu = PIT_SPEAKER_EMU_TTY; 1428 LogRel(("PIT: speaker: emulation mode tty\n")); 1429 } 1430 if (pThisCC->enmSpeakerEmu == PIT_SPEAKER_EMU_NONE) 1431 { 1427 if (uPassthroughSpeaker == 70 || uPassthroughSpeaker == 100) 1428 fd = pitR3TryDeviceOpen("/dev/tty", O_WRONLY); 1429 if (fd == -1 && (uPassthroughSpeaker == 79 || uPassthroughSpeaker == 100) && pszPassthroughSpeakerDevice) 1430 fd = pitR3TryDeviceOpen(pszPassthroughSpeakerDevice, O_WRONLY); 1432 1431 if (fd != -1) 1433 1432 { 1434 close(fd); 1435 fd = -1; 1433 pThisCC->enmSpeakerEmu = PIT_SPEAKER_EMU_TTY; 1434 pThisCC->hHostSpeaker = fd; 1435 LogRel(("PIT: speaker: emulation mode tty\n")); 1436 1436 } 1437 LogRel(("PIT: speaker: no emulation possible\n")); 1437 else 1438 LogRel(("PIT: speaker: no emulation possible\n")); 1438 1439 } 1439 #else 1440 #else /* !RT_OS_LINUX */ 1440 1441 LogRel(("PIT: speaker: emulation deactivated\n")); 1441 #endif 1442 #endif /* !RT_OS_LINUX */ 1442 1443 if (pszPassthroughSpeakerDevice) 1443 1444 {
Note:
See TracChangeset
for help on using the changeset viewer.