diff options
author | Brad Bishop <bradleyb@us.ibm.com> | 2012-03-13 13:53:53 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-03-19 10:57:31 -0500 |
commit | 4bd432b988c1fe06c835bc6a4e4f901e136c30e7 (patch) | |
tree | 7ce43242b1691151c334891358da7f0a6fb835ba /src/usr/diag/mdia/mdiaworkitem.C | |
parent | f1760e04ceab564f8cef0c8d267bece75cce116c (diff) | |
download | talos-hostboot-4bd432b988c1fe06c835bc6a4e4f901e136c30e7.tar.gz talos-hostboot-4bd432b988c1fe06c835bc6a4e4f901e136c30e7.zip |
initial mdia commit. directories, makefiles, workitem
Change-Id: Ic48a13935bfea72def5cdc63db3a93bb659ded30
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/751
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag/mdia/mdiaworkitem.C')
-rw-r--r-- | src/usr/diag/mdia/mdiaworkitem.C | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/usr/diag/mdia/mdiaworkitem.C b/src/usr/diag/mdia/mdiaworkitem.C new file mode 100644 index 000000000..d2b59e641 --- /dev/null +++ b/src/usr/diag/mdia/mdiaworkitem.C @@ -0,0 +1,77 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/diag/mdia/mdiaworkitem.C $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 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 other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +/** + * @file mdiaworkitem.C + * @brief threadpool workitem implementation + */ + +#include "mdiaworkitem.H" +#include "mdiasm.H" +#include "mdiatrace.H" + +using namespace TARGETING; + +namespace MDIA +{ + +void WorkItem::operator()() +{ + MDIA_FAST("executing workitem: %d", iv_workFlowPhase); + + iv_sm.executeWorkItem(iv_target, iv_workFlowPhase); +} + +int32_t WorkItem::compare(const WorkItem & i_r) const +{ + // schedule based on state machine computed priority + + if(i_r.iv_priority < iv_priority) + { + return -1; + } + + if(iv_priority < i_r.iv_priority) + { + return 1; + } + + // if the state machine computed priority is the same, + // give higher priority to mbas on different dmi busses + + // TODO + + return 0; +} + +WorkItem::WorkItem(StateMachine & i_sm, + WorkFlowPhase i_workFlowPhase, + TargetHandle_t i_target, + uint32_t i_priority) : + iv_sm(i_sm), + iv_workFlowPhase(i_workFlowPhase), + iv_target(i_target), + iv_priority(i_priority) +{ + +} +} |