VirtualBox

Changeset 9501 in vbox


Ignore:
Timestamp:
Jun 8, 2008 1:15:34 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
31772
Message:

Preparing 64-bit guest additions building (focusing on windows atm.)

Location:
trunk/src/VBox/Additions/WINNT/VBoxGuest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/Makefile.kmk

    r8760 r9501  
    2828#
    2929SYSMODS += VBoxGuest
     30ifdef VBOX_WITH_64BIT_ADDITIONS
     31VBoxGuest_TEMPLATE    = VBOXGUESTR0
     32else
    3033VBoxGuest_TEMPLATE    = VBOXW32GUESTR0
     34VBoxGuest_SDKS        = W2K3DDKX86 WINPSDKINCS
     35endif
    3136ifdef VBOX_SIGN_ADDITIONS
    3237 VBoxGuest_NOINST     = true
    3338endif
    34 VBoxGuest_SDKS        = W2K3DDKX86 WINPSDKINCS
    3539VBoxGuest_DEFS        = LOG_TO_BACKDOOR VBGL_VBOXGUEST VBOX_HGCM VBOX_REBOOT_ON_UNINSTALL
    3640#VBoxGuest_DEFS       += LOG_ENABLED
    3741VBoxGuest_INCS        = ../include
     42ifdef VBOX_WITH_64BIT_ADDITIONS
     43VBoxGuest_LDFLAGS.x86   = -Entry:DriverEntry@8
     44VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
     45else
    3846VBoxGuest_LDFLAGS     = -Entry:DriverEntry@8
     47endif
    3948VBoxGuest_SOURCES     = \
    4049        VBoxGuest.cpp \
     
    4251        Helper.cpp \
    4352        VBoxGuest.rc
     53ifdef VBOX_WITH_64BIT_ADDITIONS
     54VBoxGuest_LIBS        = \
     55        $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
     56        $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
     57        $(PATH_SDK_W2K3DDK_LIB)/win32k.lib \
     58        $(VBOX_LIB_VBGL_R0BASE) \
     59        $(VBOX_LIB_IPRT_GUEST_R0)
     60else
    4461VBoxGuest_LIBS        = \
    4562        $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib \
    4663        $(PATH_SDK_W2K3DDKX86_LIB)/win32k.lib \
    4764        $(PATH_SDK_W2K3DDKX86_LIB)/ntoskrnl.lib \
    48         $(PATH_SDK_W2K3DDKX86_LIB)/hal.lib \
     65        $(PATH_SDK_W2K3DDKX86_LIB)/hal.lib
    4966        $(PATH_LIB)/additions/VBoxGuestLibBase$(VBOXW32GUEST_SUFF_LIB) \
    5067        $(PATH_LIB)/additions/RuntimeW32GuestR0$(VBOXW32GUEST_SUFF_LIB)
     68endif
    5169
    5270
    5371#
    54 # VBoxGuestNT - NT version of the driver.
     72# VBoxGuestNT - NT version of the driver (x86 only).
    5573#
     74ifdef VBOX_WITH_64BIT_ADDITIONS
     75SYSMODS.x86 += VBoxGuestNT
     76VBoxGuestNT_TEMPLATE  = VBOXGUESTR0
     77else
    5678SYSMODS += VBoxGuestNT
    5779VBoxGuestNT_TEMPLATE  = VBOXW32GUESTR0
    5880VBoxGuestNT_SDKS      = W2K3DDKX86 WINPSDKINCS
     81endif
    5982VBoxGuestNT_DEFS      = $(VBoxGuest_DEFS) TARGET_NT4
    6083VBoxGuestNT_INCS      = $(VBoxGuest_INCS)
     
    6588        NTLegacy.cpp \
    6689        VBoxGuest.rc
     90ifdef VBOX_WITH_64BIT_ADDITIONS
     91VBoxGuestNT_LIBS      = \
     92        $(PATH_SDK_W2K3DDKX86_LIB)/exsup.lib \
     93        $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib \
     94        $(PATH_SDK_W2K3DDKX86_LIB)/ntoskrnl.lib \
     95        $(PATH_SDK_W2K3DDKX86_LIB)/hal.lib \
     96        $(VBOX_LIB_VBGL_R0BASE) \
     97        $(VBOX_LIB_IPRT_GUEST_R0_NT4)
     98else
    6799VBoxGuestNT_LIBS      = \
    68100        $(PATH_SDK_W2K3DDKX86_LIB)/exsup.lib \
     
    72104        $(PATH_LIB)/additions/VBoxGuestLibBase$(VBOXW32GUEST_SUFF_LIB) \
    73105        $(PATH_LIB)/additions/RuntimeW32NT4GuestR0$(VBOXW32GUEST_SUFF_LIB)
    74 #       $(PATH_SDK_W2K3DDKX86_LIB)/win32k.lib  - not needed?
    75 
     106endif
    76107
    77108#
     
    79110#
    80111#PROGRAMS += VBoxGuestInst
    81 VBoxGuestInst_TEMPLATE= VBOXW32GUESTR3
     112VBoxGuestInst_TEMPLATE= VBOXGUESTR3EXE
    82113VBoxGuestInst_SOURCES = VBoxGuestInst.cpp
    83114
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp

    r8781 r9501  
    4040
    4141#ifdef TARGET_NT4
    42 /* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so... 
     42/* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so...
    4343 * The same for ExAllocatePool.
    4444 */
     
    345345
    346346    dprintf(("VBoxHGCMCallback\n"));
    347        
    348     /* Possible problem with request completion right between the fu32Flags check and KeWaitForSingleObject 
     347
     348    /* Possible problem with request completion right between the fu32Flags check and KeWaitForSingleObject
    349349     * call; introduce a timeout to make sure we don't wait indefinitely.
    350350     */
     
    357357         *       calling process is being killed.
    358358         *       When alertable is TRUE, the wait sometimes ends with STATUS_USER_APC.
    359          */ 
     359         */
    360360        NTSTATUS rc = KeWaitForSingleObject (&pDevExt->keventNotification, Executive,
    361361                                             UserMode,
     
    400400#endif /* VBOX_HGCM */
    401401
    402 static bool
    403 __declspec (naked) __fastcall
    404 TestAndClearEvent (PVBOXGUESTDEVEXT pDevExt, int iBitOffset)
    405 {
    406     _asm {
    407         lock btr PVBOXGUESTDEVEXT[ecx].u32Events, edx;
    408         setc al;
    409         movzx eax, al;
    410         ret;
    411     }
    412 }
    413 
    414402static bool IsPowerOfTwo (uint32_t val)
    415403{
    416404    return (val & (val - 1)) == 0;
    417 }
    418 
    419 static int __declspec (naked) __fastcall GetMsb32 (uint32_t val)
    420 {
    421     _asm {
    422         bsf eax, ecx;
    423         ret;
    424     }
    425405}
    426406
     
    521501                    /* Calls to MmProbeAndLockPages must be enclosed in a try/except block. */
    522502                    MmProbeAndLockPages (pMdl, KernelMode, IoModifyAccess);
    523                 } 
    524                 __except(EXCEPTION_EXECUTE_HANDLER) 
     503                }
     504                __except(EXCEPTION_EXECUTE_HANDLER)
    525505                {
    526506                    dprintf(("MmProbeAndLockPages failed!\n"));
     
    775755
    776756            eventInfo->u32EventFlagsOut = 0;
    777             int iBitOffset = GetMsb32 (eventInfo->u32EventMaskIn);
     757            int iBitOffset = ASMBitFirstSetU32 (eventInfo->u32EventMaskIn) - 1;
    778758            bool fTimeout = (eventInfo->u32TimeoutIn != ~0L);
    779759
    780760            dprintf (("mask = %d, iBitOffset = %d\n", iBitOffset, eventInfo->u32EventMaskIn));
    781761
    782             /* Possible problem with request completion right between the pending event check and KeWaitForSingleObject 
     762            /* Possible problem with request completion right between the pending event check and KeWaitForSingleObject
    783763             * call; introduce a timeout (if none was specified) to make sure we don't wait indefinitely.
    784764             */
     
    791771            for (;;)
    792772            {
    793                 bool fEventPending = TestAndClearEvent (pDevExt, iBitOffset);
     773                bool fEventPending = ASMAtomicBitTestAndClear(&pDevExt->u32Events, iBitOffset);
    794774                if (fEventPending)
    795775                {
     
    998978            Status = vboxHGCMVerifyIOBuffers (pStack,
    999979                                              sizeof (VBoxGuestHGCMCallInfo));
    1000                                              
     980
    1001981            if (Status != STATUS_SUCCESS)
    1002982            {
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