VirtualBox

Changeset 88215 in vbox for trunk/src/VBox/Additions/solaris


Ignore:
Timestamp:
Mar 19, 2021 6:42:55 PM (4 years ago)
Author:
vboxsync
Message:

Solaris-specific changes needed for building VBox on Solaris 11.4.
ticketref:9956

/Config.kmk,tools/Makefile.kmk: The Solaris package FMRI changed in
Solaris 11.4 so further care is needed when parsing the 'pkg contents -o
pkg.fmri' output. Some further simplification done as well as only the
Solaris 11 update and build number are needed for feature checking
elsewhere.

Additions/solaris/DRM: In Solaris 11 FCS <sys/queue.h> was taken from
FreeBSD and added to the OS. VirtualBox copied this file to
Additions/solaris/DRM/include and it is included by
Additions/solaris/DRM/include/drmP.h. Solaris 11.4 modified <sys/modctl.h>
to include <sys/queue.h> and drmP.h includes <sys/modctl.h> so thus
drmP.h shouldn't include queue.h on Solaris 11.4 FCS and later.

Additions/solaris/SharedFolders,Runtime/r0drv/solaris: Solaris 11.4
removed the 'alignment' argument from the VM map_addr() and
choose_addr() routines so we now leverage RTR0DbgKrnlInfoQuerySymbol()
at module initialization to determine which version of these functions
needs to be invoked.

Runtime/r0drv/solaris: In Solaris 11.4 the VM seg_ops getpolicy()
routine changed its return value and added an extra argument but since
we don't need to do anything for this and Solaris 10 and 11 both check
for a non-NULL s_ops->getpolicy() entry or else for s_ops->capable()
before calling getpolicy() we just set the s_SegVBoxOps getpolicy()
entry to NULL. Solaris 11.4 also added an extra argument to the VM
seg_ops dump() routine but there aren't any checks made before calling
it. Since we don't do anything with dump() we just use #ifdefs to get
the correct prototype at build-time.

Additions/x11/vboxvideo: The Xorg vboxvideo_drv.so shared object on
Solaris 11.4 has an undefined weak symbol reference to assert_c99
which needs to be added to the undefined_xorg file.

