summaryrefslogtreecommitdiffstats
path: root/src/include/usr/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/runtime')
-rw-r--r--src/include/usr/runtime/populate_hbruntime.H41
-rw-r--r--src/include/usr/runtime/runtime_reasoncodes.H2
2 files changed, 33 insertions, 10 deletions
diff --git a/src/include/usr/runtime/populate_hbruntime.H b/src/include/usr/runtime/populate_hbruntime.H
index c2c0c224e..5a8f17279 100644
--- a/src/include/usr/runtime/populate_hbruntime.H
+++ b/src/include/usr/runtime/populate_hbruntime.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -22,6 +22,8 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+#ifndef POPULATE_HBRUNTIME_H
+#define POPULATE_HBRUNTIME_H
#include <hdat/hdat.H>
#include <vector>
#include <utility>
@@ -29,6 +31,9 @@
namespace RUNTIME
{
+extern const uint64_t HB_RES_MEM_UPPER_LIMIT;
+extern const uint64_t HB_RES_MEM_LOWER_LIMIT;
+
/**
* @brief Get the next Reserved HB memory range and set all member variables
* of struct. Additionally trace out relevant parts of the struct
@@ -38,16 +43,19 @@ namespace RUNTIME
* @param[in] i_size, Size of address space to reserve
* @param[in] i_label, Label String Ptr
* @param[in] i_permission, HDAT permission type [default read/write]
+ * @param[in] i_checkMemoryLimit, check if we overflow the limit for hb reserved
+ * memory. False for PHYP component
*
* @return errlHndl_t, nullptr on success; otherwise errlog
*/
-errlHndl_t setNextHbRsvMemEntry(const HDAT::hdatMsVpdRhbAddrRangeType i_type,
- const uint16_t i_rangeId,
- const uint64_t i_startAddr,
- const uint64_t i_size,
+errlHndl_t setNextHbRsvMemEntry(HDAT::hdatMsVpdRhbAddrRangeType i_type,
+ uint16_t i_rangeId,
+ uint64_t i_startAddr,
+ uint64_t i_size,
const char* i_label,
- const HDAT::hdatRhbPermType i_permission =
- HDAT::RHB_READ_WRITE
+ HDAT::hdatRhbPermType i_permission =
+ HDAT::RHB_READ_WRITE,
+ bool i_checkMemoryLimit = true
);
/**
@@ -76,7 +84,20 @@ errlHndl_t unmapVirtAddr(uint64_t i_addr);
*
* @return Error handle if error
*/
-errlHndl_t hbResvLoadSecureSection (const PNOR::SectionId i_sec,
- const bool i_secHdrExpected);
+errlHndl_t hbResvLoadSecureSection (PNOR::SectionId i_sec,
+ bool i_secHdrExpected);
+
+/**
+ * @brief Check whether the given addr falls withing allowed hb reserved memory
+ * range.
+ * @param[in] i_addr - phys address to check
+ * @param[in] i_size - the size of the section starting with i_addr (needed to
+ * verify the end limit of the section)
+ * @return Error handle if error
+ */
+errlHndl_t checkHbResMemLimit(uint64_t i_addr,
+ uint64_t i_size);
+
+} // End of Namespace
+#endif
-} // End of Namespace \ No newline at end of file
diff --git a/src/include/usr/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H
index 19799c51a..3937e553f 100644
--- a/src/include/usr/runtime/runtime_reasoncodes.H
+++ b/src/include/usr/runtime/runtime_reasoncodes.H
@@ -62,6 +62,7 @@ namespace RUNTIME
MOD_RT_FIRMWARE_NOTIFY = 0x23, /**< rt_fwnotify.C */
MOD_RT_FIRMWARE_REQUEST = 0x24, /**< rt_fwreq_helper.C */
MOD_RT_ATTR_SYNC_REQUEST = 0x25, /**< rt_fwnotify.C */
+ MOD_CHECK_HB_RES_MEM_LIMIT = 0x26, /**<populate_hbruntime.C */
};
enum RuntimeReasonCode
@@ -127,6 +128,7 @@ namespace RUNTIME
RC_TPM_HDAT_VIRT_TO_PHYS_ERR = RUNTIME_COMP_ID | 0x3A,
RC_TPM_HDAT_MAP_BLOCK_ERR = RUNTIME_COMP_ID | 0x3B,
RC_ATTR_UPDATE_FAILED = RUNTIME_COMP_ID | 0x3C,
+ RC_HB_RES_MEM_EXCEEDED = RUNTIME_COMP_ID | 0x3D,
};
enum UserDetailsTypes
OpenPOWER on IntegriCloud