diff options
author | Chris Phan <cphan@us.ibm.com> | 2014-09-23 12:46:05 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-12-03 11:12:47 -0600 |
commit | fbb82d303f1deefd65e87d850dc77a74a6102bf5 (patch) | |
tree | 5be62aa9fd86919e9fea95bd3e5c4bfb4797c574 /src | |
parent | 605137529b178862bf2c28ea3c3da4fb48394991 (diff) | |
download | blackbird-hostboot-fbb82d303f1deefd65e87d850dc77a74a6102bf5.tar.gz blackbird-hostboot-fbb82d303f1deefd65e87d850dc77a74a6102bf5.zip |
ATTN: add stub runtime interfaces
Change-Id: I758ffe46770297a28be1087bc9f9b8379e4c2fa9
RTC: 110949
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13546
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/runtime/interface.h | 24 | ||||
-rw-r--r-- | src/makefile | 2 | ||||
-rw-r--r-- | src/usr/diag/attn/runtime/attn_rt.C | 66 | ||||
-rw-r--r-- | src/usr/diag/attn/runtime/attn_rt.mk | 1 | ||||
-rw-r--r-- | src/usr/diag/attn/runtime/makefile | 1 | ||||
-rw-r--r-- | src/usr/diag/attn/runtime/test/attntest_rt.H | 37 | ||||
-rw-r--r-- | src/usr/diag/attn/runtime/test/makefile | 1 |
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 |