VirtualBox

Changeset 21118 in vbox for trunk


Ignore:
Timestamp:
Jul 1, 2009 12:48:15 PM (16 years ago)
Author:
vboxsync
Message:

VBoxGuest (common): building on linux.

Location:
trunk
Files:
1 added
4 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r21072 r21118  
    6262#endif
    6363
    64 #if defined(RT_OS_LINUX) && !defined(VBOX_WITH_COMMON_VBOXGUEST_ON_LINUX)
     64#if defined(RT_OS_LINUX) /*&& !defined(VBOX_WITH_COMMON_VBOXGUEST_ON_LINUX)*/
    6565/** The support device name. */
    6666# define VBOXGUEST_DEVICE_NAME        "/dev/vboxadd"
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r21104 r21118  
    118118 endif # FreeBSD
    119119
     120
     121 ifeq ($(KBUILD_TARGET),linux)
     122  #
     123  # Install the source files and script(s).
     124  #
     125  include $(PATH_SUB_CURRENT)/linux/files_vboxguest
     126  # sources and stuff.
     127  INSTALLS += vboxguest-src
     128  vboxguest-src_INST     = $(INST_ADDITIONS)src/vboxguest/
     129  vboxguest-src_MODE     = a+r,u+w
     130  vboxguest-src_SOURCES  = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
     131  vboxguest-src_SOURCES += $(if $(VBOX_OSE),,$(vboxguest-sh_0_OUTDIR)/dkms.conf)
     132  vboxguest-src_CLEAN    = $(vboxguest-sh_0_OUTDIR)/dkms.conf
     133
     134  $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
     135                $(PATH_SUB_CURRENT)/linux/dkms.conf \
     136                $(VBOX_VERSION_STAMP) \
     137                | $$(dir $$@)
     138        $(call MSG_TOOL,Creating,,$@)
     139        $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
     140
     141  # scripts.
     142  INSTALLS += vboxguest-sh
     143  vboxguest-sh_INST      = $(INST_ADDITIONS)src/vboxguest/
     144  vboxguest-sh_MODE      = a+rx,u+w
     145  vboxguest-sh_SOURCES   = $(subst ",,$(FILES_VBOXGUEST_BIN))
     146  vboxguest-sh_SOURCES  += $(if $(VBOX_OSE),,$(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
     147  vboxguest-sh_SOURCES  += $(vboxguest-sh_0_OUTDIR)/build_in_tmp
     148  vboxguest-sh_CLEAN     = $(vboxguest-sh_0_OUTDIR)/build_in_tmp
     149
     150  $$(vboxguest-sh_0_OUTDIR)/build_in_tmp: \
     151                $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
     152                $(VBOX_VERSION_STAMP) \
     153                | $$(dir $$@)
     154        $(call MSG_TOOL,Creating,,$@)
     155        $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxguest;g" --output $@ $<
     156        $(QUIET)$(CHMOD) 0755 $@
     157
     158 endif # Linux
     159
    120160endif # enabled
    121161
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c

    r21103 r21118  
    121121/** Our file node major id.
    122122 * Either set dynamically at run time or statically at compile time. */
     123#ifdef CONFIG_VBOXGUEST_MAJOR
     124static unsigned int             g_iModuleMajor = CONFIG_VBOXGUEST_MAJOR;
     125#else
     126static unsigned int             g_iModuleMajor = 0;
     127#endif
    123128#ifdef CONFIG_VBOXADD_MAJOR
    124 static unsigned int             g_iModuleMajor = CONFIG_VBOXADD_MAJOR;
    125 #else
    126 static unsigned int             g_iModuleMajor = 0;
     129# error "CONFIG_VBOXADD_MAJOR -> CONFIG_VBOXGUEST_MAJOR"
    127130#endif
    128131
     
    292295 * Clean up the usage of the PCI device.
    293296 */
    294 static void __exit vboxguestLinuxTermPci(void)
     297static void vboxguestLinuxTermPci(void)
    295298{
    296299    struct pci_dev *pPciDev = g_pPciDev;
     
    363366 * Deregisters the ISR.
    364367 */
    365 static void __exit vboxguestLinuxTermISR(void)
     368static void vboxguestLinuxTermISR(void)
    366369{
    367370    free_irq(g_pPciDev->irq, &g_DevExt);
     
    421424 * Deregisters the device nodes.
    422425 */
    423 static void __exit vboxguestLinuxTermDeviceNodes(void)
     426static void vboxguestLinuxTermDeviceNodes(void)
    424427{
    425428    if (g_iModuleMajor > 0)
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r21102 r21118  
    164164    pDevExt->f32PendingEvents = 0;
    165165    pDevExt->u32ClipboardClientId = 0;
     166    pDevExt->u32MousePosChangedSeq = 0;
    166167
    167168    /*
     
    170171    if (pvMMIOBase)
    171172    {
     173        VMMDevMemory *pVMMDev = (VMMDevMemory *)pvMMIOBase;
    172174        Assert(cbMMIO);
    173         VMMDevMemory *pVMMDev = (VMMDevMemory *)pvMMIOBase;
    174175        if (    pVMMDev->u32Version == VMMDEV_MEMORY_VERSION
    175176            &&  pVMMDev->u32Size >= 32
     
    258259    while (pList->pHead)
    259260    {
    260         PVBOXGUESTWAIT pWait = pList->pHead;
     261        int             rc2;
     262        PVBOXGUESTWAIT  pWait = pList->pHead;
    261263        pList->pHead = pWait->pNext;
    262264
    263265        pWait->pNext = NULL;
    264266        pWait->pPrev = NULL;
    265         int rc2 = RTSemEventMultiDestroy(pWait->Event); AssertRC(rc2);
     267        rc2 = RTSemEventMultiDestroy(pWait->Event); AssertRC(rc2);
    266268        pWait->Event = NIL_RTSEMEVENTMULTI;
    267269        RTMemFree(pWait);
     
    377379void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
    378380{
     381    unsigned i; NOREF(i);
    379382    Log(("VBoxGuestCloseSession: pSession=%p proc=%RTproc (%d) r0proc=%p\n",
    380383         pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */
    381384
    382385#ifdef VBOX_WITH_HGCM
    383     for (unsigned i = 0; i < RT_ELEMENTS(pSession->aHGCMClientIds); i++)
     386    for (i = 0; i < RT_ELEMENTS(pSession->aHGCMClientIds); i++)
    384387        if (pSession->aHGCMClientIds[i])
    385388        {
     
    466469    {
    467470        static unsigned s_cErrors = 0;
     471        int rc;
    468472
    469473        pWait = (PVBOXGUESTWAIT)RTMemAlloc(sizeof(*pWait));
     
    475479        }
    476480
    477         int rc = RTSemEventMultiCreate(&pWait->Event);
     481        rc = RTSemEventMultiCreate(&pWait->Event);
    478482        if (RT_FAILURE(rc))
    479483        {
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/Makefile

    r21112 r21118  
    6363
    6464# override is required by the Debian guys
    65 override MODULE = vboxadd
     65override MODULE = vboxguest
    6666OBJS   = \
    67         cmc.o \
    68         vboxmod.o \
     67        VBoxGuest-linux.o \
     68        VBoxGuest.o \
    6969        GenericRequest.o \
    7070        HGCMInternal.o \
     
    7474        VMMDev.o \
    7575        r0drv/alloc-r0drv.o \
     76        r0drv/initterm-r0drv.o \
    7677        r0drv/memobj-r0drv.o \
     78        r0drv/mpnotification-r0drv.o \
     79        r0drv/powernotification-r0drv.o \
    7780        r0drv/linux/alloc-r0drv-linux.o \
    7881        r0drv/linux/assert-r0drv-linux.o \
     82        r0drv/linux/initterm-r0drv-linux.o \
    7983        r0drv/linux/memobj-r0drv-linux.o \
     84        r0drv/linux/mp-r0drv-linux.o \
     85        r0drv/linux/mpnotification-r0drv-linux.o \
    8086        r0drv/linux/process-r0drv-linux.o \
    8187        r0drv/linux/semevent-r0drv-linux.o \
     88        r0drv/linux/semeventmulti-r0drv-linux.o \
    8289        r0drv/linux/semfastmutex-r0drv-linux.o \
     90        r0drv/linux/thread-r0drv-linux.o \
     91        RTErrConvertFromErrno.o \
    8392        RTErrConvertToErrno.o \
    8493        divdi3.o \
     
    94103        strprintf.o \
    95104        strformat-vbox.o \
    96     RTAssertShouldPanic-generic.o
     105        RTAssertShouldPanic-generic.o
    97106ifeq ($(BUILD_TARGET_ARCH),amd64)
    98107OBJS += \
     
    163172
    164173 # guess kernel version (24 or 26)
    165  ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes) 
     174 ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)
    166175  KERN_VERSION := 24
    167176 else
     
    250259clean:
    251260        for f in . linux r0drv r0drv/linux; do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
    252         rm -rf .vboxadd* .tmp_ver* vboxadd.* Module.symvers Modules.symvers modules.order
     261        rm -rf .vboxguest* .tmp_ver* vboxguest.* Module.symvers Modules.symvers modules.order
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/dkms.conf

    r21112 r21118  
    1 BUILT_MODULE_NAME=vboxadd
     1BUILT_MODULE_NAME=vboxguest
    22DEST_MODULE_LOCATION=/kernel/misc
    3 PACKAGE_NAME=vboxadd
     3PACKAGE_NAME=vboxguest
    44PACKAGE_VERSION=_VERSION_
    55AUTOINSTALL=yes
    6 POST_BUILD="do_Module.symvers vboxadd save $dkms_tree/$module/$module_version/build/Module.symvers"
     6POST_BUILD="do_Module.symvers vboxguest save $dkms_tree/$module/$module_version/build/Module.symvers"
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest

    r21112 r21118  
    11#!/bin/sh
    2 #
     2## @file
    33# Shared file between Makefile.kmk and export_modules
    44#
    5 # Copyright (C) 2007 Sun Microsystems, Inc.
     5
     6#
     7# Copyright (C) 2007-2009 Sun Microsystems, Inc.
    68#
    79# This file is part of VirtualBox Open Source Edition (OSE), as
     
    1820#
    1921
    20 FILES_VBOXADD_NOBIN=" \
     22FILES_VBOXGUEST_NOBIN=" \
    2123    ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
    2224    ${PATH_ROOT}/include/iprt/alloca.h=>include/iprt/alloca.h \
     
    2426    ${PATH_ROOT}/include/iprt/asm.h=>include/iprt/asm.h \
    2527    ${PATH_ROOT}/include/iprt/assert.h=>include/iprt/assert.h \
     28    ${PATH_ROOT}/include/iprt/avl.h=>include/iprt/avl.h \
    2629    ${PATH_ROOT}/include/iprt/cdefs.h=>include/iprt/cdefs.h \
     30    ${PATH_ROOT}/include/iprt/cpuset.h=>include/iprt/cpuset.h \
    2731    ${PATH_ROOT}/include/iprt/ctype.h=>include/iprt/ctype.h \
    2832    ${PATH_ROOT}/include/iprt/err.h=>include/iprt/err.h \
    2933    ${PATH_ROOT}/include/iprt/heap.h=>include/iprt/heap.h \
     34    ${PATH_ROOT}/include/iprt/initterm.h=>include/iprt/initterm.h \
    3035    ${PATH_ROOT}/include/iprt/log.h=>include/iprt/log.h \
    3136    ${PATH_ROOT}/include/iprt/mem.h=>include/iprt/mem.h \
    3237    ${PATH_ROOT}/include/iprt/memobj.h=>include/iprt/memobj.h \
     38    ${PATH_ROOT}/include/iprt/mp.h=>include/iprt/mp.h \
    3339    ${PATH_ROOT}/include/iprt/param.h=>include/iprt/param.h \
     40    ${PATH_ROOT}/include/iprt/power.h=>include/iprt/power.h \
    3441    ${PATH_ROOT}/include/iprt/process.h=>include/iprt/process.h \
    3542    ${PATH_ROOT}/include/iprt/semaphore.h=>include/iprt/semaphore.h \
     
    3845    ${PATH_ROOT}/include/iprt/stdint.h=>include/iprt/stdint.h \
    3946    ${PATH_ROOT}/include/iprt/string.h=>include/iprt/string.h \
     47    ${PATH_ROOT}/include/iprt/thread.h=>include/iprt/thread.h \
    4048    ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \
    4149    ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \
     
    5765    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestLog.h=>VBoxGuestLog.h \
    5866    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuestLib/VMMDev.cpp=>VMMDev.c \
     67    ${PATH_ROOT}/src/VBox/Runtime/include/internal/initterm.h=>include/internal/initterm.h \
    5968    ${PATH_ROOT}/src/VBox/Runtime/include/internal/magics.h=>include/internal/magics.h \
    6069    ${PATH_ROOT}/src/VBox/Runtime/include/internal/memobj.h=>include/internal/memobj.h \
    6170    ${PATH_ROOT}/src/VBox/Runtime/include/internal/string.h=>include/internal/string.h \
     71    ${PATH_ROOT}/src/VBox/Runtime/include/internal/thread.h=>include/internal/thread.h \
    6272    ${PATH_ROOT}/src/VBox/Runtime/common/alloc/heapsimple.cpp=>alloc/heapsimple.c \
     73    ${PATH_ROOT}/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp=>RTErrConvertFromErrno.c \
    6374    ${PATH_ROOT}/src/VBox/Runtime/common/err/RTErrConvertToErrno.cpp=>RTErrConvertToErrno.c \
    6475    ${PATH_ROOT}/src/VBox/Runtime/common/log/logformat.cpp=>logformat.c \
     
    7687    ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
    7788    ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
     89    ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
    7890    ${PATH_ROOT}/src/VBox/Runtime/r0drv/memobj-r0drv.cpp=>r0drv/memobj-r0drv.c \
     91    ${PATH_ROOT}/src/VBox/Runtime/r0drv/mp-r0drv.h=>r0drv/mp-r0drv.h \
     92    ${PATH_ROOT}/src/VBox/Runtime/r0drv/mpnotification-r0drv.c=>r0drv/mpnotification-r0drv.c \
     93    ${PATH_ROOT}/src/VBox/Runtime/r0drv/power-r0drv.h=>r0drv/power-r0drv.h \
     94    ${PATH_ROOT}/src/VBox/Runtime/r0drv/powernotification-r0drv.c=>r0drv/powernotification-r0drv.c \
    7995    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c=>r0drv/linux/alloc-r0drv-linux.c \
    8096    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/assert-r0drv-linux.c=>r0drv/linux/assert-r0drv-linux.c \
     97    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c=>r0drv/linux/initterm-r0drv-linux.c \
    8198    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c=>r0drv/linux/memobj-r0drv-linux.c \
     99    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c=>r0drv/linux/mp-r0drv-linux.c \
     100    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c=>r0drv/linux/mpnotification-r0drv-linux.c \
    82101    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c=>r0drv/linux/process-r0drv-linux.c \
    83102    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c=>r0drv/linux/semevent-r0drv-linux.c \
     
    87106    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/string.h=>r0drv/linux/string.h \
    88107    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \
     108    ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c=>r0drv/linux/thread-r0drv-linux.c \
    89109    ${PATH_ROOT}/src/VBox/Runtime/VBox/logbackdoor.cpp=>logbackdoor.c \
    90110    ${PATH_ROOT}/src/VBox/Runtime/VBox/strformat-vbox.cpp=>strformat-vbox.c \
    91     ${PATH_ROOT}/src/VBox/Additions/linux/module/vboxmod.c=>vboxmod.c \
    92     ${PATH_ROOT}/src/VBox/Additions/linux/module/cmc.c=>cmc.c \
    93     ${PATH_ROOT}/src/VBox/Additions/linux/module/vboxmod.h=>vboxmod.h \
    94     ${PATH_ROOT}/src/VBox/Additions/linux/module/waitcompat.h=>waitcompat.h \
    95     ${PATH_ROOT}/src/VBox/Additions/linux/module/Makefile.module=>Makefile \
     111    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp=>VBoxGuest.c \
     112    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c=>VBoxGuest-linux.c \
     113    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestIDC-unix.c.h=>VBoxGuestIDC-unix.c.h \
     114    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h=>VBoxGuestInternal.h \
     115    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/linux/Makefile=>Makefile \
    96116    ${PATH_OUT}/version-generated.h=>version-generated.h \
    97117"
    98118
    99 FILES_VBOXADD_BIN=" \
     119FILES_VBOXGUEST_BIN=" \
    100120"
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