Changeset 331 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jan 25, 2007 8:47:51 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 17884
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile
r289 r331 533 533 VBox/strformat-vbox.cpp \ 534 534 r0drv/alloc-r0drv.cpp \ 535 r0drv/initterm-r0drv.cpp \ 535 536 generic/RTLogWriteStdErr-stub-generic.cpp \ 536 537 generic/RTLogWriteStdOut-stub-generic.cpp \ … … 541 542 542 543 RuntimeR0Drv_SOURCES.linux = \ 544 alloc/heapsimple.cpp \ 543 545 r0drv/linux/alloc-r0drv-linux.c \ 546 r0drv/linux/initterm-r0drv-linux.c \ 544 547 r0drv/linux/RTLogWriteDebugger-r0drv-linux.c \ 545 548 r0drv/linux/semaphore-r0drv-linux.c \ 546 549 r0drv/linux/spinlock-r0drv-linux.c \ 547 550 r0drv/linux/thread-r0drv-linux.c 548 RuntimeR0Drv_SOURCES.linux.amd64 = \549 alloc/heapsimple.cpp550 551 551 552 RuntimeR0Drv_SOURCES.win = \ 552 553 nt/RTErrConvertFromNtStatus.cpp \ 553 554 r0drv/nt/alloc-r0drv-nt.cpp \ 555 r0drv/nt/initterm-r0drv-nt.cpp \ 554 556 r0drv/nt/RTLogWriteDebugger-r0drv-nt.cpp \ 555 557 r0drv/nt/semaphore-r0drv-nt.cpp \ … … 564 566 RTErrConvertFromErrno.cpp \ 565 567 string/memchr.asm \ 566 r0drv/initterm-r0drv.cpp \567 568 r0drv/memobj-r0drv.cpp \ 568 569 r0drv/thread-r0drv.cpp \ -
trunk/src/VBox/Runtime/alloc/heapsimple.cpp
r329 r331 311 311 - sizeof(RTHEAPSIMPLEINTERNAL); 312 312 pHeapInt->pFreeTail = pHeapInt->pFreeHead = (PRTHEAPSIMPLEFREE)(pHeapInt + 1); 313 for (unsigned i = 0; i < ELEMENTS(pHeapInt->auAlignment); i++) 313 unsigned i; 314 for (i = 0; i < ELEMENTS(pHeapInt->auAlignment); i++) 314 315 pHeapInt->auAlignment[i] = ~(size_t)0; 315 316 … … 448 449 */ 449 450 PRTHEAPSIMPLEBLOCK pRet = NULL; 450 for (PRTHEAPSIMPLEFREE pFree = pHeapInt->pFreeHead; 451 PRTHEAPSIMPLEFREE pFree; 452 for (pFree = pHeapInt->pFreeHead; 451 453 pFree; 452 454 pFree = pFree->pNext) … … 768 770 PRTHEAPSIMPLEFREE pPrev = NULL; 769 771 PRTHEAPSIMPLEFREE pPrevFree = NULL; 770 for (PRTHEAPSIMPLEFREE pBlock = (PRTHEAPSIMPLEFREE)(pHeapInt + 1); 772 PRTHEAPSIMPLEFREE pBlock; 773 for (pBlock = (PRTHEAPSIMPLEFREE)(pHeapInt + 1); 771 774 pBlock; 772 775 pBlock = (PRTHEAPSIMPLEFREE)pBlock->Core.pNext) … … 881 884 Heap, pHeapInt->cbHeap, pHeapInt->cbFree); 882 885 883 for (PRTHEAPSIMPLEFREE pBlock = (PRTHEAPSIMPLEFREE)(pHeapInt + 1); 886 PRTHEAPSIMPLEFREE pBlock; 887 for (pBlock = (PRTHEAPSIMPLEFREE)(pHeapInt + 1); 884 888 pBlock; 885 889 pBlock = (PRTHEAPSIMPLEFREE)pBlock->Core.pNext) -
trunk/src/VBox/Runtime/include/internal/initterm.h
r207 r331 23 23 #define __internal_initterm_h_ 24 24 25 #include < sys/cdefs.h>25 #include <iprt/cdefs.h> 26 26 27 27 __BEGIN_DECLS -
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r291 r331 25 25 *******************************************************************************/ 26 26 #include "the-linux-kernel.h" 27 #include <iprt/ alloc.h>27 #include <iprt/mem.h> 28 28 #include <iprt/assert.h> 29 29 #include "r0drv/alloc-r0drv.h" … … 60 60 * This is as RTMemExecDonate specific to AMD64 Linux/GNU. 61 61 */ 62 RTDECL(void) RTMemExecCleanup(void)62 void rtR0MemExecCleanup(void) 63 63 { 64 64 RTSpinlockDestroy(g_HeapExecSpinlock); … … 82 82 * @param cb The size of the memory block. 83 83 */ 84 RT DECL(int) RTMemExecDonate(void *pvMemory, size_t cb)84 RTR0DECL(int) RTR0MemExecDonate(void *pvMemory, size_t cb) 85 85 { 86 86 int rc; … … 92 92 rc = RTHeapSimpleInit(&g_HeapExec, pvMemory, cb); 93 93 if (RT_FAILURE(rc)) 94 RTMemExecCleanup();94 rtR0MemExecCleanup(); 95 95 } 96 96 return rc; -
trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
r303 r331 1 1 /* $Id$ */ 2 2 /** @file 3 * InnoTek Portable Runtime - Initialization & Termination, R0 Driver, Darwin.3 * InnoTek Portable Runtime - Initialization & Termination, R0 Driver, Linux. 4 4 */ 5 5 … … 24 24 * Header Files * 25 25 *******************************************************************************/ 26 #include "the- darwin-kernel.h"26 #include "the-linux-kernel.h" 27 27 #include <iprt/err.h> 28 28 #include <iprt/assert.h> … … 31 31 32 32 /******************************************************************************* 33 * Global Variables*33 * Internal Functions * 34 34 *******************************************************************************/ 35 /** Pointer to the lock group used by IPRT. */ 36 lck_grp_t *g_pDarwinLockGroup = NULL; 37 35 #ifdef __AMD64__ 36 /* in alloc-r0drv0-linux.c */ 37 extern void rtR0MemExecCleanup(void); 38 #endif 38 39 39 40 40 41 int rtR0InitNative(void) 41 42 { 42 /*43 * Create the lock group.44 */45 g_pDarwinLockGroup = lck_grp_alloc_init("IPRT", LCK_GRP_ATTR_NULL);46 AssertReturn(g_pDarwinLockGroup, VERR_NO_MEMORY);47 48 43 return VINF_SUCCESS; 49 44 } … … 52 47 void rtR0TermNative(void) 53 48 { 54 /* 55 * Free the lock group. 56 */ 57 if (g_pDarwinLockGroup) 58 { 59 lck_grp_free(g_pDarwinLockGroup); 60 g_pDarwinLockGroup = NULL; 61 } 49 #ifdef __AMD64__ 50 rtR0MemExecCleanup(); 51 #endif 62 52 } 63 53 -
trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
r260 r331 23 23 #define __the_linux_kernel_h__ 24 24 25 #ifndef bool /* Linux 2.6.19 C++ nightmare */ 26 #define bool bool_type 27 #define true true_type 28 #define false false_type 29 #define _Bool int 30 #define bool_type_r0drv_the_linux_kernel_h__ 31 #endif 25 /* 26 * Include iprt/types.h to install the bool wrappers. 27 * Then use the linux bool type for all the stuff include here. 28 */ 29 #include <iprt/types.h> 30 #define bool linux_bool 32 31 33 32 #include <linux/autoconf.h> … … 54 53 # define KBUILD_STR(s) #s 55 54 # endif 56 #endif57 #include <iprt/cdefs.h>58 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)59 # undef ALIGN60 55 #endif 61 56 #include <linux/string.h> … … 90 85 #include <asm/div64.h> 91 86 92 #ifdef bool_type_r0drv_the_linux_kernel_h__93 #undef bool94 #undef true95 #undef false96 #undef _Bool97 #undef bool_type_r0drv_the_linux_kernel_h__98 #endif99 100 87 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) 101 88 # ifndef page_to_pfn … … 228 215 #endif 229 216 230 #endif 231 217 /* 218 * Stop using the linux bool type. 219 */ 220 #undef bool 221 222 #endif 223 -
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r303 r331 1 1 /* $Id$ */ 2 2 /** @file 3 * InnoTek Portable Runtime - Initialization & Termination, R0 Driver, Darwin.3 * InnoTek Portable Runtime - Initialization & Termination, R0 Driver, NT. 4 4 */ 5 5 … … 24 24 * Header Files * 25 25 *******************************************************************************/ 26 #include "the- darwin-kernel.h"26 #include "the-nt-kernel.h" 27 27 #include <iprt/err.h> 28 28 #include <iprt/assert.h> 29 29 #include "internal/initterm.h" 30 30 31 32 /*******************************************************************************33 * Global Variables *34 *******************************************************************************/35 /** Pointer to the lock group used by IPRT. */36 lck_grp_t *g_pDarwinLockGroup = NULL;37 38 39 40 31 int rtR0InitNative(void) 41 32 { 42 /*43 * Create the lock group.44 */45 g_pDarwinLockGroup = lck_grp_alloc_init("IPRT", LCK_GRP_ATTR_NULL);46 AssertReturn(g_pDarwinLockGroup, VERR_NO_MEMORY);47 48 33 return VINF_SUCCESS; 49 34 } … … 52 37 void rtR0TermNative(void) 53 38 { 54 /*55 * Free the lock group.56 */57 if (g_pDarwinLockGroup)58 {59 lck_grp_free(g_pDarwinLockGroup);60 g_pDarwinLockGroup = NULL;61 }62 39 } 63 40
Note:
See TracChangeset
for help on using the changeset viewer.