- Timestamp:
- Jan 27, 2007 8:05:44 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/process.h
r204 r385 24 24 #include <iprt/cdefs.h> 25 25 #include <iprt/types.h> 26 27 #ifndef IN_RING328 # error "The RTProc APIs are Ring-3 only!"29 #endif30 31 26 32 27 __BEGIN_DECLS … … 85 80 86 81 82 /** 83 * Get the current process identifier. 84 * 85 * @returns Process identifier. 86 */ 87 RTDECL(RTPROCESS) RTProcSelf(void); 88 89 90 #ifdef IN_RING0 91 /** 92 * Get the current process handle. 93 * 94 * @returns Ring-0 process handle. 95 */ 96 RTR0DECL(RTR0PROCESS) RTR0ProcHandleSelf(void); 97 #endif 98 87 99 88 100 #ifdef IN_RING3 … … 102 114 */ 103 115 RTR3DECL(RTPROCPRIORITY) RTProcGetPriority(void); 104 105 /**106 * Get the identifier for the current process.107 *108 * @returns Process identifier.109 */110 RTR3DECL(RTPROCESS) RTProcSelf(void);111 116 112 117 /** … … 215 220 RTR3DECL(char *) RTProcGetExecutableName(char *pszExecName, size_t cchExecName); 216 221 222 #endif /* IN_RING3 */ 223 224 /** @} */ 225 226 __END_DECLS 227 217 228 #endif 218 229 219 /** @} */220 221 __END_DECLS222 223 #endif224 -
trunk/include/iprt/types.h
r331 r385 40 40 41 41 # if defined(__LINUX__) && defined(__KERNEL__) 42 /* 42 /* 43 43 * Kludge for the linux kernel: 44 44 * 1. sys/types.h doesn't mix with the kernel. 45 * 2. Starting with 2.6.19 linux/types.h typedefs bool and linux/stddef.h 45 * 2. Starting with 2.6.19 linux/types.h typedefs bool and linux/stddef.h 46 46 * declares false and true as enum values. 47 47 * We work around these issues here and nowhere else. … … 119 119 # else 120 120 typedef unsigned char bool; 121 # endif 121 # endif 122 122 # ifndef true 123 123 # define true (1) … … 905 905 #define NIL_RTNATIVETHREAD (~(RTNATIVETHREAD)0) 906 906 907 /** Process handle. */907 /** Process identifier. */ 908 908 typedef RTHCUINTPTR RTPROCESS; 909 /** Pointer to a process handle. */909 /** Pointer to a process identifier. */ 910 910 typedef RTPROCESS *PRTPROCESS; 911 /** Nil process handle. */911 /** Nil process identifier. */ 912 912 #define NIL_RTPROCESS (~(RTPROCESS)0) 913 914 /** Process ring-0 handle. */ 915 typedef RTR0UINTPTR RTR0PROCESS; 916 /** Pointer to a ring-0 process handle. */ 917 typedef RTR0PROCESS *PRTR0PROCESS; 918 /** Nil ring-0 process handle. */ 919 #define NIL_RTR0PROCESS (~(RTR0PROCESS)0) 913 920 914 921 /** @typedef RTSEMEVENT -
trunk/src/VBox/Runtime/Makefile
r331 r385 393 393 VBoxRT_LIBS.darwin = \ 394 394 iconv 395 VBoxRT_LDFLAGS.darwin = -framework IOKit 395 396 ifdef VBOX_USE_VCC80 396 397 VBoxRT_LDFLAGS.win = /MANIFEST … … 545 546 r0drv/linux/alloc-r0drv-linux.c \ 546 547 r0drv/linux/initterm-r0drv-linux.c \ 548 r0drv/linux/process-r0drv-linux.cpp \ 547 549 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \ 548 550 r0drv/linux/semaphore-r0drv-linux.c \ … … 554 556 r0drv/nt/alloc-r0drv-nt.cpp \ 555 557 r0drv/nt/initterm-r0drv-nt.cpp \ 558 r0drv/nt/process-r0drv-nt.cpp \ 556 559 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \ 557 560 r0drv/nt/semaphore-r0drv-nt.cpp \ … … 571 574 r0drv/darwin/memobj-r0drv-darwin.cpp \ 572 575 r0drv/darwin/initterm-r0drv-darwin.cpp \ 576 r0drv/darwin/process-r0drv-darwin.cpp \ 573 577 r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp \ 574 578 r0drv/darwin/semaphore-r0drv-darwin.cpp \ -
trunk/src/VBox/Runtime/include/internal/memobj.h
r217 r385 156 156 { 157 157 /** The process that owns the locked memory. 158 * This is NIL_RT PROCESS if it's kernel memory. */159 RT PROCESSProcess;158 * This is NIL_RTR0PROCESS if it's kernel memory. */ 159 RTR0PROCESS R0Process; 160 160 } Lock; 161 161 … … 173 173 { 174 174 /** The process that owns the reserved memory. 175 * This is NIL_RT PROCESS if it's kernel memory. */176 RT PROCESSProcess;175 * This is NIL_RTR0PROCESS if it's kernel memory. */ 176 RTR0PROCESS R0Process; 177 177 } ResVirt; 178 178 … … 181 181 { 182 182 /** The process that owns the reserved memory. 183 * This is NIL_RT PROCESS if it's kernel memory. */184 RT PROCESSProcess;183 * This is NIL_RTR0PROCESS if it's kernel memory. */ 184 RTR0PROCESS R0Process; 185 185 } Mapping; 186 186 } u; -
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r377 r385 32 32 #include <iprt/param.h> 33 33 #include <iprt/string.h> 34 #include <iprt/process.h> 34 35 #include "internal/memobj.h" 35 36 … … 94 95 { 95 96 #ifdef USE_VM_MAP_WIRE 96 vm_map_t Map = pMemDarwin->Core.u.Lock. Process != NIL_RTPROCESS97 ? 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) 98 99 : kernel_map; 99 100 kern_return_t kr = vm_map_unwire(Map, … … 377 378 if (pMemDarwin) 378 379 { 379 pMemDarwin->Core.u.Lock. Process = (RTPROCESS)Task;380 pMemDarwin->Core.u.Lock.R0Process = (RTR0PROCESS)Task; 380 381 *ppMem = &pMemDarwin->Core; 381 382 return VINF_SUCCESS; … … 404 405 if (pMemDarwin) 405 406 { 406 pMemDarwin->Core.u.Lock. Process = (RTPROCESS)Task;407 pMemDarwin->Core.u.Lock.R0Process = (RTR0PROCESS)Task; 407 408 pMemDarwin->pMemDesc = pMemDesc; 408 409 *ppMem = &pMemDarwin->Core; … … 470 471 if (pMemDarwin) 471 472 { 472 pMemDarwin->Core.u.Mapping. Process = NIL_RTPROCESS;473 pMemDarwin->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; 473 474 pMemDarwin->pMemMap = pMemMap; 474 475 *ppMem = &pMemDarwin->Core; … … 514 515 if (pMemDarwin) 515 516 { 516 pMemDarwin->Core.u.Mapping. Process = /*RTProcSelf()*/(RTPROCESS)current_task();517 pMemDarwin->Core.u.Mapping.R0Process = RTR0ProcHandleSelf(); 517 518 pMemDarwin->pMemMap = pMemMap; 518 519 *ppMem = &pMemDarwin->Core; … … 546 547 { 547 548 ppnum_t PgNo; 548 if (pMemDarwin->Core.u.Lock. Process == NIL_RTPROCESS)549 if (pMemDarwin->Core.u.Lock.R0Process == NIL_RTR0PROCESS) 549 550 PgNo = pmap_find_phys(kernel_pmap, (uintptr_t)pMemDarwin->Core.pv + iPage * PAGE_SIZE); 550 551 else … … 575 576 AssertReturn(s_offPmap >= 0, NIL_RTHCPHYS); 576 577 } 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); 578 579 PgNo = pmap_find_phys(Pmap, (uintptr_t)pMemDarwin->Core.pv + iPage * PAGE_SIZE); 579 580 } -
trunk/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.cpp
r384 r385 1 1 /* $Id$ */ 2 2 /** @file 3 * InnoTek Portable Runtime - Process, Ring-0 Driver, Darwin.3 * InnoTek Portable Runtime - Process, Ring-0 Driver, Linux. 4 4 */ 5 5 … … 23 23 * Header Files * 24 24 *******************************************************************************/ 25 #include "the- darwin-kernel.h"25 #include "the-linux-kernel.h" 26 26 #include <iprt/process.h> 27 27 … … 29 29 RTDECL(RTPROCESS) RTProcSelf(void) 30 30 { 31 return proc_selfpid();31 return (RTPROCESS)current->tgid; 32 32 } 33 33 … … 35 35 RTR0DECL(RTR0PROCESS) RTR0ProcHandleSelf(void) 36 36 { 37 return (RTR0PROCESS)current _task();37 return (RTR0PROCESS)current->tgid; 38 38 } 39 39 -
trunk/src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp
r384 r385 1 1 /* $Id$ */ 2 2 /** @file 3 * InnoTek Portable Runtime - Process, Ring-0 Driver, Darwin.3 * InnoTek Portable Runtime - Process, Ring-0 Driver, NT. 4 4 */ 5 5 … … 23 23 * Header Files * 24 24 *******************************************************************************/ 25 #include "the- darwin-kernel.h"25 #include "the-nt-kernel.h" 26 26 #include <iprt/process.h> 27 27 … … 29 29 RTDECL(RTPROCESS) RTProcSelf(void) 30 30 { 31 return proc_selfpid();31 return (RTPROCESS)PsGetCurrentProcessId(); 32 32 } 33 33 … … 35 35 RTR0DECL(RTR0PROCESS) RTR0ProcHandleSelf(void) 36 36 { 37 return (RTR0PROCESS) current_task();37 return (RTR0PROCESS)PsGetCurrentProcess(); 38 38 } 39 39 -
trunk/src/VBox/Runtime/r3/process.cpp
r1 r385 43 43 * @returns Process identifier. 44 44 */ 45 RT R3DECL(RTPROCESS) RTProcSelf(void)45 RTDECL(RTPROCESS) RTProcSelf(void) 46 46 { 47 47 RTPROCESS Self = g_ProcessSelf;
Note:
See TracChangeset
for help on using the changeset viewer.