summaryrefslogtreecommitdiffstats
path: root/src/usr/devicefw
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-06-20 12:21:57 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-06-21 17:59:56 -0500
commit5611dd07de1fa342f487d49f57259639c2b0529a (patch)
tree163d0c0f88ce2238ebe9af5c34940b2e5bcef9da /src/usr/devicefw
parent91c0fe55a63a9d420e851534354f1058a9189743 (diff)
downloadtalos-hostboot-5611dd07de1fa342f487d49f57259639c2b0529a.tar.gz
talos-hostboot-5611dd07de1fa342f487d49f57259639c2b0529a.zip
Migrate device framework to use targeting.
Change-Id: I1ae855406e3061f10505eeccbcb2766a15581189 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/153 Tested-by: Jenkins Server Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Diffstat (limited to 'src/usr/devicefw')
-rw-r--r--src/usr/devicefw/associator.C22
-rw-r--r--src/usr/devicefw/associator.H2
-rw-r--r--src/usr/devicefw/driverif.C14
-rw-r--r--src/usr/devicefw/test/associatortest.H19
-rw-r--r--src/usr/devicefw/userif.C4
5 files changed, 35 insertions, 26 deletions
diff --git a/src/usr/devicefw/associator.C b/src/usr/devicefw/associator.C
index e09852bf9..80ca6d9b6 100644
--- a/src/usr/devicefw/associator.C
+++ b/src/usr/devicefw/associator.C
@@ -7,6 +7,7 @@
#include "associator.H"
using namespace ERRORLOG;
+using namespace TARGETING;
namespace DeviceFW
{
@@ -66,7 +67,7 @@ namespace DeviceFW
else
{
// Allocate full number of spaces.
- targets.offset = iv_associations.allocate(LAST_TARGET_TYPE);
+ targets.offset = iv_associations.allocate(TYPE_LAST_IN_RANGE+1);
}
iv_associations[ops][i_opType] = targets;
}
@@ -121,12 +122,16 @@ namespace DeviceFW
}
errlHndl_t Associator::performOp(OperationType i_opType,
- TargetHandle_t i_target,
+ Target* i_target,
void* io_buffer, size_t& io_buflen,
int64_t i_accessType, va_list i_addr)
{
+ TARGETING::TYPE l_devType =
+ (i_target == MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) ?
+ TYPE_PROC : i_target->getAttr<ATTR_TYPE>();
+
TRACDCOMP(g_traceBuffer, "Device op requested for (%d, %d, %d)",
- i_opType, i_accessType, /*TODO: i_target->type*/PROCESSOR);
+ i_opType, i_accessType, l_devType);
// The ranges of the parameters should all be verified by the
// compiler due to the template specializations in driverif.H.
@@ -167,11 +172,11 @@ namespace DeviceFW
// Check access type = i_target->type registrations.
const AssociationData* targets =
iv_associations[ops[WILDCARD].offset];
- if (targets[/*TODO: i_target->type*/PROCESSOR].flag)
+ if (targets[l_devType].flag)
{
l_devRoute =
iv_operations[
- targets[/*TODO: i_target->type*/PROCESSOR].offset];
+ targets[l_devType].offset];
break;
}
}
@@ -191,11 +196,11 @@ namespace DeviceFW
// Check access type = i_target->type registrations.
const AssociationData* targets =
iv_associations[ops[i_opType].offset];
- if (targets[/*TODO: i_target->type*/PROCESSOR].flag)
+ if (targets[l_devType].flag)
{
l_devRoute =
iv_operations[
- targets[/*TODO: i_target->type*/PROCESSOR].offset];
+ targets[l_devType].offset];
break;
}
}
@@ -220,8 +225,7 @@ namespace DeviceFW
DEVFW_MOD_ASSOCIATOR,
DEVFW_RC_NO_ROUTE_FOUND,
TWO_UINT32_TO_UINT64(i_opType, i_accessType),
- /*TODO: i_target->type*/
- TO_UINT64(PROCESSOR)
+ TO_UINT64(l_devType)
);
}
else
diff --git a/src/usr/devicefw/associator.H b/src/usr/devicefw/associator.H
index aba457338..fe8fda6b9 100644
--- a/src/usr/devicefw/associator.H
+++ b/src/usr/devicefw/associator.H
@@ -51,7 +51,7 @@ namespace DeviceFW
/** Perform routing. See deviceOp. */
errlHndl_t performOp(OperationType i_opType,
- TargetHandle_t i_target,
+ TARGETING::Target* i_target,
void* io_buffer, size_t& io_buflen,
int64_t i_accessType, va_list i_addr);
private:
diff --git a/src/usr/devicefw/driverif.C b/src/usr/devicefw/driverif.C
index 3e7a50113..8977ea0f8 100644
--- a/src/usr/devicefw/driverif.C
+++ b/src/usr/devicefw/driverif.C
@@ -34,14 +34,14 @@ namespace DeviceFW
template <>
void deviceRegisterRoute<>(OperationType i_opType,
AccessType i_accessType,
- TargetType_t i_targetType,
+ TARGETING::TYPE i_targetType,
deviceOp_t i_regRoute)
__attribute__((alias("DeviceFW_deviceRegisterRoute")));
template <>
void deviceRegisterRoute<>(OperationType i_opType,
AccessType_DriverOnly i_accessType,
- TargetType_t i_targetType,
+ TARGETING::TYPE i_targetType,
deviceOp_t i_regRoute)
__attribute__((alias("DeviceFW_deviceRegisterRoute")));
@@ -62,14 +62,14 @@ namespace DeviceFW
template <>
void deviceRegisterRoute<>(DriverSpecial i_opType,
AccessType i_accessType,
- TargetType_t i_targetType,
+ TARGETING::TYPE i_targetType,
deviceOp_t i_regRoute)
__attribute__((alias("DeviceFW_deviceRegisterRoute")));
template <>
void deviceRegisterRoute<>(DriverSpecial i_opType,
AccessType_DriverOnly i_accessType,
- TargetType_t i_targetType,
+ TARGETING::TYPE i_targetType,
deviceOp_t i_regRoute)
__attribute__((alias("DeviceFW_deviceRegisterRoute")));
@@ -95,7 +95,7 @@ namespace DeviceFW
*/
extern "C"
errlHndl_t DeviceFW_deviceOp(OperationType i_opType,
- TargetHandle_t i_target,
+ TARGETING::Target* i_target,
void* io_buffer, size_t& io_buflen,
int64_t i_accessType, ...)
{
@@ -119,14 +119,14 @@ namespace DeviceFW
// AccType - AccessType, AccessType_DriverOnly (no WILDCARD).
template <>
errlHndl_t deviceOp<>(OperationType i_opType,
- TargetHandle_t i_target,
+ TARGETING::Target* i_target,
void* io_buffer, size_t& io_buflen,
AccessType i_accessType, ...)
__attribute__((alias("DeviceFW_deviceOp")));
template <>
errlHndl_t deviceOp<>(OperationType i_opType,
- TargetHandle_t i_target,
+ TARGETING::Target* i_target,
void* io_buffer, size_t& io_buflen,
AccessType_DriverOnly i_accessType, ...)
__attribute__((alias("DeviceFW_deviceOp")));
diff --git a/src/usr/devicefw/test/associatortest.H b/src/usr/devicefw/test/associatortest.H
index 3d7aa6a32..74f30fa3e 100644
--- a/src/usr/devicefw/test/associatortest.H
+++ b/src/usr/devicefw/test/associatortest.H
@@ -7,6 +7,7 @@
#include "../associator.H"
using namespace DeviceFW;
+using namespace TARGETING;
class AssociatorTest;
typedef void (AssociatorTest::*test_fn)();
@@ -36,7 +37,7 @@ public:
// Used for registration testing.
static
errlHndl_t performOperation(OperationType i_opType,
- TargetHandle_t i_target,
+ Target* i_target,
void* io_buffer, size_t& io_buflen,
int64_t i_accessType, va_list i_addr)
{
@@ -60,10 +61,11 @@ public:
Associator as;
as.registerRoute(READ,
SCOM,
- PROCESSOR,
+ TYPE_PROC,
&performOperation);
- errlHndl_t l_errl = as.performOp(READ, TargetHandle_t(),
+ errlHndl_t l_errl = as.performOp(READ,
+ MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
SCOM, va_list());
@@ -101,10 +103,11 @@ public:
Associator as;
as.registerRoute(WILDCARD,
SCOM,
- PROCESSOR,
+ TYPE_PROC,
&performOperation);
- errlHndl_t l_errl = as.performOp(WRITE, TargetHandle_t(),
+ errlHndl_t l_errl = as.performOp(WRITE,
+ MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
SCOM, va_list());
@@ -145,7 +148,8 @@ public:
WILDCARD,
&performOperation);
- errlHndl_t l_errl = as.performOp(READ, TargetHandle_t(),
+ errlHndl_t l_errl = as.performOp(READ,
+ MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
SCOM, va_list());
@@ -187,7 +191,8 @@ public:
WILDCARD,
&performOperation);
- errlHndl_t l_errl = as.performOp(READ, TargetHandle_t(),
+ errlHndl_t l_errl = as.performOp(READ,
+ MASTER_PROCESSOR_CHIP_TARGET_SENTINEL,
buf, bufsize,
MAILBOX, va_list());
diff --git a/src/usr/devicefw/userif.C b/src/usr/devicefw/userif.C
index 248077358..e6b1d0cb9 100644
--- a/src/usr/devicefw/userif.C
+++ b/src/usr/devicefw/userif.C
@@ -9,7 +9,7 @@
namespace DeviceFW
{
- errlHndl_t deviceRead(TargetHandle_t i_target,
+ errlHndl_t deviceRead(TARGETING::Target* i_target,
void* o_buffer, size_t& io_buflen,
AccessType i_accessType, ...)
{
@@ -26,7 +26,7 @@ namespace DeviceFW
return errl;
}
- errlHndl_t deviceWrite(TargetHandle_t i_target,
+ errlHndl_t deviceWrite(TARGETING::Target* i_target,
void* i_buffer, size_t& io_buflen,
AccessType i_accessType, ...)
{
OpenPOWER on IntegriCloud