VirtualBox

Changeset 106544 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Oct 21, 2024 7:48:53 AM (3 months ago)
Author:
vboxsync
Message:

Runtime/r0drv/nt/initterm-r0drv-nt.cpp: Make it build on win.arm64, disable QuantumEnd and DpcQueueDepth hack on ARM, they shouldn't be required there, bugref:10732

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp

    r106061 r106544  
    4040*********************************************************************************************************************************/
    4141#include "the-nt-kernel.h"
    42 #include <iprt/asm-amd64-x86.h>
     42#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
     43# include <iprt/asm-amd64-x86.h>
     44#elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
     45# include <iprt/asm-arm.h>
     46#else
     47# error "Port me"
     48#endif
    4349#include <iprt/dbg.h>
    4450#include <iprt/errcore.h>
     
    4753#include "internal-r0drv-nt.h"
    4854#include "symdb.h"
     55#if !defined(RT_ARCH_AMD64) && !defined(RT_ARCH_X86)
     56# define RTNTSDB_NO_DATA
     57#endif
    4958#include "symdbdata.h"
    5059
     
    267276    __except(EXCEPTION_EXECUTE_HANDLER)
    268277    {
     278#ifndef RTNTSDB_NO_DATA
    269279        DbgPrint("IPRT: %#d Exception\n", pSet - &g_artNtSdbSets[0]);
     280#endif
    270281        return false;
    271282    }
     
    350361    GET_SYSTEM_ROUTINE(MmAllocatePagesForMdlEx);
    351362    GET_SYSTEM_ROUTINE(MmFreePagesFromMdl);
     363#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    352364    GET_SYSTEM_ROUTINE(MmMapLockedPagesSpecifyCache);
     365#else
     366    /* MmMapLockedPagesSpecifyCache is a pre processor macro on arm64. */
     367    g_pfnrtMmMapLockedPagesSpecifyCache = (decltype(MmMapLockedPagesSpecifyCache) *)RTR0DbgKrnlInfoGetSymbol(hKrnlInfo, NULL, "MmMapLockedPagesSpecifyCache");
     368#endif
    353369    GET_SYSTEM_ROUTINE(MmAllocateContiguousMemorySpecifyCache);
    354370    GET_SYSTEM_ROUTINE(MmSecureVirtualMemory);
     
    387403
    388404
     405#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    389406    /*
    390407     * HACK ALERT! (and déjà vu warning - remember win32k.sys on OS/2?)
     
    423440    __try /* Warning. This try/except statement may provide some false safety. */
    424441    {
    425 #if defined(RT_ARCH_X86)
     442# if defined(RT_ARCH_X86)
    426443        PKPCR    pPcr   = (PKPCR)__readfsdword(RT_UOFFSETOF(KPCR,SelfPcr));
    427444        pbPrcb = (uint8_t *)pPcr->Prcb;
    428 #elif defined(RT_ARCH_AMD64)
     445# elif defined(RT_ARCH_AMD64)
    429446        PKPCR    pPcr   = (PKPCR)__readgsqword(RT_UOFFSETOF(KPCR,Self));
    430447        pbPrcb = (uint8_t *)pPcr->CurrentPrcb;
    431 #else
    432 # error "port me"
     448# else
     449#  error "port me"
    433450        pbPrcb = NULL;
    434 #endif
     451# endif
    435452    }
    436453    __except(EXCEPTION_EXECUTE_HANDLER)
     
    500517    KeLowerIrql(OldIrql); /* Lowering the IRQL early in the hope that we may catch exceptions below. */
    501518
    502 #ifndef IN_GUEST
     519# ifndef IN_GUEST
    503520    if (!g_offrtNtPbQuantumEnd && !g_offrtNtPbDpcQueueDepth)
    504521        DbgPrint("IPRT: Neither _KPRCB::QuantumEnd nor _KPRCB::DpcQueueDepth was not found! Kernel %u.%u %u %s\n",
    505522                 OsVerInfo.uMajorVer, OsVerInfo.uMinorVer, OsVerInfo.uBuildNo, OsVerInfo.fChecked ? "checked" : "free");
    506 # ifdef DEBUG
     523#  ifdef DEBUG
    507524    else
    508525        DbgPrint("IPRT: _KPRCB:{.QuantumEnd=%x/%d, .DpcQueueDepth=%x/%d} Kernel %u.%u %u %s\n",
    509526                 g_offrtNtPbQuantumEnd, g_cbrtNtPbQuantumEnd, g_offrtNtPbDpcQueueDepth, g_offrtNtPbDpcQueueDepth,
    510527                 OsVerInfo.uMajorVer, OsVerInfo.uMinorVer, OsVerInfo.uBuildNo, OsVerInfo.fChecked ? "checked" : "free");
     528#  endif
    511529# endif
    512 #endif
     530#endif /* RT_ARCH_AMD64 || RT_ARCH_X86 */
    513531
    514532    /*
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