VirtualBox

Changeset 22876 in vbox for trunk


Ignore:
Timestamp:
Sep 9, 2009 7:34:07 PM (15 years ago)
Author:
vboxsync
Message:

FreeBSD: Enable host serial support. Untested but it compiles

Location:
trunk/src/VBox/Devices
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Builtins.cpp

    r22866 r22876  
    275275#endif
    276276
    277 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS)
     277#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_WINDOWS) || defined(RT_OS_FREEBSD)
    278278    rc = pCallbacks->pfnRegister(pCallbacks, &g_DrvHostSerial);
    279279    if (RT_FAILURE(rc))
  • trunk/src/VBox/Devices/Makefile.kmk

    r22866 r22876  
    858858        Storage/DrvHostFloppy% \
    859859        , $(Drivers_SOURCES)) \
    860         Audio/ossaudio.c
     860        Audio/ossaudio.c \
     861        Serial/DrvHostSerial.cpp
    861862Drivers_SOURCES.freebsd = \
    862863        Network/DrvTAP.cpp
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r22277 r22876  
    3838#include <iprt/alloc.h>
    3939
    40 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     40#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    4141# include <errno.h>
    4242# ifdef RT_OS_SOLARIS
     
    114114    char                        *pszDevicePath;
    115115
    116 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     116#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    117117    /** the device handle */
    118118    RTFILE                      DeviceFile;
     
    245245{
    246246    PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
    247 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     247#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    248248    struct termios *termiosSetup;
    249249    int baud_rate;
     
    518518            uint64_t volatile u64Now = RTTimeNanoTS(); NOREF(u64Now);
    519519#endif
    520 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     520#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    521521
    522522            size_t cbWritten;
     
    599599            abBuf[0] = pThis->aSendQueue[iTail];
    600600
    601 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     601#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    602602
    603603            rc = RTFileWrite(pThis->DeviceFile, abBuf, cbProcessed, NULL);
     
    764764            cbRemaining = cbRead;
    765765
    766 #elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
     766#elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    767767
    768768            size_t cbRead;
     
    924924{
    925925    PDRVHOSTSERIAL pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTSERIAL);
    926 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     926#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    927927    return RTFileWrite(pThis->WakeupPipeW, "", 1, NULL);
    928928#elif defined(RT_OS_WINDOWS)
     
    935935}
    936936
    937 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     937#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    938938/* -=-=-=-=- Monitor thread -=-=-=-=- */
    939939
     
    11401140    PDRVHOSTSERIAL pThis = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
    11411141
    1142 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     1142#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    11431143    int modemStateSet = 0;
    11441144    int modemStateClear = 0;
     
    11891189     * Init basic data members and interfaces.
    11901190     */
    1191 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     1191#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    11921192    pThis->DeviceFile  = NIL_RTFILE;
    11931193# ifdef RT_OS_DARWIN
     
    12701270            case VERR_ACCESS_DENIED:
    12711271                return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    1272 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     1272#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    12731273                                           N_("Cannot open host device '%s' for read/write access. Check the permissions "
    12741274                                              "of that device ('/bin/ls -l %s'): Most probably you need to be member "
     
    12881288
    12891289    /* Set to non blocking I/O */
    1290 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     1290#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    12911291
    12921292    fcntl(pThis->DeviceFile, F_SETFL, O_NONBLOCK);
     
    13401340        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("HostSerial#%d cannot create send thread"), pDrvIns->iInstance);
    13411341
    1342 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     1342#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    13431343    /* Linux & darwin needs a separate thread which monitors the status lines. */
    13441344# ifndef RT_OS_LINUX
     
    13831383    pThis->SendSem = NIL_RTSEMEVENT;
    13841384
    1385 #if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
     1385#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    13861386
    13871387    if (pThis->WakeupPipeW != NIL_RTFILE)
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