From d406ad362d7f95cef1425216996f08fb5a1c7dca Mon Sep 17 00:00:00 2001 From: Jaymes Wilks Date: Thu, 21 Jun 2018 11:50:46 -0500 Subject: SP ATTN area relative addressing cleanup This change attemps to remove some technical debt incurred by the "HRMOR relative addressing for PHyp SP ATTN area dump" commit. Change-Id: I773c25e6f704fba561aa78106120325562698e4e RTC:186439 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61099 Tested-by: Jenkins Server Reviewed-by: Nicholas E. Bofferding Reviewed-by: Michael Baiocchi Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: ILYA SMIRNOV Reviewed-by: William G. Hoffa --- src/include/usr/runtime/runtime.H | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/include/usr/runtime') diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H index 3ac97e81a..b5e717e2b 100644 --- a/src/include/usr/runtime/runtime.H +++ b/src/include/usr/runtime/runtime.H @@ -32,6 +32,9 @@ #include #include "../../../src/usr/runtime/hdatstructs.H" #include +#include +#include + namespace RUNTIME { @@ -371,6 +374,22 @@ void findHdatLocation(uint64_t payloadBase_va, */ errlHndl_t getRsvdMemTraceBuf(uint64_t& o_RsvdMemAddress, uint64_t& o_size); + +/* + * @brief Calculates the node's proposed start address for the system's + * SP ATTN areas, which becomes the effective configuration if it's + * elected as the master. + * + * @return uint64_t Absolute start address for the intended SP ATTN areas + */ +inline uint64_t calcSpAttnAreaStart() +{ + auto hrmorVal = cpu_spr_value(CPU_SPR_HRMOR); + return (hrmorVal - VMM_HRMOR_OFFSET + PHYP_ATTN_AREA_OFFSET) + | VmmManager::FORCE_PHYS_ADDR; +} + + } #endif -- cgit v1.2.3