VirtualBox

Ignore:
Timestamp:
Jun 21, 2011 12:40:01 PM (13 years ago)
Author:
vboxsync
Message:

IPRT/darwin-r0drv: Implemented RTMpPokeCpu and RTThreadPreemptIsPending/Trusty using the right kernel APIs.

File:
1 edited

Legend:

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

    r36555 r37575  
    3434#include <iprt/err.h>
    3535#include <iprt/assert.h>
     36#include <iprt/darwin/machkernel.h>
    3637#include "internal/initterm.h"
     38
    3739
    3840
     
    4143*******************************************************************************/
    4244/** Pointer to the lock group used by IPRT. */
    43 lck_grp_t *g_pDarwinLockGroup = NULL;
     45lck_grp_t                  *g_pDarwinLockGroup = NULL;
     46/** Pointer to the ast_pending function, if found. */
     47PFNR0DARWINASTPENDING       g_pfnR0DarwinAstPending = NULL;
     48/** Pointer to the cpu_interrupt function, if found. */
     49PFNR0DARWINCPUINTERRUPT     g_pfnR0DarwinCpuInterrupt = NULL;
    4450
    4551
     
    5662     */
    5763    int rc = rtThreadPreemptDarwinInit();
     64    if (RT_SUCCESS(rc))
     65    {
     66        /*
     67         * Try resolve kernel symbols we need but apple don't wish to give us.
     68         */
     69        RTR0MACHKERNEL hKernel;
     70        rc = RTR0MachKernelOpen("/mach_kernel", &hKernel);
     71        if (RT_SUCCESS(rc))
     72        {
     73            RTR0MachKernelGetSymbol(hKernel, "ast_pending",   (void **)&g_pfnR0DarwinAstPending);
     74            printf("ast_pending=%p\n", g_pfnR0DarwinAstPending);
     75            RTR0MachKernelGetSymbol(hKernel, "cpu_interrupt", (void **)&g_pfnR0DarwinCpuInterrupt);
     76            printf("cpu_interrupt=%p\n", g_pfnR0DarwinCpuInterrupt);
     77            RTR0MachKernelClose(hKernel);
     78        }
     79        if (RT_FAILURE(rc))
     80        {
     81            printf("rtR0InitNative: warning! failed to resolve special kernel symbols\n");
     82            rc = VINF_SUCCESS;
     83        }
     84    }
    5885    if (RT_FAILURE(rc))
    5986        rtR0TermNative();
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