VirtualBox

Ignore:
Timestamp:
Apr 18, 2019 12:07:07 AM (6 years ago)
Author:
vboxsync
Message:

Merge first stage of the Chromium cleanup from the branch:

  • r129818 (Remove VBOX_WITH_CR_DISPLAY_LISTS and accompanying code as it was disabled since r108676 and was never brought back (see ​bugref:3456 and ​bugref:8485))
  • r129819 (HostServices/SharedOpenGL: Remove unused main entry point from upstream server process based implementation)
  • r129820 (HostServices/SharedOpenGL: Started eliminating all backends other than HGCM. They are not used and probably wouldn't work anymore anyway)
  • r129821 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill crTimer* API as it is not used anywhere)
  • r129822 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill most from cr_process.h apart from two used methods)
  • r129823 (HostServices/SharedOpenGL,GuestHost/OpenGLAdditions/common/crOpenGL: Kill crList* API as it is unused)
  • r129824 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill crHullInteriorBox API as it is unused)
  • r129825 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill crWarpPoint API as it is unused)
  • r129826 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill CrSa* API as it is unused and not even compiled in)
  • r129827 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Kill cr_bbox.h as it is unused)
  • r129828 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove a few crParseUrl() two uses)
  • r129829 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove last crParseURL() use)
  • r129830 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove crParseURL())
  • r129831 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove VBOX_WITH_COCOA_QT and related code when not set as it is the default for years now and we don't support anything else anymore)
  • r129832 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_logo.h)
  • r129833 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused crut_api.h and crut_clientapi.h)
  • r129834 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_dmx.h)
  • r129835 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused cr_perf.h)
  • r129836 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove cr_rand.h and friends as it is not actively used anywhere)
  • r129837 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of all the swapped versions in the packer SPU, we never change endianess from guest to host and don't need it)
  • r129838 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129839 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129840 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused pack_pica.c)
  • r129841 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove more swapper versions in the packer related code)
  • r129842 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of cr_endianess.h and friends)
  • r129843 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused lowercase.py)
  • r129844 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused cr_calllists.h and friends)
  • r129845 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of completely unused idpool.c, not even compiled in)
  • r129846 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused cr_debugopcodes.h and friends)
  • r129847 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Make the cr_mem.h API inline and get rid of the implementation in the util library)
  • r129848 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of SPUOptions and related code as it is of no use for us)
  • r129849 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of cr_environment.h and friends and convert usage to RTEnv* APIs)
  • r129850 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of unused renderspu_agl.c)
  • r129851 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Remove unused code in cr_htable.h)
  • r129853 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Introduce a state paremeter for the unpacker workers instead of reyling on global variables, work in progress)
  • r129854 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Let the caller of crUnpack set up the initial state. This allows to get rid of the global return_ptr and writeback_ptr as they get supplied in the unpacker state by the server)
  • r129855 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of the cr_lastDispatch and cr_unpackDispatch as they are of no use now)
  • r129856 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Get rid of the global cr_unpackData and cr_unpackDataEnd symbols by indtroducing another hack to make it possible for certail server dispatch callbacks to access the data buffer)
  • r129857 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: build fix for release builds)
  • r129858 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Make the pointer to the unpacker state non const (is required for the access verification))
  • r129859 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: First iteration of the buffer size validation to prevent out of bound read access + added todos for places where additional checks are needed)
  • r129860 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129861 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129871 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129872 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Stop as soon as the unpacker encountered an error)
  • r129876 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129880 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Working on remaining verification todos)
  • r129882 (HostServices/SharedOpenGL,GuestHost/OpenGL,Additions/common/crOpenGL: Fixed some offsets in unpack_texture.c, 3DMark03 renders correctly again)
  • r130013 (HostServices/SharedOpenGL: Convert files to C++ so we can use C99 featuers on Windows with cl.exe)
  • r130014 (HostServices/SharedOpenGL,GuestHost/OpenGL: WIndows build fixes)
  • r130015 (HostServices/SharedOpenGL,GuestHost/OpenGL: More Windows build fixes)
  • r130036 (Config.kmk: Fix linker error on Windows by temporarily disabling the use of VBoxGuestR3DllMinW2K)
  • r130094 (src/VBox/GuestHost/OpenGL: Revert inlining the allocation/free functions in R3 completely as it doesn't work on Windows if memory is allocated and freed across different DLLs which don't share a common CRT, causes crashes in RtlValidtaeHeap())
  • r130095 (src/VBox/GuestHost/OpenGL,src/VBox/Additions/common/crOpenGL/pack: Don't use floating point specifiers in packspu_GetString() to avoid R6002 errors (couldn't fully understand why they occur suddenly after the rework but this gets rid of it))
