From 5d30abd488109fafecdfb3119449aefa5dd685b2 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Mon, 22 Aug 2011 17:33:44 -0500 Subject: Add environment var to remove debug messages. - Add printkd function. - Create HOSTBOOT_DEBUG env var for printk. - Update trace interfaces to utilize HOSTBOOT_DEBUG. - Fix compile errors due to unused variables. Change-Id: Ib18c3ecd51ca333e0118949bf35476e9c5aa46a7 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/273 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/libc++/builtins.C | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/libc++') diff --git a/src/libc++/builtins.C b/src/libc++/builtins.C index 0306556cf..e65d1d967 100755 --- a/src/libc++/builtins.C +++ b/src/libc++/builtins.C @@ -25,7 +25,6 @@ #include #include -//#include void* operator new(size_t s) { @@ -63,19 +62,19 @@ extern "C" int __cxa_guard_acquire(volatile uint64_t* gv) // 0 -> uninitialized // 1 -> locked // 2 -> unlocked and initialized - + uint32_t v = __sync_val_compare_and_swap((volatile uint32_t*)gv, 0, 1); if (v == 0) return 1; if (v == 2) return 0; - + // Wait for peer thread to perform initialization (state 2). while(2 != *(volatile uint32_t*)gv); - + // Instruction barrier to ensure value is set before later loads execute. - isync(); - + isync(); + return 0; } @@ -127,7 +126,7 @@ Util::Locked::List g_dtorRegistry; void call_dtors(void * i_dso_handle) { DtorEntry_t * entry = NULL; - // A module is never exited by different threads so + // A module is never exited by different threads so // assume no locking needed here. while( NULL != (entry = g_dtorRegistry.find(i_dso_handle)) ) { @@ -142,12 +141,11 @@ extern "C" int __cxa_atexit(void (*i_dtor)(void*), void* i_arg, void* i_dso_handle) { - // Base kernel code may try to call this before mem heap is + // Base kernel code may try to call this before mem heap is // available - so don't add it. // TODO - Only need dtors for extended image modules if(i_dso_handle != __dso_handle) { - // printk("Register dtor for %p\n",i_dso_handle); DtorEntry_t * entry = new DtorEntry_t; entry->key = i_dso_handle; entry->dtor = i_dtor; -- cgit v1.2.1