Location:
trunk/src/VBox/Additions/solaris
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/solaris/DRM/Makefile.kmk

    r82968 r88215  
    4040vboxvideo_DEFS          = VBOX_WITH_HGCM VBOX_SVN_REV=$(VBOX_SVN_REV)
    4141vboxvideo_DEPS         += $(VBOX_SVN_REV_KMK)
     42if ($(VBOX_SOLARIS_11_UPDATE_VERSION) > 3)
     43vboxvideo_DEFS         += VBOX_WITH_SYSTEM_QUEUE_H
     44endif
    4245vboxvideo_INCS         := \
    4346        include/
  • trunk/src/VBox/Additions/solaris/DRM/include/drmP.h

    r33540 r88215  
    5858#include "drm_atomic.h"
    5959#include "drm.h"
    60 #include "queue.h"
     60#if !defined(VBOX_WITH_SYSTEM_QUEUE_H)
     61# include "queue.h"
     62#endif
    6163#include "drm_linux_list.h"
    6264
  • trunk/src/VBox/Additions/solaris/SharedFolders/Makefile.kmk

    r82968 r88215  
    5353 vboxfs_deps.asm_ASFLAGS   = -f bin -g null
    5454endif
    55 if $(VBOX_SOLARIS_11_VERSION) > 175 \
    56  || (   $(VBOX_SOLARIS_11_VERSION) == 175 \
    57      && (   $(VBOX_SOLARIS_11_UPDATE_VERSION) > 1 \
    58          || ($(VBOX_SOLARIS_11_UPDATE_VERSION) == 1 && $(VBOX_SOLARIS_11_BUILD_VERSION) >= 10) ) )
     55if  ($(VBOX_SOLARIS_11_UPDATE_VERSION) > 1 \
     56 || ($(VBOX_SOLARIS_11_UPDATE_VERSION) == 1 && $(VBOX_SOLARIS_11_BUILD_VERSION) >= 10))
    5957vboxfs_DEFS         += VBOX_VFS_EXTENDED_POLICY
    6058endif
  • trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vfs.c

    r88189 r88215  
    2727#include <VBox/log.h>
    2828#include <VBox/version.h>
     29#include <iprt/dbg.h>
    2930
    3031#include <sys/types.h>
     
    4445#include <sys/pathname.h>
    4546#include <sys/cmn_err.h>
     47#include <sys/vmsystm.h>
    4648#undef u /* /usr/include/sys/user.h:249:1 is where this is defined to (curproc->p_user). very cool. */
    4749
     
    104106int sffs_minor;         /* minor number for device */
    105107
     108/** Whether to use the old-style map_addr()/choose_addr() routines. */
     109bool                     g_fVBoxVFS_SolOldAddrMap;
     110/** The map_addr()/choose_addr() hooks callout table structure. */
     111VBoxVFS_SolAddrMap       g_VBoxVFS_SolAddrMap;
     112
    106113/*
    107114 * Module linkage information
     
    122129_init()
    123130{
     131    RTDBGKRNLINFO hKrnlDbgInfo;
     132    int rc = RTR0DbgKrnlInfoOpen(&hKrnlDbgInfo, 0 /* fFlags */);
     133    if (RT_SUCCESS(rc))
     134    {
     135        rc = RTR0DbgKrnlInfoQuerySymbol(hKrnlDbgInfo, NULL /* pszModule */, "plat_map_align_amount",  NULL /* ppvSymbol */);
     136        if (RT_SUCCESS(rc))
     137        {
     138#if defined(VBOX_VFS_SOLARIS_10U6)
     139            g_VBoxVFS_SolAddrMap.MapAddr.pfnSol_map_addr    = (void *)map_addr;
     140#else
     141            g_VBoxVFS_SolAddrMap.ChooseAddr.pfnSol_choose_addr = (void *)choose_addr;
     142#endif
     143        }
     144        else
     145        {
     146            g_fVBoxVFS_SolOldAddrMap = true;
     147#if defined(VBOX_VFS_SOLARIS_10U6)
     148            g_VBoxVFS_SolAddrMap.MapAddr.pfnSol_map_addr_old    = (void *)map_addr;
     149#else
     150            g_VBoxVFS_SolAddrMap.ChooseAddr.pfnSol_choose_addr_old = (void *)choose_addr;
     151#endif
     152        }
     153
     154        RTR0DbgKrnlInfoRelease(hKrnlDbgInfo);
     155    }
     156    else
     157    {
     158        cmn_err(CE_NOTE, "RTR0DbgKrnlInfoOpen failed. rc=%d\n", rc);
     159        return rc;
     160    }
     161
    124162        return (mod_install(&modlinkage));
    125163}
  • trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vfs.h

    r82968 r88215  
    4949} sffs_data_t;
    5050
     51/*
     52 * Workaround for older Solaris versions which called map_addr()/choose_addr()/
     53 * map_addr_proc() with an 'alignment' argument that was removed in Solaris
     54 * 11.4.
     55 */
     56typedef struct VBoxVFS_SolAddrMap
     57{
     58    union
     59    {
     60        void *(*pfnSol_map_addr)          (caddr_t *, size_t, offset_t, uint_t);
     61        void *(*pfnSol_map_addr_old)      (caddr_t *, size_t, offset_t, int, uint_t);
     62    } MapAddr;
     63
     64    union
     65    {
     66        int (*pfnSol_choose_addr)       (struct as *, caddr_t *, size_t, offset_t, uint_t);
     67        int (*pfnSol_choose_addr_old)   (struct as *, caddr_t *, size_t, offset_t, int, uint_t);
     68    } ChooseAddr;
     69} VBoxVFS_SolAddrMap;
     70typedef VBoxVFS_SolAddrMap *pVBoxVFS_SolAddrMap;
     71
     72extern bool                     g_fVBoxVFS_SolOldAddrMap;
     73extern VBoxVFS_SolAddrMap       g_VBoxVFS_SolAddrMap;
    5174
    5275#ifdef  __cplusplus
  • trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vnode.c

    r82968 r88215  
    17671767        if ((flags & MAP_FIXED) == 0)
    17681768        {
    1769                 map_addr(addrp, len, off, 1, flags);
     1769        if (g_fVBoxVFS_SolOldAddrMap)
     1770            g_VBoxVFS_SolAddrMap.MapAddr.pfnSol_map_addr_old(addrp, len, off, 1, flags);
     1771        else
     1772            g_VBoxVFS_SolAddrMap.MapAddr.pfnSol_map_addr(addrp, len, off, flags);
    17701773                if (*addrp == NULL)
    17711774                        error = ENOMEM;
     
    17741777                as_unmap(asp, *addrp, len);     /* User specified address, remove any previous mappings */
    17751778#else
    1776         error = choose_addr(asp, addrp, len, off, ADDR_VACALIGN, flags);
     1779    if (g_fVBoxVFS_SolOldAddrMap)
     1780            error = g_VBoxVFS_SolAddrMap.ChooseAddr.pfnSol_choose_addr_old(asp, addrp, len, off, 1, flags);
     1781    else
     1782            error = g_VBoxVFS_SolAddrMap.ChooseAddr.pfnSol_choose_addr(asp, addrp, len, off, flags);
    17771783#endif
    17781784
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