VirtualBox

Changeset 43363 in vbox


Ignore:
Timestamp:
Sep 20, 2012 9:56:07 AM (12 years ago)
Author:
vboxsync
Message:

Haiku Additions.

Location:
trunk
Files:
66 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r43318 r43363  
    252252else ifeq ($(KBUILD_TARGET),os2)
    253253  VBOX_PACKAGE_OS = OS2
     254else ifeq ($(KBUILD_TARGET),haiku)
     255  VBOX_PACKAGE_OS = HAIKU
    254256else if1of ($(KBUILD_TARGET), dragonfly freebsd netbsd openbsd)
    255257  VBOX_PACKAGE_OS = BSD
     
    686688 else ifeq ($(KBUILD_TARGET),freebsd)
    687689  VBOX_PATH_APP_PRIVATE      = /usr/local/lib/virtualbox
     690 else ifeq ($(KBUILD_TARGET),haiku)
     691  VBOX_PATH_APP_PRIVATE      = /boot/apps/VirtualBox
    688692 endif
    689693endif
     
    846850 VBOX_WITH_DOCS=
    847851endif
     852
     853ifeq ($(KBUILD_TARGET),haiku)
     854 # Don't bother with SDL ttf for now.
     855 VBOX_WITH_SECURELABEL=
     856 # We'll use the native html/help viewer.
     857 VBOX_WITH_KCHMVIEWER=
     858 VBOX_WITH_VRDP_RDESKTOP=
     859 # Permanent (no working SDL).
     860 VBOX_WITH_VBOXSDL=
     861 VBOX_WITH_VBOXBFE=
     862 VBOX_WITH_DOCS=
     863 VBOX_WITH_VBOXDRV=
     864 VBOX_WITH_VRDP=
     865 VBOX_WITH_HEADLESS=
     866 VBOX_WITH_VBOXSDL=
     867 VBOX_WITH_QTGUI=
     868# VBOX_WITH_MAIN=
     869 VBOX_WITH_DOCS=
     870 VBOX_WITH_ISCSI=
     871 VBOX_WITH_INIP=
     872 VBOX_WITH_INTERNAL_NETWORKING=
     873 VBOX_WITH_PDM_ASYNC_COMPLETION=
     874 VBOX_WITH_KCHMVIEWER=
     875 VBOX_WITH_HARDENING=
     876endif
     877
    848878
    849879ifeq ($(KBUILD_TARGET),l4)
     
    11591189# Image and object format config.
    11601190#
    1161 if1of ($(KBUILD_TARGET), freebsd linux l4 netbsd openbsd solaris)
     1191if1of ($(KBUILD_TARGET), freebsd haiku linux l4 netbsd openbsd solaris)
    11621192 VBOX_LDR_FMT = elf
    11631193endif
     
    12841314 else ifeq ($(KBUILD_TARGET),darwin)
    12851315  VBOX_GCC_TOOL := GXX4MACHO
     1316 else ifeq ($(KBUILD_TARGET),haiku)
     1317  # Haiku shouldn't pass '-r' to the linker by default
     1318  VBOX_GCC_TOOL := GXX3PLAIN
    12861319 else ifeq ($(KBUILD_TARGET),solaris)
    12871320  VBOX_GCC_TOOL := GXX3PLAIN
     
    14001433DEFS.darwin  = RT_OS_DARWIN __DARWIN__
    14011434DEFS.freebsd = RT_OS_FREEBSD __FREEBSD__
     1435DEFS.haiku   = RT_OS_HAIKU
    14021436DEFS.l4      = RT_OS_L4 __L4__ __L4ENV__ L4API_l4v2 ARCH_$(KBUILD_TARGET_ARCH) __NO_CTYPE _FILE_OFFSET_BITS=64
    14031437DEFS.linux   = RT_OS_LINUX _FILE_OFFSET_BITS=64
     
    15981632 export LD_LIBRARY_PATH:=$(PATH_STAGE_BIN):$(PATH_STAGE_LIB):$(LD_LIBRARY_PATH)
    15991633endif
     1634ifeq ($(KBUILD_HOST),haiku)
     1635 export LIBRARY_PATH:=$(PATH_STAGE_BIN):$(PATH_STAGE_LIB):$(LIBRARY_PATH)
     1636endif
    16001637ifeq ($(KBUILD_HOST),os2)
    16011638 #fixme! export BEGINLIBPATH:=$(PATH_STAGE_BIN);$(PATH_STAGE_LIB);$(BEGINLIBPATH)
     
    16281665 LIB_DDU         = $(PATH_STAGE_BIN)/VBoxDDU.s.so
    16291666endif
    1630 if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
     1667if1of ($(KBUILD_TARGET), freebsd haiku linux netbsd openbsd solaris)
    16311668 LIB_RUNTIME     = $(PATH_STAGE_BIN)/VBoxRT.so
    16321669 LIB_RUNTIME_EF  = $(PATH_STAGE_LIB)/RuntimeEFCPP.a
     
    17381775else ifeq ($(KBUILD_HOST),os2)
    17391776 VBOX_XSLTPROC  ?= BEGINLIBPATH="$(PATH_DEVTOOLS_BLD)/bin;$$BEGINLIBPATH" $(PATH_DEVTOOLS_BLD)/bin/xsltproc.exe
     1777else ifeq ($(KBUILD_HOST),haiku)
     1778 VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/haiku.x86/bin/xsltproc
    17401779else
    17411780 VBOX_XSLTPROC  ?= xsltproc$(HOSTSUFF_EXE)
     
    21962235# Some versions of gcc (e.g. openSUSE11) return only major.minor on `gcc -dumpversion`.
    21972236VBOX_GCC_VERSION = $(shell \
    2198   $(1) -dumpversion | $(SED_EXT) 's|\([0-9]\)\.\([0-9]\)\.\{0,1\}\([0-9]\{0,1\}\)|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, \2), $$(firstword \3 0))|' )
     2237  $(1) -dumpversion | $(SED_EXT) 's|\([0-9]\)\.\([0-9]\)\.\{0,1\}\([0-9]\{0,1\}\).*|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, \2), $$(firstword \3 0))|' )
    21992238endif
    22002239
     
    22482287        $(QUIET)$(APPEND) '$@' 'endif'
    22492288endif
    2250 ifneq ($(KBUILD_TARGET),l4)
     2289ifn1of ($(KBUILD_TARGET),haiku l4)
    22512290# Set default attribute for inline functions to ``hidden'' to reduce the number
    22522291# of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
     
    25782617endif
    25792618
     2619
     2620#
     2621# Haiku resource and version generation.
     2622#
     2623ifeq ($(KBUILD_HOST),haiku)
     2624 VBOX_HAIKU_RCTOOL := rc
     2625 VBOX_HAIKU_XRESTOOL := xres
     2626 VBOX_HAIKU_SETVERSIONTOOL := setversion
     2627 # XXX: install won't preserve attributes...
     2628 VBOX_HAIKU_MIMESETTOOL := mimeset
     2629
     2630  ## Add optional resources to the program, set its version info, and sniff its mime properties.
     2631  # @param 1  The file to add resources to.
     2632  # @param 2  The resource files.
     2633  # @param 3  The target name.
     2634define VBOX_HAIKU_XRES_SETVER_FN
     2635        $(if $(2),$(call MSG_TOOL,HaikuAddResources,$(3),$(2))
     2636        $(QUIET)$(VBOX_HAIKU_XRESTOOL) -o $(1) $(2),)
     2637        $(call MSG_TOOL,HaikuSetVersion,$(3))
     2638        $(QUIET)$(VBOX_HAIKU_SETVERSIONTOOL) $(1) \
     2639                -app $(VBOX_VERSION_MAJOR) $(VBOX_VERSION_MINOR) $(VBOX_VERSION_BUILD) d $(VBOX_SVN_REV) \
     2640                -short "$(VBOX_PRODUCT)" \
     2641                -long "$(VBOX_PRODUCT) $(VBOX_VERSION_STRING) $(shell /bin/echo -e '\xC2\xA9')2009-$(VBOX_C_YEAR) $(VBOX_VENDOR)"
     2642        $(call MSG_TOOL,HaikuMimeSet,$(3))
     2643        $(QUIET)$(VBOX_HAIKU_MIMESETTOOL) -f $(1)
     2644endef
     2645
     2646 VBOX_HAIKU_XRES_SETVER_CMDS  ?= $(if $(eq $(tool_do),LINK_PROGRAM),$(call VBOX_HAIKU_XRES_SETVER_FN,$(out),$($(target)_RSRCS),$(target)),)
     2647endif
    25802648
    25812649#
     
    32973365
    32983366endif # FreeBSD
     3367
     3368ifeq ($(KBUILD_TARGET),haiku)
     3369## The Haiku include directories
     3370VBOX_HAIKU_SYS_INCS ?= /boot/develop/headers/os/kernel /boot/develop/headers/os/drivers
     3371
     3372TEMPLATE_VBOXR0DRV_TOOL                = $(VBOX_GCC_TOOL)
     3373TEMPLATE_VBOXR0DRV_LDTOOL              = $(VBOX_GCC_TOOL)
     3374TEMPLATE_VBOXR0DRV_DEFS                = _KERNEL_MODE=1 _STRICT_STDC IN_RING0 IN_RT_R0
     3375TEMPLATE_VBOXR0DRV_INCS                = $(VBOX_HAIKU_SYS_INCS)
     3376#TODO: sort this out
     3377TEMPLATE_VBOXR0DRV_LDFLAGS             = -shared -no-undefined -dc -dy -nostdlib -rpath-link /boot/develop/lib/x86 --no-add-needed /boot/develop/lib/x86/_KERNEL_ --no-add-needed /boot/develop/lib/x86/haiku_version_glue.o
     3378TEMPLATE_VBOXR0DRV_CFLAGS              = -no-fpic \
     3379        $(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare \
     3380        $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
     3381TEMPLATE_VBOXR0DRV_CFLAGS.x86          = -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
     3382TEMPLATE_VBOXR0DRV_CFLAGS.x86          = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
     3383TEMPLATE_VBOXR0DRV_CFLAGS.amd64        = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
     3384        -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
     3385        -Wno-sign-compare -Wdeclaration-after-statement
     3386TEMPLATE_VBOXR0DRV_CXXFLAGS           = -no-fpic -Wpointer-arith \
     3387        -Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \
     3388        -Wformat \
     3389        -O2 -nodefaultlibs -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -fno-exceptions -fno-rtti
     3390TEMPLATE_VBOXR0DRV_CXXFLAGS.x86       = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) -fno-exceptions -fno-rtti
     3391TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64     = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64) -fno-exceptions -fno-rtti
     3392endif # Haiku
    32993393
    33003394ifdef VBOX_WITH_VBOXDRV
     
    34603554   TEMPLATE_VBOXR3EXE_CXXFLAGS := $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -fdollars-in-identifiers # annoying gcc option precedence.
    34613555  endif
     3556 else ifeq ($(KBUILD_TARGET),haiku)
     3557TEMPLATE_VBOXR3EXE_TOOL                = GXX3
     3558TEMPLATE_VBOXR3EXE_POST_CMDS          = $(VBOX_HAIKU_XRES_SETVER_CMDS)
     3559TEMPLATE_VBOXR3EXE_LIBS                = network iconv stdc++ supc++
     3560TEMPLATE_VBOXR3EXE_LIBPATH            += \
     3561        /boot/common/lib
     3562# Haiku uses PIC by default...
     3563TEMPLATE_VBOXR3EXE_CFLAGS             += -fno-pic
     3564TEMPLATE_VBOXR3EXE_CXXFLAGS           += -fno-pic
     3565TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
    34623566 else if1of ($(KBUILD_TARGET), freebsd netbsd openbsd)
    34633567TEMPLATE_VBOXR3EXE_TOOL                = GXX3
     
    35083612 TEMPLATE_VBOXR3_CXXFLAGS              = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
    35093613 TEMPLATE_VBOXR3_LDFLAGS               = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
     3614endif
     3615ifeq ($(KBUILD_TARGET),haiku)
     3616 # Haiku uses PIC by default...
     3617 TEMPLATE_VBOXR3_CFLAGS               = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fno-pic
     3618 TEMPLATE_VBOXR3_CXXFLAGS             = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-pic
     3619 TEMPLATE_VBOXR3_LDFLAGS              = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fno-pic
    35103620endif
    35113621
     
    39494059TEMPLATE_VBOXMAINEXE_LDFLAGS            += $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -framework Carbon
    39504060TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
     4061 else ifeq ($(KBUILD_TARGET),haiku)
     4062TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
     4063TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) network stdc++ supc++
    39514064 else if1of ($(KBUILD_TARGET), freebsd netbsd openbsd)
    39524065TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
     
    40114124TEMPLATE_VBOXMAINDLL  = VBox Main Component (shared library)
    40124125TEMPLATE_VBOXMAINDLL_EXTENDS = VBOXMAINEXE
    4013 ifn1of ($(KBUILD_TARGET), darwin os2 win)
     4126ifn1of ($(KBUILD_TARGET), darwin haiku os2 win)
    40144127 TEMPLATE_VBOXMAINDLL_DEFS     = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
    40154128 TEMPLATE_VBOXMAINDLL_CFLAGS   = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
     
    45494662  endif
    45504663TEMPLATE_VBOXBLDPROG_LIBS                =
     4664 else ifeq ($(KBUILD_HOST),haiku)
     4665TEMPLATE_VBOXBLDPROG_TOOL                = GXX3
     4666TEMPLATE_VBOXBLDPROG_LIBS                = network iconv
     4667TEMPLATE_VBOXBLDPROG_LIBPATH            += \
     4668        /boot/common/lib
    45514669 else if1of ($(KBUILD_HOST), freebsd netbsd openbsd)
    45524670TEMPLATE_VBOXBLDPROG_TOOL                = GXX3
     
    48895007        $(PATH_SDK_$(VBOX_WINDDK)_LIB)/int64.lib
    48905008TEMPLATE_VBOXGUESTR0_DEFS        = $(TEMPLATE_VBOXR0DRV_DEFS) IN_GUEST IN_GUEST_R0
    4891 ifeq ($(KBUILD_TARGET),solaris) # No VBI for the guest additions yet.
     5009ifeq ($(KBUILD_TARGET),solaris)
    48925010 TEMPLATE_VBOXGUESTR0_LDFLAGS    = -r -dy
    48935011endif
     
    49055023TEMPLATE_VBOXGUESTR0LIB_INSTTYPE.linux = stage
    49065024TEMPLATE_VBOXGUESTR0LIB_INST     = $(INST_ADDITIONS_LIB)
     5025ifeq ($(KBUILD_TARGET),haiku)
     5026 TEMPLATE_VBOXGUESTR0LIB_LDFLAGS = -r -dy
     5027endif
    49075028
    49085029#
  • trunk/configure

    r42002 r43363  
    5454  sunos)
    5555    OS='solaris'
     56    ;;
     57  haiku)
    5658    ;;
    5759  *)
     
    333335  [ "$OS" = "solaris" ] && BUILD_CPU=`isainfo | cut -f 1 -d ' '`
    334336  case "$BUILD_CPU" in
    335     i[3456789]86|x86|i86pc)
     337    i[3456789]86|x86|i86pc|BePC)
    336338      BUILD_MACHINE='x86'
    337339      LIB='lib'
     
    650652check_xsltproc()
    651653{
     654  if [ -n "$BUILD_LIBXSLT" ]; then
     655      return 0;
     656  fi
    652657  test_header xslt
    653658  if check_avail "$XSLTPROC" XSLTPROC; then
     
    897902  if test_compile "$LIBZ $I_INCZ" zlib zlib; then
    898903    if test_execute; then
    899       echo "if1of (\$(KBUILD_TARGET),darwin freebsd linux solaris)" >> $CNF
     904      echo "if1of (\$(KBUILD_TARGET),darwin freebsd haiku linux solaris)" >> $CNF
    900905      cnf_append " SDK_VBOX_ZLIB_LIBS" "`strip_l "$LIBZ"`"
    901906      cnf_append " SDK_VBOX_ZLIB_INCS" "$INCZ"
     
    22462251  BUILD_LIBXML2=1
    22472252  [ $OSE -eq 1 ] || BUILD_LIBCURL=1
     2253elif [ "$OS" = "haiku" ]; then
     2254  #WITH_SDL=0
     2255  WITH_SDL_TTF=0
     2256  WITH_X11=0
     2257  WITH_ALSA=0
     2258  WITH_PULSE=0
     2259  WITH_DBUS=0
     2260  WITH_KMODS=0
     2261  WITH_LIBIDL=0
     2262  WITH_XPCOM=0
     2263  BUILD_LIBXSLT=1
     2264  BUILD_LIBXML2=1
     2265  # it is part of libroot, which is linked by default,
     2266  # but the script wants something
     2267  LIBPTHREAD="-lroot"
     2268  #[ $OSE -eq 1] || BUILD_LIBCURL=1
     2269  [ $OSE -eq 1] || BUILD_LIBSSL=1
    22482270fi
    22492271
  • trunk/include/VBox/VBoxGuest.h

    r41972 r43363  
    66
    77/*
    8  * Copyright (C) 2006-2009 Oracle Corporation
     8 * Copyright (C) 2006-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6262# define VBOXGUEST_DEVICE_NAME_DOS      L"\\DosDevices\\VBoxGuest"
    6363
     64#elif defined(RT_OS_HAIKU)
     65# define VBOXGUEST_DEVICE_NAME          "/dev/misc/vboxguest"
     66
    6467#else /* (PORTME) */
    6568# define VBOXGUEST_DEVICE_NAME          "/dev/vboxguest"
     
    175178# define VBOXGUEST_IOCTL_CODE_FAST_(Function)       _IO(  'V', (Function))
    176179# define VBOXGUEST_IOCTL_STRIP_SIZE(Code)           VBOXGUEST_IOCTL_CODE_(_IOC_NR((Code)), 0)
     180
     181#elif defined(RT_OS_HAIKU)
     182  /* No automatic buffering, size not encoded. */
     183  /** @todo do something better */
     184# define VBOXGUEST_IOCTL_CODE_(Function, Size)      (0x56420000 | (Function))
     185# define VBOXGUEST_IOCTL_CODE_FAST_(Function)       (0x56420000 | (Function))
     186# define VBOXGUEST_IOCTL_STRIP_SIZE(Code)           (Code)
    177187
    178188#elif defined(RT_OS_FREEBSD) /** @todo r=bird: Please do it like SUPDRVIOC to keep it as similar as possible. */
  • trunk/include/VBox/ostypes.h

    r43248 r43363  
    44
    55/*
    6  * Copyright (C) 2006-2011 Oracle Corporation
     6 * Copyright (C) 2006-2012 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    117117    VBOXOSTYPE_MacOS_x64        = 0xB0100,
    118118    VBOXOSTYPE_JRockitVE        = 0xC0000,
     119    VBOXOSTYPE_Haiku            = 0xD0000,
     120    VBOXOSTYPE_Haiku_x64        = 0xD0100,
    119121/** The bit number which indicates 64-bit or 32-bit. */
    120122#define VBOXOSTYPE_x64_BIT       8
  • trunk/include/iprt/assert.h

    r43043 r43363  
    505505 */
    506506#if defined(IN_RING0) \
    507  && (defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS))
     507 && (defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU) || defined(RT_OS_SOLARIS))
    508508# define RTAssertDoPanic()      RTR0AssertPanicSystem()
    509509#else
  • trunk/include/iprt/thread.h

    r39836 r43363  
    44
    55/*
    6  * Copyright (C) 2006-2007 Oracle Corporation
     6 * Copyright (C) 2006-2012 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    534534    uint8_t         bReserved3;
    535535#   define RTTHREADPREEMPTSTATE_INITIALIZER { NIL_RTCPUID, 255, 0, 0, 0 }
     536#  elif defined(RT_OS_HAIKU)
     537    /** The cpu_state. Don't touch! */
     538    uint32_t        uOldCpuState;
     539#   define RTTHREADPREEMPTSTATE_INITIALIZER { NIL_RTCPUID, 0 }
    536540#  elif defined(RT_OS_SOLARIS)
    537541    /** The Old PIL. Don't touch! */
  • trunk/include/iprt/types.h

    r40946 r43363  
    44
    55/*
    6  * Copyright (C) 2006-2011 Oracle Corporation
     6 * Copyright (C) 2006-2012 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    206206#   endif
    207207#  else
    208 #   if defined(RT_OS_DARWIN) && defined(_STDBOOL_H)
     208#   if (defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU)) && defined(_STDBOOL_H)
    209209#    undef bool
    210210#   endif
  • trunk/src/VBox/Additions/Makefile.kmk

    r41477 r43363  
    7070 ifeq ($(KBUILD_TARGET),darwin)
    7171  include $(PATH_SUB_CURRENT)/darwin/Makefile.kmk
     72 endif
     73 ifeq ($(KBUILD_TARGET),haiku)
     74  include $(PATH_SUB_CURRENT)/haiku/Makefile.kmk
    7275 endif
    7376
     
    286289endif # win.x86
    287290
     291ifdef VBOX_WITH_ADDITIONS_ISO.haiku.x86
     292 VBOX_PATH_ADDITIONS.haiku.x86 = $(PATH_OUT_BASE)/haiku.x86/$(KBUILD_TYPE)/bin/additions
     293 # or bfs?
     294 GUESTADDITIONS_FILESPEC.haiku.x86 = \
     295        VBoxHaikuAdditions-x86.run=$(VBOX_PATH_ADDITIONS.haiku.x86)/VBoxHaikuAdditions-x86.run
     296endif
     297
    288298
    289299#
     
    303313                                $(GUESTADDITIONS_FILESPEC.freebsd.x86) \
    304314                                $(GUESTADDITIONS_FILESPEC.freebsd.amd64) \
     315                                $(GUESTADDITIONS_FILESPEC.haiku.x86) \
    305316                                $(GUESTADDITIONS_FILESPEC.darwin.x86) \
    306317                                $(GUESTADDITIONS_FILESPEC.darwin.amd64) \
     
    325336                $(GUESTADDITIONS_FILESPEC.freebsd.x86) \
    326337                $(GUESTADDITIONS_FILESPEC.freebsd.amd64) \
     338                $(GUESTADDITIONS_FILESPEC.haiku.x86) \
    327339                $(GUESTADDITIONS_FILESPEC.darwin.x86) \
    328340                $(GUESTADDITIONS_FILESPEC.darwin.amd64)
  • trunk/src/VBox/Additions/common/Makefile.kmk

    r41477 r43363  
    2323 include $(PATH_SUB_CURRENT)/VBoxGuestLib/Makefile.kmk
    2424 include $(PATH_SUB_CURRENT)/VBoxControl/Makefile.kmk
    25  if1of ($(KBUILD_TARGET), freebsd linux os2 solaris win)
     25 if1of ($(KBUILD_TARGET), freebsd haiku linux os2 solaris win)
    2626  include $(PATH_SUB_CURRENT)/VBoxGuest/Makefile.kmk
    2727 endif
    28  if1of ($(KBUILD_TARGET), freebsd linux os2 solaris win)
     28 if1of ($(KBUILD_TARGET), freebsd haiku linux os2 solaris win)
    2929  include $(PATH_SUB_CURRENT)/VBoxService/Makefile.kmk
    3030 endif
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r42239 r43363  
    2020
    2121
    22 if1of ($(KBUILD_TARGET), freebsd $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) os2 solaris win)
     22if1of ($(KBUILD_TARGET), freebsd haiku $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) os2 solaris win)
    2323 #
    2424 # VBoxGuest - The Guest Additions Driver.
     
    2727 VBoxGuest_TEMPLATE      = VBOXGUESTR0
    2828 VBoxGuest_NAME.freebsd  = vboxguest
     29 VBoxGuest_NAME.haiku    = vboxguest
    2930 VBoxGuest_NAME.linux    = vboxguest
    3031 VBoxGuest_NAME.solaris  = vboxguest
     
    3334  VBoxGuest_DEBUG_INSTTYPE.win = both
    3435 endif
     36 VBoxGuest_DEFS.haiku    = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
    3537 VBoxGuest_DEFS.linux    = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
    3638 VBoxGuest_DEFS.solaris  = VBOX_SVN_REV=$(VBOX_SVN_REV)
     
    5052 VBoxGuest_DEPS.linux   += $(VBOX_SVN_REV_HEADER)
    5153 VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
     54 VBoxGuest_DEPS.haiku   += $(VBOX_SVN_REV_HEADER)
    5255 VBoxGuest_DEFS          = VBGL_VBOXGUEST VBOX_WITH_HGCM
    5356 VBoxGuest_INCS          = .
     
    7578   endif
    7679  endif # win
    77   ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
     80  ifn1of ($(KBUILD_TARGET), linux freebsd solaris haiku)
    7881   VBoxGuest_SOURCES    = VBoxGuest-$(KBUILD_TARGET).cpp
    7982  else
     
    9598        $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
    9699        $(PATH_STAGE)/gen-sys-hdrs/device_if.h
     100  ifeq ($(KBUILD_TARGET),haiku)
     101   # Haiku drivers cannot export symbols for other drivers, but modules can.
     102   # Therefore vboxguest is a module containing the ring-0 guest lib, and vboxdev/vboxsf
     103   # use this module to access the guest lib
     104   SYSMODS += VBoxDev
     105   VBoxDev_TEMPLATE      = VBOXGUESTR0
     106   VBoxDev_NAME          = vboxdev
     107   VBoxDev_DEFS          = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1 VBGL_VBOXGUEST VBOX_WITH_HGCM IN_RING0
     108   VBoxDev_SOURCES       = VBoxDev-haiku.c VBoxGuest-haiku-stubs.c
     109  endif
    97110 else # OS/2:
    98111  # The library order is crucial, so a bit of trickery is necessary.
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

    r43016 r43363  
    3838
    3939#elif defined(RT_OS_FREEBSD) \
     40   || defined(RT_OS_HAIKU) \
    4041   || defined(RT_OS_LINUX) \
    4142   || defined(RT_OS_SOLARIS)
     
    198199#else
    199200
    200     /* The default implementation. (linux, solaris, freebsd) */
     201    /* The default implementation. (linux, solaris, freebsd, haiku) */
    201202    RTFILE File;
    202203    int rc = RTFileOpen(&File, pszDeviceName, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
     
    381382    return rc;
    382383
     384#elif defined(RT_OS_HAIKU)
     385        /* The ioctl hook in Haiku does take the len parameter when specified,
     386         * so just use it.
     387         */
     388    int rc = ioctl((int)g_File, iFunction, pvData, cbData);
     389    if (RT_LIKELY(rc == 0))
     390        return VINF_SUCCESS;
     391
     392    /* Positive values are negated VBox error status codes. */
     393    if (rc > 0)
     394        rc = -rc;
     395    else
     396        rc = RTErrConvertFromErrno(errno);
     397    return rc;
     398
    383399#elif defined(VBOX_VBGLR3_XFREE86)
    384400    /* PORTME - This is preferred over the RTFileIOCtl variant below, just be careful with the (int). */
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp

    r37608 r43363  
    411411        VBoxServiceError("VBoxServiceTimeSyncAdjust: GetSystemTimeAdjustment failed, error=%ld\n", GetLastError());
    412412
    413 #elif defined(RT_OS_OS2)
     413#elif defined(RT_OS_OS2) || defined(RT_OS_HAIKU)
    414414    /* No API for doing gradual time adjustments. */
    415415
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r43230 r43363  
    4040# include <net/if.h>
    4141# include <unistd.h>
    42 # ifndef RT_OS_OS2
    43 #  ifndef RT_OS_FREEBSD
    44 #   include <utmpx.h> /* @todo FreeBSD 9 should have this. */
    45 #  endif
     42# if !defined(RT_OS_OS2) && !defined(RT_OS_FREEBSD) && !defined(RT_OS_HAIKU)
     43#  include <utmpx.h> /* @todo FreeBSD 9 should have this. */
    4644# endif
    4745# ifdef RT_OS_SOLARIS
     
    266264    rc = VERR_NOT_IMPLEMENTED;
    267265
     266#elif defined(RT_OS_HAIKU)
     267    /** @todo Haiku: Port logged on user info retrieval. */
     268    rc = VERR_NOT_IMPLEMENTED;
     269
    268270#elif defined(RT_OS_OS2)
    269271    /** @todo OS/2: Port logged on (LAN/local/whatever) user info retrieval. */
     
    519521    if (sd >= 0)
    520522        closesocket(sd);
     523
     524#elif defined(RT_OS_HAIKU)
     525    /** @todo Haiku: implement network info. retreival */
     526    return VERR_NOT_IMPLEMENTED;
    521527
    522528#elif defined(RT_OS_FREEBSD)
  • trunk/src/VBox/Makefile.kmk

    r41477 r43363  
    2222ifdef VBOX_ONLY_ADDITIONS
    2323 include $(PATH_SUB_CURRENT)/Runtime/Makefile.kmk
    24  ifdef VBOX_WITH_CROGL
    25   if1of ($(KBUILD_TARGET),win linux solaris freebsd)
     24 if defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_HGSMI)
     25  if1of ($(KBUILD_TARGET),win linux solaris freebsd haiku)
    2626   include $(PATH_SUB_CURRENT)/GuestHost/Makefile.kmk
    2727  endif
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r40938 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    138138#  include <stdlib.h>
    139139#  include <unistd.h>
     140# elif defined(RT_OS_HAIKU)
     141#  include <OS.h>
    140142# elif defined(RT_OS_SOLARIS)
    141143#  define _STRUCTURED_PROC 1
     
    369371        }
    370372
     373#  elif defined(RT_OS_HAIKU)
     374        team_info info;
     375        if (get_team_info(0, &info) == B_OK)
     376        {
     377                /* there is an info.argc, but no way to know arg boundaries */
     378            RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %.64s\n", info.args);
     379        }
     380
    371381#  elif defined(RT_OS_FREEBSD)
    372382        /* Retrieve the required length first */
  • trunk/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp

    r40824 r43363  
    431431#endif
    432432#ifdef EDOOFUS
     433# if EDOOFUS != EINVAL
    433434        case EDOOFUS:           return VERR_INTERNAL_ERROR;
     435# endif
    434436#endif
    435437#ifdef ENOTSUP
  • trunk/src/VBox/Runtime/r3/posix/RTHandleGetStandard-posix.cpp

    r33973 r43363  
    55
    66/*
    7  * Copyright (C) 2010 Oracle Corporation
     7 * Copyright (C) 2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333#include <sys/types.h>
    3434#include <sys/ioctl.h>
    35 #include <sys/fcntl.h>
    3635#include <fcntl.h>
    3736#ifdef _MSC_VER
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r39627 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#include <sys/types.h>
    3535#include <sys/stat.h>
    36 #include <sys/fcntl.h>
    3736#include <fcntl.h>
    3837#include <dirent.h>
     
    5453#include "internal/path.h"
    5554
    56 #if !defined(RT_OS_SOLARIS)
     55#if !defined(RT_OS_SOLARIS) && !defined(RT_OS_HAIKU)
    5756# define HAVE_DIRENT_D_TYPE 1
    5857#endif
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r39627 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3535#include <sys/types.h>
    3636#include <sys/ioctl.h>
    37 #include <sys/fcntl.h>
    3837#include <fcntl.h>
    3938#ifdef _MSC_VER
  • trunk/src/VBox/Runtime/r3/posix/fileio2-posix.cpp

    r40553 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5757#endif
    5858
     59#ifdef RT_OS_HAIKU
     60# define USE_FUTIMENS
     61#endif
     62
    5963#include <iprt/file.h>
    6064#include <iprt/path.h>
     
    144148        return VINF_SUCCESS;
    145149
     150#ifdef USE_FUTIMENS
     151    struct timespec aTimespecs[2];
     152    if (pAccessTime && pModificationTime)
     153    {
     154        memcpy(&aTimespecs[0], pAccessTime, sizeof(struct timespec));
     155        memcpy(&aTimespecs[1], pModificationTime, sizeof(struct timespec));
     156    }
     157    else
     158    {
     159        RTFSOBJINFO ObjInfo;
     160        int rc = RTFileQueryInfo(hFile, &ObjInfo, RTFSOBJATTRADD_UNIX);
     161        if (RT_FAILURE(rc))
     162            return rc;
     163        memcpy(&aTimespecs[0], pAccessTime ? pAccessTime : &ObjInfo.AccessTime, sizeof(struct timespec));
     164        memcpy(&aTimespecs[1], pModificationTime ? pModificationTime : &ObjInfo.ModificationTime, sizeof(struct timespec));
     165    }
     166
     167    if (futimens(RTFileToNative(hFile), aTimespecs))
     168    {
     169        int rc = RTErrConvertFromErrno(errno);
     170        Log(("RTFileSetTimes(%RTfile,%p,%p,,): returns %Rrc\n", hFile, pAccessTime, pModificationTime, rc));
     171        return rc;
     172    }
     173#else
    146174    /*
    147175     * Convert the input to timeval, getting the missing one if necessary,
     
    172200        return rc;
    173201    }
     202#endif
    174203    return VINF_SUCCESS;
    175204}
  • trunk/src/VBox/Runtime/r3/posix/filelock-posix.cpp

    r37596 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#include <sys/types.h>
    3535#include <sys/ioctl.h>
    36 #include <sys/fcntl.h>
    3736#include <fcntl.h>
    3837#include <unistd.h>
  • trunk/src/VBox/Runtime/r3/posix/fs2-posix.cpp

    r34015 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434#ifndef DEV_BSIZE
    3535# include <sys/stat.h>
     36# if defined(RT_OS_HAIKU) && !defined(S_BLKSIZE)
     37#  define S_BLKSIZE 512
     38# endif
    3639# define DEV_BSIZE S_BLKSIZE /** @todo bird: add DEV_BSIZE to sys/param.h on OS/2. */
    3740#endif
  • trunk/src/VBox/Runtime/r3/posix/rand-posix.cpp

    r37596 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333#include <sys/types.h>
    3434#include <sys/ioctl.h>
    35 #include <sys/fcntl.h>
    3635#include <fcntl.h>
    3736#ifdef _MSC_VER
  • trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp

    r39032 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4949#endif
    5050
    51 #ifdef RT_OS_SOLARIS
     51#if defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    5252# include <sched.h>
    5353# define pthread_yield() sched_yield()
     
    398398         */
    399399        struct timespec     ts = {0,0};
    400 #ifdef RT_OS_DARWIN
     400#if defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU)
    401401        struct timeval      tv = {0,0};
    402402        gettimeofday(&tv, NULL);
  • trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp

    r40103 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    482482    if (!pThis->fMonotonicClock)
    483483    {
    484 #ifdef RT_OS_DARWIN
     484#if defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU)
    485485        struct timeval  tv = {0,0};
    486486        gettimeofday(&tv, NULL);
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r28800 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    250250         */
    251251        struct timespec     ts = {0,0};
     252#ifdef RT_OS_HAIKU
     253        struct timeval      tv = {0,0};
     254        gettimeofday(&tv, NULL);
     255        ts.tv_sec = tv.tv_sec;
     256        ts.tv_nsec = tv.tv_usec * 1000;
     257#else
    252258        clock_gettime(CLOCK_REALTIME, &ts);
     259#endif
    253260        if (cMillies != 0)
    254261        {
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r41881 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5252# define IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP
    5353# include <dlfcn.h>
     54#endif
     55#if defined(RT_OS_HAIKU)
     56# include <OS.h>
    5457#endif
    5558
     
    413416
    414417    return VINF_SUCCESS;
     418#elif defined(RT_OS_HAIKU)
     419    thread_info       ThreadInfo;
     420    status_t status = get_thread_info(find_thread(NULL), &ThreadInfo);
     421    AssertReturn(status == B_OK, RTErrConvertFromErrno(status));
     422
     423    *pKernelTime = ThreadInfo.kernel_time / 1000;
     424    *pUserTime   = ThreadInfo.user_time / 1000;
     425
     426    return VINF_SUCCESS;
    415427#else
    416428    return VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/Runtime/r3/posix/thread2-posix.cpp

    r39443 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6363#elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    6464        pthread_yield();
    65 #elif defined(RT_OS_SOLARIS)
     65#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    6666        sched_yield();
    6767#else
     
    102102#elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    103103        pthread_yield();
    104 #elif defined(RT_OS_SOLARIS)
     104#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    105105        sched_yield();
    106106#else
     
    131131#ifdef RT_OS_DARWIN
    132132    pthread_yield_np();
    133 #elif defined(RT_OS_SOLARIS)
     133#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU)
    134134    sched_yield();
    135135#else
  • trunk/src/VBox/Runtime/r3/posix/utf8-posix.cpp

    r40654 r43363  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    194194            const void *pvInputLeft = pvInput;
    195195            void       *pvOutputLeft = pvOutput;
    196 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
     196#if defined(RT_OS_LINUX) || defined(RT_OS_HAIKU) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
    197197            if (iconv(hIconv, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
    198198#else
     
    320320            const void *pvInputLeft = pvInput;
    321321            void       *pvOutputLeft = pvOutput;
    322 #if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
     322#if defined(RT_OS_LINUX) || defined(RT_OS_HAIKU) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
    323323            if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
    324324#else
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r43213 r43363  
    3434#else /* !RT_OS_WINDOWS */
    3535# include <errno.h>
     36# include <sys/select.h>
    3637# include <sys/stat.h>
    3738# include <sys/socket.h>
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