VirtualBox

Changeset 3888 in vbox for trunk/src


Ignore:
Timestamp:
Jul 26, 2007 4:26:39 PM (17 years ago)
Author:
vboxsync
Message:

Solaris.

Location:
trunk/src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Makefile.kmk

    r3765 r3888  
    442442endif
    443443
     444ifeq ($(BUILD_TARGET),solaris)
     445Drivers_SOURCES      := $(filter-out \
     446        Storage/DrvHost% \
     447        , $(Drivers_SOURCES))
     448Drivers_SOURCES.os2   =
     449endif
     450
    444451Drivers_SOURCES.win   = \
    445452        Network/DrvTAPWin32.cpp \
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r3621 r3888  
    3737SYSMODS.win     += VBoxDrv
    3838SYSMODS.os2     += VBoxDrv
     39SYSMODS.solaris += vboxdrv
    3940endif
    4041
     
    245246
    246247
     248#
     249# vboxdrv.o - The Solaris Kernel Module.
     250#
     251ifeq ($(BUILD_TARGET),solaris)
     252vboxdrv_TEMPLATE      = VBOXR0DRV
     253vboxdrv_DEFS          = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE
     254vboxdrv_INCS         := $(PATH_SUB_CURRENT)
     255vboxdrv_LIBS          = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
     256vboxdrv_SOURCES       = \
     257        $(BUILD_TARGET)/SUPDrv-$(BUILD_TARGET).c
     258#       SUPDRVShared.c
     259endif # solaris
     260
     261
    247262include $(PATH_KBUILD)/subfooter.kmk
    248263
  • trunk/src/VBox/HostDrivers/Support/SUPDRV.h

    r3672 r3888  
    9696#   include <iprt/string.h>
    9797
     98#elif defined(RT_OS_SOLARIS)
     99#   include <iprt/string.h>
     100
    98101#else
    99102#   error "unsupported OS."
     
    176179
    177180/* No log API in OS/2 only COM port. */
     181# define OSDBGPRINT(a) printf a
     182
     183
     184/*
     185 * Solaris
     186 */
     187#elif defined(RT_OS_SOLARIS)
    178188# define OSDBGPRINT(a) printf a
    179189
     
    577587    uint16_t                    Alignment; /**< Alignment */
    578588#endif
    579 #if defined(RT_OS_DARWIN) || defined(RT_OS_OS2)
     589#if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) || defined(RT_OS_SOLARIS)
    580590    /** Pointer to the next session with the same hash. */
    581591    PSUPDRVSESSION              pNextHash;
  • trunk/src/VBox/Runtime/Makefile.kmk

    r3707 r3888  
    396396        timesup.cpp \
    397397
     398RuntimeR3_SOURCES.solaris = \
     399        generic/RTDirQueryInfo-generic.cpp \
     400        generic/RTDirSetTimes-generic.cpp \
     401        generic/RTFileMove-generic.cpp \
     402        generic/RTLogWriteDebugger-generic.cpp \
     403        generic/RTTimerCreate-generic.cpp \
     404        generic/pathhost-generic.cpp \
     405        generic/sched-generic.cpp \
     406        generic/uuid-generic.cpp \
     407        r3/solaris/alloc-solaris.cpp \
     408        r3/posix/dir-posix.cpp \
     409        r3/posix/env-posix.cpp \
     410        r3/posix/fileio-posix.cpp \
     411        r3/posix/filelock-posix.cpp \
     412        r3/posix/fs-posix.cpp \
     413        r3/posix/ldrNative-posix.cpp \
     414        r3/posix/path-posix.cpp \
     415        r3/posix/process-posix.cpp \
     416        r3/posix/rand-posix.cpp \
     417        r3/posix/sems-posix.cpp \
     418        r3/posix/system-posix.cpp \
     419        r3/posix/thread-posix.cpp \
     420        r3/posix/time-posix.cpp \
     421        r3/posix/timelocal-posix.cpp \
     422        r3/posix/timer-posix.cpp \
     423        r3/posix/RTTimeNow-posix.cpp \
     424        generic/utf16locale-generic.cpp \
     425        r3/posix/utf8-posix.cpp \
     426        timesup.cpp \
     427
     428
    398429## PORTME: Porters add their selection of platform specific files for Ring-3 here.
    399430
     
    729760        r0drv/linux/thread-r0drv-linux.c
    730761
     762# SOLARISTODO - Todo for Solaris
     763# RuntimeR0Drv_SOURCES.solaris = \
     764#       generic/RTAssertDoBreakpoint-generic.cpp \
     765#       r0drv/solaris/alloc-r0drv-solaris.c \
     766#       r0drv/solaris/initterm-r0drv-solaris.c
     767
     768
    731769RuntimeR0Drv_SOURCES.win = \
    732770        generic/RTAssertDoBreakpoint-generic.cpp \
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r3672 r3888  
    126126# if defined(RT_OS_WINDOWS)
    127127#  include <Windows.h>
    128 # elif defined(RT_OS_LINUX)
     128# elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
    129129#  include <unistd.h>
    130130# elif defined(RT_OS_L4)
     
    300300        RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %ls\n", GetCommandLineW());
    301301
    302 # elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     302# elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)
    303303#  ifdef RT_OS_LINUX
    304304        FILE *pFile = fopen("/proc/self/cmdline", "r");
    305 #  else       
     305#  elif defined(RT_OS_SOLARIS)
     306        /*
     307         * I have a sinking feeling solaris' psinfo format could be different from cmdline
     308         * Must check at run time and possible just ignore this section for solaris
     309         */
     310        char szArgFileBuf[80];
     311        RTStrPrintf(szArgFileBuf, sizeof(szArgFileBuf), "/proc/%ld/psinfo", (long)getpid());
     312        FILE* pFile = fopen(szArgFileBuf, "r");
     313#  else /* RT_OS_FREEBSD: */
    306314        FILE *pFile = fopen("/proc/curproc/cmdline", "r");
    307 #  endif       
     315#  endif
    308316        if (pFile)
    309317        {
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r2981 r3888  
    4444#include "internal/path.h"
    4545
     46#if !defined(RT_OS_SOLARIS)
     47# define HAVE_DIRENT_D_TYPE 1
     48#endif
     49
    4650
    4751RTDECL(bool) RTDirExists(const char *pszPath)
     
    225229
    226230
     231#ifdef HAVE_DIRENT_D_TYPE
    227232/**
    228233 * Converts the d_type field to IPRT directory entry type.
     
    249254    }
    250255}
     256#endif /*HAVE_DIRENT_D_TYPE */
    251257
    252258
     
    295301             */
    296302            pDirEntry->INodeId = pDir->Data.d_ino; /* may need #ifdefing later */
     303#ifdef HAVE_DIRENT_D_TYPE
    297304            pDirEntry->enmType = rtDirType(pDir->Data.d_type);
     305#else
     306            pDirEntry->enmType = RTDIRENTRYTYPE_UNKNOWN;
     307#endif
    298308            pDirEntry->cbName  = (uint16_t)cchName;
    299309            Assert(pDirEntry->cbName == cchName);
     
    416426            if (RT_FAILURE(rc))
    417427            {
     428#ifdef HAVE_DIRENT_D_TYPE
    418429                rtDirSetDummyInfo(&pDirEntry->Info, rtDirType(pDir->Data.d_type));
     430#else
     431                rtDirSetDummyInfo(&pDirEntry->Info, RTDIRENTRYTYPE_UNKNOWN);
     432#endif
    419433                rc = VWRN_NO_DIRENT_INFO;
    420434            }
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r3672 r3888  
    4545/* This is currently ifdef'ed out in the relevant L4 header file */
    4646/* Same as `utimes', but takes an open file descriptor instead of a name.  */
    47 extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
     47extern int futimes(int __fd, __const struct timeval __tvp[2]) __THROW;
     48#endif
     49
     50#ifdef RT_OS_SOLARIS
     51# define futimes(filedes, timeval)   futimesat(filedes, NULL, timeval)
     52# define RTTIME_INCL_TIMEVAL /** @todo remove me after fixing iprt/time.h */
    4853#endif
    4954
  • trunk/src/VBox/Runtime/r3/posix/path-posix.cpp

    r3672 r3888  
    3434#ifdef RT_OS_DARWIN
    3535# include <mach-o/dyld.h>
     36#endif
     37#ifdef RT_OS_SOLARIS
     38# define RTTIME_INCL_TIMEVAL /** @todo remove me after fixing iprt/time.h */
    3639#endif
    3740
     
    408411         */
    409412/** @todo use RTProcGetExecutableName() */
    410 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     413#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)
    411414# ifdef RT_OS_LINUX
    412415        int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);
    413 # else
     416# elif defined(RT_OS_SOLARIS)
     417        pid_t curProcId = getpid();
     418        char szFileBuf[PATH_MAX + 1];
     419        sprintf(szFileBuf, "/proc/%ld/path/a.out", curProcId);
     420        int cchLink = readlink(szFileBuf, &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);
     421# else /* RT_OS_FREEBSD: */
    414422        int cchLink = readlink("/proc/curproc/file", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);
    415423# endif
  • trunk/src/VBox/Runtime/r3/posix/process-posix.cpp

    r3672 r3888  
    237237     * files and code for this.
    238238     */
    239 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     239#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)
    240240# ifdef RT_OS_LINUX
    241241    int cchLink = readlink("/proc/self/exe", pszExecName, cchExecName - 1);
    242 # else   
     242# elif defined(RT_OS_SOLARIS)
     243    char szFileBuf[80];
     244    RTStrPrintf(szFileBuf, sizeof(szFileBuf), "/proc/%ld/path/a.out", (long)getpid());
     245    int cchLink = readlink(szFileBuf, pszExecName, cchExecName - 1);
     246# else
    243247    int cchLink = readlink("/proc/curproc/file", pszExecName, cchExecName - 1);
    244 # endif   
     248# endif
    245249    if (cchLink > 0 && (size_t)cchLink <= cchExecName - 1)
    246250    {
  • trunk/src/VBox/Runtime/r3/posix/sems-posix.cpp

    r3672 r3888  
    3838#endif
    3939
     40#ifdef RT_OS_SOLARIS
     41# include <sched.h>
     42# define pthread_yield() sched_yield()
     43#endif
     44
    4045
    4146/*******************************************************************************
  • trunk/src/VBox/Runtime/r3/posix/system-posix.cpp

    r2981 r3888  
    2828
    2929#include <unistd.h>
    30 #include <sys/sysctl.h>
     30#if !defined(RT_OS_SOLARIS)
     31# include <sys/sysctl.h>
     32#endif
    3133
    3234
     
    3941{
    4042    int cCpus; NOREF(cCpus);
    41    
     43
    4244    /*
    4345     * The sysconf way (linux and others).
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r3672 r3888  
    2828#include <pthread.h>
    2929#include <signal.h>
     30#if defined(RT_OS_SOLARIS)
     31# include <sched.h>
     32#endif
    3033
    3134#include <iprt/thread.h>
     
    205208#elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    206209        pthread_yield();
     210#elif defined(RT_OS_SOLARIS)
     211        sched_yield();
    207212#else
    208213        if (!pthread_yield())
     
    238243#ifdef RT_OS_DARWIN
    239244    pthread_yield_np();
     245#elif defined(RT_OS_SOLARIS)
     246    sched_yield();
    240247#else
    241248    pthread_yield();
  • trunk/src/VBox/VMM/Makefile.kmk

    r3857 r3888  
    164164VBoxVMM_LDFLAGS.linux = -Wl,--no-undefined
    165165VBoxVMM_LDFLAGS.darwin = -install_name @executable_path/VBoxVMM.dylib
     166VBoxVMM_LDFLAGS.solaris = -mimpure-text
    166167
    167168
  • trunk/src/recompiler/InnoTek/config-host.h

    r3726 r3888  
    3636/*#  define CONFIG_BSD*/
    3737# elif defined(RT_OS_SOLARIS)
    38 /*#  define CONFIG_SUN*/
     38#  define CONFIG_SOLARIS
    3939# elif !defined(IPRT_NO_CRT)
    4040#  define HAVE_BYTESWAP_H 1
  • trunk/src/recompiler/InnoTek/crt/stdio.h

    r2981 r3888  
    2020 */
    2121
    22 #ifndef __stdio_h__
    23 #define __stdio_h__
     22#ifndef ___InnoTek_stdio_h
     23#define ___InnoTek_stdio_h
    2424
    2525#ifndef LOG_GROUP
     
    4141
    4242typedef struct FILE FILE;
     43
     44#if defined(RT_OS_SOLARIS)
     45/** @todo check solaris' floatingpoint.h as to why we do this */
     46# define _FILEDEFED
     47#endif
    4348
    4449DECLINLINE(int) fprintf(FILE *ignored, const char *pszFormat, ...)
  • trunk/src/recompiler/Makefile.kmk

    r3533 r3888  
    6868ifeq ($(BUILD_TARGET_ARCH),amd64)
    6969 REM_USE_NOCRT := 1
     70endif
     71
     72#
     73# We need to figure out the solaris version.
     74#
     75ifeq ($(BUILD_TARGET),solaris)
     76 ifndef HOST_SOLARIS
     77  # fixme- HOST_SOLARIS := $(shell uname ... | $(SED_EXT)... )
     78 endif
    7079endif
    7180
     
    197206 $(REM_MOD)_LDFLAGS.os2     = -Zomf
    198207 $(REM_MOD)_LDFLAGS.debug   = -g
     208 $(REM_MOD)_LDFLAGS.solaris = -mimpure-text
     209 $(REM_MOD)_DEFS.solaris    += HOST_SOLARIS=$(HOST_SOLARIS)
    199210 ifeq ($(BUILD_TARGET_ARCH),amd64)
    200211  $(REM_MOD)_LIBS           = $(FILE_TOOL_GCC3_LIBGCC)
  • trunk/src/recompiler/fpu/softfloat-native.c

    r1 r3888  
    77{
    88    STATUS(float_rounding_mode) = val;
    9 #if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
     9#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && (HOST_SOLARIS < 10 || HOST_SOLARIS == 11))
    1010    fpsetround(val);
    1111#elif defined(__arm__)
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