VirtualBox

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


Ignore:
Timestamp:
Jan 27, 2007 8:05:44 PM (18 years ago)
Author:
vboxsync
Message:

RTProcSelf, RTR0ProcHandleSelf, RTR0PROCESS.

Location:
trunk/src/VBox/Runtime/r0drv
Files:
1 edited
2 copied

Legend:

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

    r377 r385  
    3232#include <iprt/param.h>
    3333#include <iprt/string.h>
     34#include <iprt/process.h>
    3435#include "internal/memobj.h"
    3536
     
    9495        {
    9596#ifdef USE_VM_MAP_WIRE
    96             vm_map_t Map = pMemDarwin->Core.u.Lock.Process != NIL_RTPROCESS
    97                          ? get_task_map((task_t)pMemDarwin->Core.u.Lock.Process)
     97            vm_map_t Map = pMemDarwin->Core.u.Lock.R0Process != NIL_RTR0PROCESS
     98                         ? get_task_map((task_t)pMemDarwin->Core.u.Lock.R0Process)
    9899                         : kernel_map;
    99100            kern_return_t kr = vm_map_unwire(Map,
     
    377378        if (pMemDarwin)
    378379        {
    379             pMemDarwin->Core.u.Lock.Process = (RTPROCESS)Task;
     380            pMemDarwin->Core.u.Lock.R0Process = (RTR0PROCESS)Task;
    380381            *ppMem = &pMemDarwin->Core;
    381382            return VINF_SUCCESS;
     
    404405            if (pMemDarwin)
    405406            {
    406                 pMemDarwin->Core.u.Lock.Process = (RTPROCESS)Task;
     407                pMemDarwin->Core.u.Lock.R0Process = (RTR0PROCESS)Task;
    407408                pMemDarwin->pMemDesc = pMemDesc;
    408409                *ppMem = &pMemDarwin->Core;
     
    470471                if (pMemDarwin)
    471472                {
    472                     pMemDarwin->Core.u.Mapping.Process = NIL_RTPROCESS;
     473                    pMemDarwin->Core.u.Mapping.R0Process = NIL_RTR0PROCESS;
    473474                    pMemDarwin->pMemMap = pMemMap;
    474475                    *ppMem = &pMemDarwin->Core;
     
    514515                if (pMemDarwin)
    515516                {
    516                     pMemDarwin->Core.u.Mapping.Process = /*RTProcSelf()*/(RTPROCESS)current_task();
     517                    pMemDarwin->Core.u.Mapping.R0Process = RTR0ProcHandleSelf();
    517518                    pMemDarwin->pMemMap = pMemMap;
    518519                    *ppMem = &pMemDarwin->Core;
     
    546547    {
    547548        ppnum_t PgNo;
    548         if (pMemDarwin->Core.u.Lock.Process == NIL_RTPROCESS)
     549        if (pMemDarwin->Core.u.Lock.R0Process == NIL_RTR0PROCESS)
    549550            PgNo = pmap_find_phys(kernel_pmap, (uintptr_t)pMemDarwin->Core.pv + iPage * PAGE_SIZE);
    550551        else
     
    575576                AssertReturn(s_offPmap >= 0, NIL_RTHCPHYS);
    576577            }
    577             pmap_t Pmap = *(pmap_t *)((uintptr_t)get_task_map((task_t)pMemDarwin->Core.u.Lock.Process) + s_offPmap);
     578            pmap_t Pmap = *(pmap_t *)((uintptr_t)get_task_map((task_t)pMemDarwin->Core.u.Lock.R0Process) + s_offPmap);
    578579            PgNo = pmap_find_phys(Pmap, (uintptr_t)pMemDarwin->Core.pv + iPage * PAGE_SIZE);
    579580        }
  • trunk/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.cpp

    r384 r385  
    11/* $Id$ */
    22/** @file
    3  * InnoTek Portable Runtime - Process, Ring-0 Driver, Darwin.
     3 * InnoTek Portable Runtime - Process, Ring-0 Driver, Linux.
    44 */
    55
     
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #include "the-darwin-kernel.h"
     25#include "the-linux-kernel.h"
    2626#include <iprt/process.h>
    2727
     
    2929RTDECL(RTPROCESS) RTProcSelf(void)
    3030{
    31     return proc_selfpid();
     31    return (RTPROCESS)current->tgid;
    3232}
    3333
     
    3535RTR0DECL(RTR0PROCESS) RTR0ProcHandleSelf(void)
    3636{
    37     return (RTR0PROCESS)current_task();
     37    return (RTR0PROCESS)current->tgid;
    3838}
    3939
  • trunk/src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp

    r384 r385  
    11/* $Id$ */
    22/** @file
    3  * InnoTek Portable Runtime - Process, Ring-0 Driver, Darwin.
     3 * InnoTek Portable Runtime - Process, Ring-0 Driver, NT.
    44 */
    55
     
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #include "the-darwin-kernel.h"
     25#include "the-nt-kernel.h"
    2626#include <iprt/process.h>
    2727
     
    2929RTDECL(RTPROCESS) RTProcSelf(void)
    3030{
    31     return proc_selfpid();
     31    return (RTPROCESS)PsGetCurrentProcessId();
    3232}
    3333
     
    3535RTR0DECL(RTR0PROCESS) RTR0ProcHandleSelf(void)
    3636{
    37     return (RTR0PROCESS)current_task();
     37    return (RTR0PROCESS)PsGetCurrentProcess();
    3838}
    3939
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