summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/runtime/interface.h24
-rw-r--r--src/makefile2
-rw-r--r--src/usr/diag/attn/runtime/attn_rt.C66
-rw-r--r--src/usr/diag/attn/runtime/attn_rt.mk1
-rw-r--r--src/usr/diag/attn/runtime/makefile1
-rw-r--r--src/usr/diag/attn/runtime/test/attntest_rt.H37
-rw-r--r--src/usr/diag/attn/runtime/test/makefile1
7 files changed, 126 insertions, 6 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index dcc7523b3..69696cfc0 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -210,6 +210,30 @@ typedef struct runtimeInterfaces
*/
void (*occ_error) (uint64_t i_chipId);
+ /** Enable chip attentions
+ *
+ * @return 0 on success else return code
+ */
+ int (*enable_attns)(void);
+
+ /** Disable chip attentions
+ *
+ * @return 0 on success else return code
+ */
+ int (*disable_attns)(void);
+
+ /** brief handle chip attentions
+ *
+ * @param[in] i_proc - processor chip id at attention
+ * XSCOM chip id based on devtree defn
+ * @param[in] i_ipollStatus - processor chip Ipoll status
+ * @param[in] i_ipollMask - processor chip Ipoll mask
+ * @return 0 on success else return code
+ */
+ int (*handle_attns)(uint64_t i_proc,
+ uint64_t i_ipollStatus,
+ uint64_t i_ipollMask);
+
// Reserve some space for future growth.
void (*reserved[32])(void);
diff --git a/src/makefile b/src/makefile
index 8c74f48b7..46b0b3d65 100644
--- a/src/makefile
+++ b/src/makefile
@@ -233,6 +233,7 @@ RUNTIME_MODULES += occ_rt
RUNTIME_MODULES += $(if $(CONFIG_HTMGT),htmgt_rt)
RUNTIME_MODULES += $(if $(CONFIG_HBRT_PRD),prdf_rt)
RUNTIME_MODULES += $(if $(CONFIG_HBRT_PRD),bus_training_rt)
+RUNTIME_MODULES += $(if $(CONFIG_HBRT_PRD),attn_rt)
RUNTIME_DATA_MODULES +=
RUNTIME_TESTCASE_MODULES += cxxtest_rt
@@ -246,6 +247,7 @@ RUNTIME_TESTCASE_MODULES += testutil_rt
RUNTIME_TESTCASE_MODULES += testvpd_rt
RUNTIME_TESTCASE_MODULES += testhwpf_rt
RUNTIME_TESTCASE_MODULES += $(if $(CONFIG_HBRT_PRD),testprdf_rt)
+RUNTIME_TESTCASE_MODULES += $(if $(CONFIG_HBRT_PRD),testattn_rt)
RELOCATABLE_IMAGE_LDFLAGS = -pie --export-dynamic
diff --git a/src/usr/diag/attn/runtime/attn_rt.C b/src/usr/diag/attn/runtime/attn_rt.C
index 0fcddc386..b8a8506d2 100644
--- a/src/usr/diag/attn/runtime/attn_rt.C
+++ b/src/usr/diag/attn/runtime/attn_rt.C
@@ -39,15 +39,73 @@ using namespace ATTN;
namespace ATTN_RT
{
- // enableAttns() and handleAttns()
- // will be added later on.
+ /** Enable chip attentions
+ *
+ * @return 0 on success else return code
+ */
+ int enableAttns(void)
+ {
+ #define ATTN_FUNC "ATTN_RT::enableAttns() "
+ int rc = 0;
+
+ ATTN_ERR(ATTN_FUNC"not implemented yet!");
+
+ return rc;
+
+ #undef ATTN_FUNC
+ }
+
+ /** Disable chip attentions
+ *
+ * @return 0 on success else return code
+ */
+ int disableAttns(void)
+ {
+ #define ATTN_FUNC "ATTN_RT::disableAttns() "
+ int rc = 0;
+
+ ATTN_ERR(ATTN_FUNC"not implemented yet!");
+
+ return rc;
+
+ #undef ATTN_FUNC
+ }
+
+ /** brief handle chip attentions
+ *
+ * @param[in] i_proc - processor chip id at attention
+ * XSCOM chip id based on devtree defn
+ * @param[in] i_ipollStatus - processor chip Ipoll status
+ * @param[in] i_ipollMask - processor chip Ipoll mask
+ * @return 0 on success else return code
+ */
+ int handleAttns(uint64_t i_proc,
+ uint64_t i_ipollStatus,
+ uint64_t i_ipollMask)
+ {
+ #define ATTN_FUNC "ATTN_RT::handleAttns() "
+ int rc = 0;
+
+ ATTN_ERR(ATTN_FUNC"not implemented yet!");
+
+ return rc;
+
+ #undef ATTN_FUNC
+ }
- // will be used to register runtimeInterfaces
+ // register runtime interfaces
struct registerAttn
{
registerAttn()
{
- ATTN_FAST("registerAttn");
+ runtimeInterfaces_t * rt_intf = getRuntimeInterfaces();
+ if (NULL == rt_intf)
+ {
+ return;
+ }
+ rt_intf->enable_attns = &enableAttns;
+ rt_intf->disable_attns = &disableAttns;
+ rt_intf->handle_attns = &handleAttns;
}
};
diff --git a/src/usr/diag/attn/runtime/attn_rt.mk b/src/usr/diag/attn/runtime/attn_rt.mk
index c571865b7..8abe2bbec 100644
--- a/src/usr/diag/attn/runtime/attn_rt.mk
+++ b/src/usr/diag/attn/runtime/attn_rt.mk
@@ -24,3 +24,4 @@
# IBM_PROLOG_END_TAG
ATTN_RT_OBJS += attn_rt.o
+ATTN_RT_OBJS += attntrace.o
diff --git a/src/usr/diag/attn/runtime/makefile b/src/usr/diag/attn/runtime/makefile
index 352a39b4b..4a5217433 100644
--- a/src/usr/diag/attn/runtime/makefile
+++ b/src/usr/diag/attn/runtime/makefile
@@ -24,6 +24,7 @@
# IBM_PROLOG_END_TAG
HOSTBOOT_RUNTIME = 1
+
ROOTPATH = ../../../../..
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/diag
diff --git a/src/usr/diag/attn/runtime/test/attntest_rt.H b/src/usr/diag/attn/runtime/test/attntest_rt.H
index 841f66bd5..84731ec22 100644
--- a/src/usr/diag/attn/runtime/test/attntest_rt.H
+++ b/src/usr/diag/attn/runtime/test/attntest_rt.H
@@ -34,9 +34,9 @@ class AttnTestRT: public CxxTest::TestSuite
{
public:
- void testAttnIntf()
+ void testAttnRtIntf()
{
- ATTN_SLOW("runtime testAttnIntf");
+ ATTN_SLOW(ENTER_MRK"AttnTestRT::testAttnRtIntf");
runtimeInterfaces_t* rt_intf = getRuntimeInterfaces();
if (NULL == rt_intf)
@@ -44,6 +44,39 @@ class AttnTestRT: public CxxTest::TestSuite
TS_FAIL("AttnTestRT: runtimeIntfaces not set");
return;
}
+
+ if (NULL == rt_intf->enable_attns)
+ {
+ TS_FAIL("AttnTestRT: enable_attns not set");
+ }
+ else
+ {
+ int rc = rt_intf->enable_attns();
+ ATTN_SLOW("enable_attns returned rc: %d", rc);
+ }
+
+ if (NULL == rt_intf->disable_attns)
+ {
+ TS_FAIL("AttnTestRT: disable_attns not set");
+ }
+ else
+ {
+ int rc = rt_intf->disable_attns();
+ ATTN_SLOW("disable_attns returned rc: %d", rc);
+ }
+
+ if (NULL == rt_intf->handle_attns)
+ {
+ TS_FAIL("AttnTestRT: handle_attns not set");
+ }
+ else
+ {
+ // just pass in some params for now
+ int rc = rt_intf->handle_attns(NULL, 0, 0);
+ ATTN_SLOW("handle_attns returned rc: %d", rc);
+ }
+
+ ATTN_SLOW(EXIT_MRK"AttnTestRT::testAttnRtIntf");
}
private:
diff --git a/src/usr/diag/attn/runtime/test/makefile b/src/usr/diag/attn/runtime/test/makefile
index 208bf830e..4636bfb05 100644
--- a/src/usr/diag/attn/runtime/test/makefile
+++ b/src/usr/diag/attn/runtime/test/makefile
@@ -24,6 +24,7 @@
# IBM_PROLOG_END_TAG
HOSTBOOT_RUNTIME = 1
+
ROOTPATH = ../../../../../..
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/diag
OpenPOWER on IntegriCloud