Location:
trunk
Files:
1 added
19 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        99/branches/VBox-5.1:112367,115992,116543,116550,116568,116573
        1010/branches/VBox-5.2:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124260,124263,124271,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812
         11/branches/aeichner/vbox-chromium-cleanup:129816,129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130036,130094-130095
        1112/branches/andy/draganddrop:90781-91268
        1213/branches/andy/guestctrl20:78916,78930
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        99/branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573
        1010/branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180
         11/branches/aeichner/vbox-chromium-cleanup/src/VBox:129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130094-130095
        1112/branches/andy/draganddrop/src/VBox:90781-91268
        1213/branches/andy/guestctrl20/src/VBox:78916,78930
  • trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp

    r78116 r78190  
    3434# include "cr_error.h"
    3535# include "cr_net.h"
    36 # include "cr_rand.h"
    3736# include "cr_mem.h"
    3837# include "cr_string.h"
  • trunk/src/VBox/GuestHost/OpenGL/util/error.c

    r76553 r78190  
    2525#include <iprt/buildconfig.h>
    2626
     27
    2728#include <VBox/log.h>
     29#include <iprt/env.h>
    2830
    2931#ifdef RT_OS_WINDOWS
    3032# include <iprt/win/windows.h>
    31 # include "cr_environment.h"
    3233# include "cr_error.h"
    3334# include "VBox/VBoxGuestLib.h"
     
    100101    /* Log last error on windows. */
    101102    dwLastErr = GetLastError();
    102     if (dwLastErr != 0 && crGetenv("CR_WINDOWS_ERRORS") != NULL)
     103    if (dwLastErr != 0 && RTEnvGet("CR_WINDOWS_ERRORS") != NULL)
    103104    {
    104105        LPTSTR pszWindowsMessage;
  • trunk/src/VBox/GuestHost/OpenGL/util/htable.cpp

    r76553 r78190  
    2828#include "cr_error.h"
    2929#include "cr_net.h"
    30 #include "cr_rand.h"
    3130#include "cr_mem.h"
    3231#include "cr_string.h"
  • trunk/src/VBox/GuestHost/OpenGL/util/net.c

    r69392 r78190  
    2222#include "cr_error.h"
    2323#include "cr_string.h"
    24 #include "cr_url.h"
    2524#include "cr_net.h"
    2625#include "cr_netserver.h"
    2726#include "cr_pixeldata.h"
    28 #include "cr_environment.h"
    29 #include "cr_endian.h"
    3027#include "cr_bufpool.h"
    3128#include "cr_threads.h"
     
    4744
    4845    /* Number of connections using each type of interface: */
    49     int                  use_tcpip;
    50     int                  use_ib;
    51     int                  use_file;
    52     int                  use_udp;
    53     int                  use_gm;
    54     int                  use_sdp;
    55     int                  use_teac;
    56     int                  use_tcscomm;
    5746    int                  use_hgcm;
    5847
     
    6049
    6150#ifdef CHROMIUM_THREADSAFE
    62     CRmutex          mutex;
    63 #endif
    64     int                  my_rank;  /* Teac/TSComm only */
     51    CRmutex              mutex;
     52#endif
    6553} cr_net;
    6654
     
    7361 */
    7462static void
    75 InitConnection(CRConnection *conn, const char *protocol, unsigned int mtu
     63InitConnection(CRConnection *conn
    7664#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
    7765                , struct VBOXUHGSMI *pHgsmi
     
    7967        )
    8068{
    81     if (!crStrcmp(protocol, "devnull"))
    82     {
    83         crDevnullInit(cr_net.recv_list, cr_net.close_list, mtu);
    84         crDevnullConnection(conn);
    85     }
    86     else if (!crStrcmp(protocol, "file"))
    87     {
    88         cr_net.use_file++;
    89         crFileInit(cr_net.recv_list, cr_net.close_list, mtu);
    90         crFileConnection(conn);
    91     }
    92     else if (!crStrcmp(protocol, "swapfile"))
    93     {
    94         /* file with byte-swapping */
    95         cr_net.use_file++;
    96         crFileInit(cr_net.recv_list, cr_net.close_list, mtu);
    97         crFileConnection(conn);
    98         conn->swap = 1;
    99     }
    100     else if (!crStrcmp(protocol, "tcpip"))
    101     {
    102         cr_net.use_tcpip++;
    103         crTCPIPInit(cr_net.recv_list, cr_net.close_list, mtu);
    104         crTCPIPConnection(conn);
    105     }
    106     else if (!crStrcmp(protocol, "udptcpip"))
    107     {
    108         cr_net.use_udp++;
    109         crUDPTCPIPInit(cr_net.recv_list, cr_net.close_list, mtu);
    110         crUDPTCPIPConnection(conn);
    111     }
    11269#ifdef VBOX_WITH_HGCM
    113     else if (!crStrcmp(protocol, "vboxhgcm"))
    114     {
    115         cr_net.use_hgcm++;
    116         crVBoxHGCMInit(cr_net.recv_list, cr_net.close_list, mtu);
    117         crVBoxHGCMConnection(conn
    118 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
    119                     , pHgsmi
    120 #endif
    121                 );
    122     }
    123 #endif
    124 #ifdef GM_SUPPORT
    125     else if (!crStrcmp(protocol, "gm"))
    126     {
    127         cr_net.use_gm++;
    128         crGmInit(cr_net.recv_list, cr_net.close_list, mtu);
    129         crGmConnection(conn);
    130     }
    131 #endif
    132 #ifdef TEAC_SUPPORT
    133     else if (!crStrcmp(protocol, "quadrics"))
    134     {
    135         cr_net.use_teac++;
    136         crTeacInit(cr_net.recv_list, cr_net.close_list, mtu);
    137         crTeacConnection(conn);
    138     }
    139 #endif
    140 #ifdef TCSCOMM_SUPPORT
    141     else if (!crStrcmp(protocol, "quadrics-tcscomm"))
    142     {
    143         cr_net.use_tcscomm++;
    144         crTcscommInit(cr_net.recv_list, cr_net.close_list, mtu);
    145         crTcscommConnection(conn);
    146     }
    147 #endif
    148 #ifdef SDP_SUPPORT
    149     else if (!crStrcmp(protocol, "sdp"))
    150     {
    151         cr_net.use_sdp++;
    152         crSDPInit(cr_net.recv_list, cr_net.close_list, mtu);
    153         crSDPConnection(conn);
    154     }
    155 #endif
    156 #ifdef IB_SUPPORT
    157     else if (!crStrcmp(protocol, "ib"))
    158     {
    159         cr_net.use_ib++;
    160         crDebug("Calling crIBInit()");
    161         crIBInit(cr_net.recv_list, cr_net.close_list, mtu);
    162         crIBConnection(conn);
    163         crDebug("Done Calling crIBInit()");
    164     }
    165 #endif
    166 #ifdef HP_MULTICAST_SUPPORT
    167     else if (!crStrcmp(protocol, "hpmc"))
    168     {
    169         cr_net.use_hpmc++;
    170         crHPMCInit(cr_net.recv_list, cr_net.close_list, mtu);
    171         crHPMCConnection(conn);
    172     }
    173 #endif
    174     else
    175     {
    176         crError("Unknown protocol: \"%s\"", protocol);
    177     }
     70    cr_net.use_hgcm++;
     71    crVBoxHGCMInit(cr_net.recv_list, cr_net.close_list);
     72    crVBoxHGCMConnection(conn
     73#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     74                         , pHgsmi
     75#endif
     76                         );
     77#endif
    17878}
    17979
     
    19292 *                the mothership
    19393 */
    194 CRConnection * crNetConnectToServer( const char *server, unsigned short default_port, int mtu, int broker
     94CRConnection * crNetConnectToServer( const char *server, int mtu, int broker
    19595#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
    19696                , struct VBOXUHGSMI *pHgsmi
     
    19898)
    19999{
    200     char hostname[4096], protocol[4096];
    201     unsigned short port;
    202100    CRConnection *conn;
    203101
    204     crDebug( "In crNetConnectToServer( \"%s\", port=%d, mtu=%d, broker=%d )",
    205                      server, default_port, mtu, broker );
     102    crDebug( "In crNetConnectToServer( \"%s\", mtu=%d, broker=%d )",
     103                     server, mtu, broker );
    206104
    207105    CRASSERT( cr_net.initialized );
     
    212110                         "but the minimum MTU is %d", server, mtu, CR_MINIMUM_MTU );
    213111    }
    214 
    215     /* Tear the URL apart into relevant portions. */
    216     if ( !crParseURL( server, protocol, hostname, &port, default_port ) ) {
    217          crError( "Malformed URL: \"%s\"", server );
    218     }
    219 
    220     /* If the host name is "localhost" replace it with the _real_ name
    221      * of the localhost.  If we don't do this, there seems to be
    222      * confusion in the mothership as to whether or not "localhost" and
    223      * "foo.bar.com" are the same machine.
    224      */
    225     if (crStrcmp(hostname, "localhost") == 0) {
    226         int rv = crGetHostname(hostname, 4096);
    227         CRASSERT(rv == 0);
    228         (void) rv;
    229     }
    230 
    231     /* XXX why is this here???  I think it could be moved into the
    232      * crTeacConnection() function with no problem. I.e. change the
    233      * connection's port, teac_rank and tcscomm_rank there.  (BrianP)
    234      */
    235     if ( !crStrcmp( protocol, "quadrics" ) ||
    236          !crStrcmp( protocol, "quadrics-tcscomm" ) ) {
    237       /* For Quadrics protocols, treat "port" as "rank" */
    238       if ( port > CR_QUADRICS_HIGHEST_RANK ) {
    239         crWarning( "Invalid crserver rank, %d, defaulting to %d\n",
    240                port, CR_QUADRICS_LOWEST_RANK );
    241         port = CR_QUADRICS_LOWEST_RANK;
    242       }
    243     }
    244     crDebug( "Connecting to %s on port %d, with protocol %s",
    245                      hostname, port, protocol );
    246 
    247 #ifdef SDP_SUPPORT
    248     /* This makes me ill, but we need to "fix" the hostname for sdp. MCH */
    249     if (!crStrcmp(protocol, "sdp")) {
    250         char* temp;
    251         temp = strtok(hostname, ".");
    252         crStrcat(temp, crGetSDPHostnameSuffix());
    253         crStrcpy(hostname, temp);
    254         crDebug("SDP rename hostname: %s", hostname);   
    255     }
    256 #endif
    257112
    258113    conn = (CRConnection *) crCalloc( sizeof(*conn) );
     
    263118    conn->type               = CR_NO_CONNECTION; /* we don't know yet */
    264119    conn->recv_credits       = CR_INITIAL_RECV_CREDITS;
    265     conn->hostname           = crStrdup( hostname );
    266     conn->port               = port;
    267120    conn->mtu                = mtu;
    268121    conn->buffer_size        = mtu;
    269122    conn->broker             = broker;
    270     conn->endianness         = crDetermineEndianness();
    271     /* XXX why are these here??? Move them into the crTeacConnection()
    272      * and crTcscommConnection() functions.
    273      */
    274     conn->teac_id            = -1;
    275     conn->teac_rank          = port;
    276     conn->tcscomm_id         = -1;
    277     conn->tcscomm_rank       = port;
    278123
    279124    crInitMessageList(&conn->messageList);
    280125
    281126    /* now, just dispatch to the appropriate protocol's initialization functions. */
    282     InitConnection(conn, protocol, mtu
     127    InitConnection(conn
    283128#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
    284129                , pHgsmi
     
    311156)
    312157{
    313     /*
    314     unsigned int len = sizeof(CRMessageNewClient);
    315     CRMessageNewClient msg;
    316 
    317     CRASSERT( conn );
    318 
    319     if (conn->swap)
    320         msg.header.type = (CRMessageType) SWAP32(CR_MESSAGE_NEWCLIENT);
    321     else
    322         msg.header.type = CR_MESSAGE_NEWCLIENT;
    323 
    324     crNetSend( conn, NULL, &msg, len );
    325     */
    326 
    327158    crNetServerConnect( ns
    328159#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    349180    CRConnection *conn;
    350181
     182    RT_NOREF(hostname);
    351183    CRASSERT( cr_net.initialized );
    352184
     
    358190    conn->type               = CR_NO_CONNECTION; /* we don't know yet */
    359191    conn->recv_credits       = CR_INITIAL_RECV_CREDITS;
    360     conn->port               = port;
    361192    conn->mtu                = mtu;
    362193    conn->buffer_size        = mtu;
    363194    conn->broker             = broker;
    364     conn->endianness         = crDetermineEndianness();
    365     conn->teac_id            = -1;
    366     conn->teac_rank          = -1;
    367     conn->tcscomm_id         = -1;
    368     conn->tcscomm_rank       = -1;
    369195
    370196    crInitMessageList(&conn->messageList);
     
    374200                    protocol, (int) port, (int) mtu);
    375201
    376     /* special case */
    377     if ( !crStrncmp( protocol, "file", crStrlen( "file" ) ) ||
    378              !crStrncmp( protocol, "swapfile", crStrlen( "swapfile" ) ) )
    379     {
    380         char filename[4096];
    381     char protocol_only[4096];
    382 
    383         cr_net.use_file++;
    384         if (!crParseURL(protocol, protocol_only, filename, NULL, 0))
    385         {
    386             crError( "Malformed URL: \"%s\"", protocol );
    387         }
    388         conn->hostname = crStrdup( filename );
    389 
    390     /* call the protocol-specific init routines */  /* ktd (add) */
    391     InitConnection(conn, protocol_only, mtu
     202    /* call the protocol-specific init routines */
     203      InitConnection(conn
    392204#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
    393205                , NULL
    394206#endif
    395             );       /* ktd (add) */
    396     }
    397     else {
    398     /* call the protocol-specific init routines */
    399       InitConnection(conn, protocol, mtu
    400 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
    401                 , NULL
    402 #endif
    403207              );
    404     }
    405 
    406     crNetAccept( conn, hostname, port );
     208
     209    crNetAccept(conn);
    407210    return conn;
    408211}
     
    416219{
    417220    conn->Disconnect(conn);
    418     crFree( conn->hostname );
    419221    #ifdef CHROMIUM_THREADSAFE
    420222        crFreeMutex( &conn->messageList.lock );
     
    440242    else
    441243    {
    442 #ifdef WINDOWS
    443         /** @todo do we actually need that WSA stuff with VBox at all? */
    444         WORD wVersionRequested = MAKEWORD(2, 0);
    445         WSADATA wsaData;
    446         int err;
    447 
    448         err = WSAStartup(wVersionRequested, &wsaData);
    449         if (err != 0)
    450             crError("Couldn't initialize sockets on WINDOWS");
    451 #endif
    452 
    453         cr_net.use_gm      = 0;
    454         cr_net.use_udp     = 0;
    455         cr_net.use_tcpip   = 0;
    456         cr_net.use_sdp     = 0;
    457         cr_net.use_tcscomm = 0;
    458         cr_net.use_teac    = 0;
    459         cr_net.use_file    = 0;
    460244        cr_net.use_hgcm    = 0;
    461245        cr_net.num_clients = 0;
     
    555339    CRConnection **c;
    556340
    557     c = crTCPIPDump( num );
    558     if ( c ) return c;
    559 
    560     c = crDevnullDump( num );
    561     if ( c ) return c;
    562 
    563     c = crFileDump( num );
    564     if ( c ) return c;
    565 
    566341#ifdef VBOX_WITH_HGCM
    567342    c = crVBoxHGCMDump( num );
    568     if ( c ) return c;
    569 #endif
    570 #ifdef GM_SUPPORT
    571     c = crGmDump( num );
    572     if ( c ) return c;
    573 #endif
    574 #ifdef IB_SUPPORT
    575     c = crIBDump( num );
    576     if ( c ) return c;
    577 #endif
    578 #ifdef SDP_SUPPORT
    579     c = crSDPDump( num );
    580343    if ( c ) return c;
    581344#endif
     
    866629)
    867630{
    868     ns->conn = crNetConnectToServer( ns->name, DEFAULT_SERVER_PORT,
     631    ns->conn = crNetConnectToServer( ns->name,
    869632                                     ns->buffer_size, 0
    870633#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    890653{
    891654    conn->Disconnect( conn );
    892     crFree( conn->hostname );
    893655#ifdef CHROMIUM_THREADSAFE
    894656    crFreeMutex( &conn->messageList.lock );
     
    902664 * Apparently, this is only called from the crNetConnectToServer function.
    903665 */
    904 void crNetAccept( CRConnection *conn, const char *hostname, unsigned short port )
    905 {
    906     conn->Accept( conn, hostname, port );
     666void crNetAccept( CRConnection *conn)
     667{
     668    conn->Accept( conn);
    907669}
    908670
     
    916678void crNetSingleRecv( CRConnection *conn, void *buf, unsigned int len )
    917679{
    918     if (conn->type != CR_TCPIP)
    919     {
    920         crError( "Can't do a crNetSingleReceive on anything other than TCPIP." );
    921     }
     680    /** @todo Remove after users have been identified and eliminated .*/
     681    crError( "Can't do a crNetSingleReceive on anything other than TCPIP." );
    922682    conn->Recv( conn, buf, len );
    923683}
     
    987747{
    988748    CRASSERT( len == sizeof(CRMessageFlowControl) );
    989     conn->send_credits += (conn->swap ? SWAP32(msg->credits) : msg->credits);
     749    conn->send_credits += msg->credits;
    990750    conn->InstantReclaim( conn, (CRMessage *) msg );
    991751}
     
    1095855        case CR_MESSAGE_OPCODES:
    1096856        case CR_MESSAGE_OOB:
    1097             {
    1098                 /*CRMessageOpcodes *ops = (CRMessageOpcodes *) msg;
    1099                  *unsigned char *data_ptr = (unsigned char *) ops + sizeof( *ops) + ((ops->numOpcodes + 3 ) & ~0x03);
    1100                  *crDebugOpcodes( stdout, data_ptr-1, ops->numOpcodes ); */
    1101             }
    1102857            break;
    1103858        case CR_MESSAGE_READ_PIXELS:
     
    12511006void crNetReadline( CRConnection *conn, void *buf )
    12521007{
    1253     char *temp, c;
     1008    RT_NOREF(buf);
    12541009
    12551010    if (!conn || conn->type == CR_NO_CONNECTION)
    12561011        return;
    12571012
    1258     if (conn->type != CR_TCPIP)
    1259     {
    1260         crError( "Can't do a crNetReadline on anything other than TCPIP (%d).",conn->type );
    1261     }
    1262     temp = (char*)buf;
    1263     for (;;)
    1264     {
    1265         conn->Recv( conn, &c, 1 );
    1266         if (c == '\n')
    1267         {
    1268             *temp = '\0';
    1269             return;
    1270         }
    1271         *(temp++) = c;
    1272     }
     1013    /** @todo Remove after users have been found and eliminated. */
     1014    crError( "Can't do a crNetReadline on anything other than TCPIP (%d).",conn->type );
    12731015}
    12741016
     
    13011043    int found_work = 0;
    13021044
    1303     if ( cr_net.use_tcpip )
    1304         found_work += crTCPIPRecv();
    13051045#ifdef VBOX_WITH_HGCM
    13061046    if ( cr_net.use_hgcm )
     
    13111051                );
    13121052#endif
    1313 #ifdef SDP_SUPPORT
    1314     if ( cr_net.use_sdp )
    1315         found_work += crSDPRecv();
    1316 #endif
    1317 #ifdef IB_SUPPORT
    1318     if ( cr_net.use_ib )
    1319         found_work += crIBRecv();
    1320 #endif
    1321     if ( cr_net.use_udp )
    1322         found_work += crUDPTCPIPRecv();
    1323    
    1324     if ( cr_net.use_file )
    1325         found_work += crFileRecv();
    1326 
    1327 #ifdef GM_SUPPORT
    1328     if ( cr_net.use_gm )
    1329         found_work += crGmRecv();
    1330 #endif
    1331 
    1332 #ifdef TEAC_SUPPORT
    1333     if ( cr_net.use_teac )
    1334         found_work += crTeacRecv();
    1335 #endif
    1336 
    1337 #ifdef TCSCOMM_SUPPORT
    1338     if ( cr_net.use_tcscomm )
    1339         found_work += crTcscommRecv();
    1340 #endif
    13411053
    13421054    return found_work;
    13431055}
    13441056
    1345 
    1346 /**
    1347  * Teac/TSComm only
    1348  */
    1349 void
    1350 crNetSetRank( int my_rank )
    1351 {
    1352     cr_net.my_rank = my_rank;
    1353 #ifdef TEAC_SUPPORT
    1354     crTeacSetRank( cr_net.my_rank );
    1355 #endif
    1356 #ifdef TCSCOMM_SUPPORT
    1357     crTcscommSetRank( cr_net.my_rank );
    1358 #endif
    1359 }
    1360 
    1361 /**
    1362  * Teac/TSComm only
    1363  */
    1364 void
    1365 crNetSetContextRange( int low_context, int high_context )
    1366 {
    1367 #if !defined(TEAC_SUPPORT) && !defined(TCSCOMM_SUPPORT)
    1368     (void)low_context; (void)high_context;
    1369 #endif
    1370 #ifdef TEAC_SUPPORT
    1371     crTeacSetContextRange( low_context, high_context );
    1372 #endif
    1373 #ifdef TCSCOMM_SUPPORT
    1374     crTcscommSetContextRange( low_context, high_context );
    1375 #endif
    1376 }
    1377 
    1378 /**
    1379  * Teac/TSComm only
    1380  */
    1381 void
    1382 crNetSetNodeRange( const char *low_node, const char *high_node )
    1383 {
    1384 #if !defined(TEAC_SUPPORT) && !defined(TCSCOMM_SUPPORT)
    1385     (void)low_node; (void)high_node;
    1386 #endif
    1387 #ifdef TEAC_SUPPORT
    1388     crTeacSetNodeRange( low_node, high_node );
    1389 #endif
    1390 #ifdef TCSCOMM_SUPPORT
    1391     crTcscommSetNodeRange( low_node, high_node );
    1392 #endif
    1393 }
    1394 
    1395 /**
    1396  * Teac/TSComm only
    1397  */
    1398 void
    1399 crNetSetKey( const unsigned char* key, const int keyLength )
    1400 {
    1401 #ifdef TEAC_SUPPORT
    1402     crTeacSetKey( key, keyLength );
    1403 #else
    1404     (void)key; (void)keyLength;
    1405 #endif
    1406 }
  • trunk/src/VBox/GuestHost/OpenGL/util/net_internals.h

    r63199 r78190  
    1010
    1111/*
    12  * DevNull network interface
    13  */
    14 extern void crDevnullInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    15 extern void crDevnullConnection( CRConnection *conn );
    16 extern int crDevnullRecv( void );
    17 extern CRConnection** crDevnullDump( int *num );
    18 
    19 
    20 /*
    21  * File network interface
    22  */
    23 extern void crFileInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    24 extern void crFileConnection( CRConnection *conn );
    25 extern int crFileRecv( void );
    26 extern CRConnection** crFileDump( int *num );
    27 
    28 
    29 /*
    30  * TCP/IP network interface
    31  */
    32 typedef enum {
    33     CRTCPIPMemory,
    34     CRTCPIPMemoryBig
    35 } CRTCPIPBufferKind;
    36 
    37 #define CR_TCPIP_BUFFER_MAGIC 0x89134532
    38 
    39 typedef struct CRTCPIPBuffer {
    40     unsigned int          magic;
    41     CRTCPIPBufferKind     kind;
    42     unsigned int          len;
    43     unsigned int          allocated;
    44     unsigned int          pad;  /* may be clobbered by crTCPIPSend() */
    45 } CRTCPIPBuffer;
    46 
    47 typedef struct {
    48     int                  initialized;
    49     int                  num_conns;
    50     CRConnection         **conns;
    51     CRBufferPool         *bufpool;
    52 #ifdef CHROMIUM_THREADSAFE
    53     CRmutex              mutex;
    54     CRmutex              recvmutex;
    55 #endif
    56     CRNetReceiveFuncList *recv_list;
    57     CRNetCloseFuncList *close_list;
    58     CRSocket             server_sock;
    59 } cr_tcpip_data;
    60 
    61 extern cr_tcpip_data cr_tcpip;
    62 
    63 extern void crTCPIPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    64 extern void crTCPIPConnection( CRConnection *conn );
    65 extern int crTCPIPRecv( void );
    66 extern CRConnection** crTCPIPDump( int *num );
    67 extern int crTCPIPDoConnect( CRConnection *conn );
    68 extern void crTCPIPDoDisconnect( CRConnection *conn );
    69 extern int crTCPIPErrno( void );
    70 extern char *crTCPIPErrorString( int err );
    71 extern void crTCPIPAccept( CRConnection *conn, const char *hostname, unsigned short port );
    72 extern void crTCPIPWriteExact( CRConnection *conn, const void *buf, unsigned int len );
    73 extern void crTCPIPFree( CRConnection *conn, void *buf );
    74 extern void *crTCPIPAlloc( CRConnection *conn );
    75 extern void crTCPIPReadExact( CRConnection *conn, void *buf, unsigned int len );
    76 extern int __tcpip_write_exact( CRSocket sock, const void *buf, unsigned int len );
    77 extern int __tcpip_read_exact( CRSocket sock, void *buf, unsigned int len );
    78 extern void __tcpip_dead_connection( CRConnection *conn );
    79 extern int __crSelect( int n, fd_set *readfds, int sec, int usec );
    80 
    81 
    82 /*
    83  * UDP network interface
    84  */
    85 extern void crUDPTCPIPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    86 extern void crUDPTCPIPConnection( CRConnection *conn );
    87 extern int crUDPTCPIPRecv( void );
    88 
    89 /*
    9012 * VirtualBox HGCM
    9113 */
    9214#ifdef VBOX_WITH_HGCM
    93 extern void crVBoxHGCMInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
     15extern void crVBoxHGCMInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl);
    9416extern void crVBoxHGCMConnection( CRConnection *conn
    9517#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
     
    11133#endif
    11234
    113 /*
    114  * TEAC network interface
    115  */
    116 #ifdef TEAC_SUPPORT
    117 extern void crTeacInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl,
    118             unsigned int mtu );
    119 extern void crTeacConnection( CRConnection *conn );
    120 extern int crTeacRecv( void );
    121 extern void crTeacSetRank( int );
    122 extern void crTeacSetContextRange( int, int );
    123 extern void crTeacSetNodeRange( const char *, const char * );
    124 extern void crTeacSetKey( const unsigned char *key, const int keyLength );
    125 #endif /* TEAC_SUPPORT */
    126 
    127 
    128 /*
    129  * Tcscomm network interface
    130  */
    131 #ifdef TCSCOMM_SUPPORT
    132 extern void crTcscommInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl,
    133                            unsigned int mtu );
    134 extern void crTcscommConnection( CRConnection *conn );
    135 extern int crTcscommRecv( void );
    136 #endif /* TCSCOMM_SUPPORT */
    137 
    138 
    139 /*
    140  * SDP network interface
    141  */
    142 #ifdef SDP_SUPPORT
    143 extern const char *crGetSDPHostnameSuffix(void);
    144 extern void crSDPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    145 extern void crSDPConnection( CRConnection *conn );
    146 extern int crSDPRecv( void );
    147 extern CRConnection** crSDPDump( int *num );
    148 #endif /* SDP_SUPPORT */
    149 
    150 
    151 /*
    152  * Infiniband network interface
    153  */
    154 #ifdef IB_SUPPORT
    155 extern void crIBInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    156 extern void crIBConnection( CRConnection *conn );
    157 extern int crIBRecv( void );
    158 extern CRConnection** crIBDump( int *num );
    159 #endif /* IB_SUPPORT */
    160 
    161 
    162 /*
    163  * GM network interface
    164  */
    165 #ifdef GM_SUPPORT
    166 extern void crGmInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );
    167 extern void crGmConnection( CRConnection *conn );
    168 extern int crGmRecv( void );
    169 extern CRConnection** crGmDump( int *num );
    170 extern int crGmDoConnect( CRConnection *conn );
    171 extern void crGmDoDisconnect( CRConnection *conn );
    172 extern int crGmErrno( void );
    173 extern char *crGmErrorString( int err );
    174 extern void crGmAccept( CRConnection *conn, const char *hostname, unsigned short port );
    175 extern void crGmSendExact( CRConnection *conn, const void *buf, unsigned int len );
    176 extern void crGmFree( CRConnection *conn, void *buf );
    177 extern void *crGmAlloc( CRConnection *conn );
    178 extern void crGmReadExact( CRConnection *conn, void *buf, unsigned int len );
    179 extern void crGmBogusRecv( CRConnection *conn, void *buf, unsigned int len );
    180 extern void crGmHandleNewMessage( CRConnection *conn, CRMessage *msg, unsigned int len );
    181 extern void crGmInstantReclaim( CRConnection *conn, CRMessage *msg );
    182 extern unsigned int crGmNodeId( void );
    183 extern unsigned int crGmPortNum( void );
    184 #endif /* GM_SUPPORT */
    185 
    186 
    18735extern CRConnection** crNetDump( int *num );
    18836
  • trunk/src/VBox/GuestHost/OpenGL/util/process.c

    r63199 r78190  
    2222#define snprintf _snprintf
    2323#endif
    24 
    25 /**
    26  * Sleep/pause for the given number of seconds.
    27  */
    28 void crSleep( unsigned int seconds )
    29 {
    30 #ifdef WINDOWS
    31   Sleep(seconds*1000); /* milliseconds */
    32 #else
    33   sleep(seconds);
    34 #endif
    35 }
    36 
    37 /**
    38  * Sleep/pause for the given number of milliseconds.
    39  */
    40 void crMsleep( unsigned int msec )
    41 {
    42 #ifdef WINDOWS
    43      Sleep(msec);
    44 #else
    45      usleep(msec*1000); /* usecs */
    46 #endif
    47 }
    48 
    49 
    50 /*
    51  * Spawn (i.e. fork/exec) a new process.
    52  */
    53 CRpid crSpawn( const char *command, const char *argv[] )
    54 {
    55 #ifdef WINDOWS
    56         char newargv[1000];
    57         int i;
    58         STARTUPINFO si;
    59         PROCESS_INFORMATION pi;
    60 
    61         (void) command;
    62 
    63         ZeroMemory( &si, sizeof(si) );
    64         si.cb = sizeof(si);
    65         ZeroMemory( &pi, sizeof(pi) );
    66 
    67         crStrncpy(newargv, argv[0], 1000 );
    68         for (i = 1; argv[i]; i++) {
    69                 crStrcat(newargv, " ");
    70                 crStrcat(newargv, argv[i]);
    71         }
    72 
    73         if ( !CreateProcess(NULL, newargv, NULL, NULL, FALSE, 0, NULL,
    74                                 NULL, &si, &pi) )
    75         {
    76                 crWarning("crSpawn failed, %d", GetLastError());
    77                 return 0;
    78         }
    79         return pi.hProcess;
    80 #else
    81         pid_t pid;
    82         if ((pid = fork()) == 0)
    83         {
    84                 /* I'm the child */
    85                 int err = execvp(command, (char * const *) argv);
    86                 crWarning("crSpawn failed (return code: %d)", err);
    87                 return 0;
    88         }
    89         return (unsigned long) pid;
    90 #endif
    91 }
    92 
    93 
    94 /*
    95  * Kill the named process.
    96  */
    97 void crKill( CRpid pid )
    98 {
    99 #ifdef WINDOWS
    100         TerminateProcess( pid, 0 );
    101 #else
    102         kill((pid_t) pid, SIGKILL);
    103 #endif
    104 }
    105 
    10624
    10725/*
     
    208126
    209127
    210 /*
    211  * Return current directory string.
    212  */
    213 void crGetCurrentDir( char *dir, int maxLen )
    214 {
    215 #ifdef WINDOWS
    216   if (!GetCurrentDirectory(maxLen, dir))
    217         dir[0] = 0;
    218 #else
    219   if (!getcwd(dir, maxLen))
    220         dir[0] = 0;
    221 #endif
    222 }
    223 
    224 
    225128/**
    226129 * Return current process ID number.
  • trunk/src/VBox/GuestHost/OpenGL/util/util.def

    r69392 r78190  
    1212crDebug
    1313crInfo
    14 crParseURL
    15 crAlloc
    16 crCalloc
    17 crAllocDebug
    18 crCallocDebug
    19 crRealloc
    20 crMemset
    21 crFree
    2214crStrSplit
    2315crStrSplitn
     
    4335crBytesToString
    4436crWordsToString
    45 crGetHostname
    4637crGetPID
    4738crNetAcceptClient
     
    7465crImageSize
    7566crTextureSize
    76 crGetenv
    77 crSetenv
    7867crHashtableAdd
    7968crHashtableDelete
     
    9079crFreeHashtableEx
    9180crHashtableGetDataKey
    92 crDetermineEndianness
    93 SWAPDOUBLE
    9481crBufferPoolInit
    9582crBufferPoolPush
    9683crBufferPoolPop
    9784crBufferPoolFree
    98 crTimerNewTimer
    9985crBufferPoolGetNumBuffers
    10086crBufferPoolGetMaxBuffers
    101 crDestroyTimer
    102 crStartTimer
    103 crStopTimer
    104 crResetTimer
    105 crTimerTime
    106 crMemcpy
    107 crMemcmp
    108 crMemZero
    109 crCalloc
    11087crSetTSD
    11188crGetTSD
     
    129106crGetTSD
    130107crFreeTSD
    131 crRandFloat
    132 crRandInt
    133 crRandSeed
    134 crRandAutoSeed
    135 crTransformBBox
    136 crProjectBBox
    137 crRectiUnion
    138 crWarpPoint
    139 crHullInteriorBox
    140 crNetSetNodeRange
    141 crNetSetContextRange
    142 crNetSetRank
    143 crNetSetKey
    144 crSleep
    145 crSpawn
    146 crKill
    147108crGetProcName
    148 crGetCurrentDir
    149109crHashtableAllocKeys
    150110crHashtableDeleteBlock
  • trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c

    r76553 r78190  
    3232#include "cr_mem.h"
    3333#include "cr_string.h"
    34 #include "cr_endian.h"
    3534#include "cr_threads.h"
    3635#include "net_internals.h"
     
    11851184 * Called on host side only, to "accept" client connection
    11861185 */
    1187 static void crVBoxHGCMAccept( CRConnection *conn, const char *hostname, unsigned short port )
    1188 {
    1189     RT_NOREF(hostname, port);
     1186static void crVBoxHGCMAccept( CRConnection *conn)
     1187{
    11901188    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
    11911189    CRASSERT(conn && conn->pHostBuffer);
     
    20672065 * Called on host side only, to "accept" client connection
    20682066 */
    2069 static void crVBoxHGSMIAccept( CRConnection *conn, const char *hostname, unsigned short port )
     2067static void crVBoxHGSMIAccept( CRConnection *conn)
    20702068{
    20712069    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
     
    21862184#endif
    21872185
    2188 void crVBoxHGCMInit(CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu)
    2189 {
    2190     (void) mtu;
    2191 
     2186void crVBoxHGCMInit(CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl)
     2187{
    21922188    g_crvboxhgcm.recv_list = rfl;
    21932189    g_crvboxhgcm.close_list = cfl;
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