summaryrefslogtreecommitdiffstats
path: root/src/usr/devicefw
diff options
context:
space:
mode:
authordgilbert <dgilbert@us.ibm.com>2011-06-03 12:54:41 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-06-17 12:23:52 -0500
commit609d6810b8bc92dc979f8bbb8e7e7d7b7b5d9490 (patch)
treecd517ec2e10a95638e675b037bb24e2d01296ef4 /src/usr/devicefw
parentf64ba52098e248e62b4ddb14c0a027c21066e9e2 (diff)
downloadtalos-hostboot-609d6810b8bc92dc979f8bbb8e7e7d7b7b5d9490.tar.gz
talos-hostboot-609d6810b8bc92dc979f8bbb8e7e7d7b7b5d9490.zip
Initial futex support
Change-Id: I51a4f1117085ce23c7993c1a38e4124596636726 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/141 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/devicefw')
-rw-r--r--src/usr/devicefw/associator.C14
-rw-r--r--src/usr/devicefw/associator.H4
2 files changed, 8 insertions, 10 deletions
diff --git a/src/usr/devicefw/associator.C b/src/usr/devicefw/associator.C
index d076c311e..e09852bf9 100644
--- a/src/usr/devicefw/associator.C
+++ b/src/usr/devicefw/associator.C
@@ -13,17 +13,16 @@ namespace DeviceFW
trace_desc_t* g_traceBuffer = NULL;
TRAC_INIT(&g_traceBuffer, "DevFW", 4096);
- Associator::Associator() : iv_mutex(mutex_create())
+ Associator::Associator() : iv_mutex()
{
TRACFCOMP(g_traceBuffer, ENTER_MRK "Associator::Associator");
-
+ mutex_init(&iv_mutex);
// Allocate first level of map (access types).
iv_routeMap = iv_associations.allocate(LAST_DRIVER_ACCESS_TYPE);
}
Associator::~Associator()
{
- mutex_destroy(iv_mutex);
TRACFCOMP(g_traceBuffer, EXIT_MRK "Associator::~Associator");
}
@@ -40,7 +39,7 @@ namespace DeviceFW
// compiler due to the template specializations in driverif.H.
// No assert-checks will be done here.
- mutex_lock(iv_mutex);
+ mutex_lock(&iv_mutex);
size_t ops = 0;
AssociationData targets = AssociationData();
@@ -118,14 +117,13 @@ namespace DeviceFW
// Set function offset into map. True flag indicates valid.
(*iv_associations[targets.offset]) = AssociationData(true, opLoc);
- mutex_unlock(iv_mutex);
+ mutex_unlock(&iv_mutex);
}
errlHndl_t Associator::performOp(OperationType i_opType,
TargetHandle_t i_target,
void* io_buffer, size_t& io_buflen,
int64_t i_accessType, va_list i_addr)
- const
{
TRACDCOMP(g_traceBuffer, "Device op requested for (%d, %d, %d)",
i_opType, i_accessType, /*TODO: i_target->type*/PROCESSOR);
@@ -136,7 +134,7 @@ namespace DeviceFW
errlHndl_t l_errl = NULL;
- mutex_lock(iv_mutex);
+ mutex_lock(&iv_mutex);
// Function pointer found for this route request.
deviceOp_t l_devRoute = NULL;
@@ -203,7 +201,7 @@ namespace DeviceFW
}
} while(0);
- mutex_unlock(iv_mutex);
+ mutex_unlock(&iv_mutex);
// Call function if one was found, create error otherwise.
if (NULL == l_devRoute)
diff --git a/src/usr/devicefw/associator.H b/src/usr/devicefw/associator.H
index 2052781b7..aba457338 100644
--- a/src/usr/devicefw/associator.H
+++ b/src/usr/devicefw/associator.H
@@ -5,7 +5,7 @@
#define __DEVICEFW_ASSOCIATOR_H
#include <devicefw/driverif.H>
-#include <sys/mutex.h>
+#include <sys/sync.h>
#include <vector>
#include "assoccontain.H"
@@ -53,7 +53,7 @@ namespace DeviceFW
errlHndl_t performOp(OperationType i_opType,
TargetHandle_t i_target,
void* io_buffer, size_t& io_buflen,
- int64_t i_accessType, va_list i_addr) const;
+ int64_t i_accessType, va_list i_addr);
private:
typedef std::vector<deviceOp_t> opVector_t;
OpenPOWER on IntegriCloud