diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-10-31 16:01:11 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-12-14 10:18:59 -0600 |
commit | da3888270ff596441bf78535c26dee0a7d923145 (patch) | |
tree | 019b88ce38e87b8346e0ef659f058556e26dec42 /src/lib | |
parent | 6d7290eca2b0e753d1b954a56e2c82284dd23eb9 (diff) | |
download | talos-hostboot-da3888270ff596441bf78535c26dee0a7d923145.tar.gz talos-hostboot-da3888270ff596441bf78535c26dee0a7d923145.zip |
Lockless trace implementation
RTC: 35396
Change-Id: I96ea0d95606f04abb4dc2b0470345ca475b53912
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2520
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/sync.C | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/lib/sync.C b/src/lib/sync.C index 7dce4c62d..38cd58025 100644 --- a/src/lib/sync.C +++ b/src/lib/sync.C @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/lib/sync.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/lib/sync.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #include <arch/ppc.H> #include <sys/sync.h> #include <sys/syscall.h> @@ -31,41 +31,41 @@ using namespace Systemcalls; //----------------------------------------------------------------------------- -uint64_t futex_wait(uint64_t * i_addr, uint64_t i_val) +int futex_wait(uint64_t * i_addr, uint64_t i_val) { - return (uint64_t) _syscall5(SYS_FUTEX, - (void *)FUTEX_WAIT, - i_addr, - (void *)i_val, - NULL, - NULL); + return (int64_t) _syscall5(SYS_FUTEX, + (void *)FUTEX_WAIT, + i_addr, + (void *)i_val, + NULL, + NULL); } //----------------------------------------------------------------------------- -uint64_t futex_wake(uint64_t * i_addr, uint64_t i_count) +int futex_wake(uint64_t * i_addr, uint64_t i_count) { - return (uint64_t) _syscall5(SYS_FUTEX, - (void *)FUTEX_WAKE, - i_addr, - (void *)i_count, - NULL, - NULL); + return (int64_t) _syscall5(SYS_FUTEX, + (void *)FUTEX_WAKE, + i_addr, + (void *)i_count, + NULL, + NULL); } //----------------------------------------------------------------------------- -uint64_t futex_requeue(uint64_t * i_addr, - uint64_t i_count1, - uint64_t i_count2, - uint64_t * i_futex2) +int64_t futex_requeue(uint64_t * i_addr, + uint64_t i_count1, + uint64_t i_count2, + uint64_t * i_futex2) { - return (uint64_t) _syscall5(SYS_FUTEX, - (void *)FUTEX_REQUEUE, - i_addr, - (void *)i_count1, - (void *)i_count2, - i_futex2); + return (int64_t) _syscall5(SYS_FUTEX, + (void *)FUTEX_REQUEUE, + i_addr, + (void *)i_count1, + (void *)i_count2, + i_futex2); } //----------------------------------------------------------------------------- @@ -241,7 +241,7 @@ void sync_cond_broadcast(sync_cond_t * i_cond) // wake up all __sync_fetch_and_add(&(i_cond->sequence),1); - // need to wake up one on the sequence and + // need to wake up one on the sequence and // re-queue the rest onto the mutex m; futex_requeue(&(i_cond->sequence),1,UINT64_MAX,&(m->iv_val)); } |