From c154ece8068c2f0fc366235ba952003e08df48a1 Mon Sep 17 00:00:00 2001 From: Missy Connell Date: Tue, 26 Mar 2013 09:23:58 -0500 Subject: TCE support RTC:36952 Change-Id: Icc1e88df4e8a8b50cae4fd9fe3789e98be61604e Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4297 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/include/usr/runtime/runtime_reasoncodes.H | 17 +++++- src/include/usr/runtime/tceif.H | 83 +++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/include/usr/runtime/tceif.H (limited to 'src/include/usr/runtime') diff --git a/src/include/usr/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H index 4a8f8c0ae..6d3df5bf2 100644 --- a/src/include/usr/runtime/runtime_reasoncodes.H +++ b/src/include/usr/runtime/runtime_reasoncodes.H @@ -38,6 +38,14 @@ namespace RUNTIME MOD_HDATSERVICE_GET_STANDALONE_SECTION = 0x06, /**< hdatservice.C */ MOD_HDATSERVICE_GET_HOST_DATA_SECTION = 0x07, /**< hdatservice.C */ MOD_HDATSERVICE_VERIFY_HDAT_ADDRESS = 0x08, /**< hdatservice.C */ + MOD_TCE_CREATE = 0x09, /**< tce.C */ + MOD_TCE_INIT_HDW = 0x0A, /**< tce.C */ + MOD_TCE_ALLOCATE = 0x0B, /**< tce.C */ + MOD_TCE_DEALLOCATE = 0x0C, /**< tce.C */ + MOD_TCE_INIT = 0x0D, /**< tce.C */ + MOD_TCE_MAP = 0x0E, /**< tce.C */ + + }; enum RuntimeReasonCode @@ -55,7 +63,14 @@ namespace RUNTIME RC_INVALID_ADDRESS = RUNTIME_COMP_ID | 0x0B, RC_INVALID_SECTION = RUNTIME_COMP_ID | 0x0C, RC_CANNOT_MAP_MEMORY3 = RUNTIME_COMP_ID | 0x0D, - + RC_TCE_INVALID_SIZE = RUNTIME_COMP_ID | 0x0E, + RC_TCE_ADDR_NOT_ALIGNED = RUNTIME_COMP_ID | 0x0F, + RC_TCE_INIT_NOT_RUN = RUNTIME_COMP_ID | 0x10, + RC_TCE_DEV_MAP_FAIL = RUNTIME_COMP_ID | 0x11, + RC_TCE_DEV_UNMAP_FAIL = RUNTIME_COMP_ID | 0x12, + RC_TCE_NO_ACTIVE_PSI = RUNTIME_COMP_ID | 0x13, + RC_TCE_NOT_ENOUGH_FREE_ENTRIES = RUNTIME_COMP_ID | 0x14, + RC_TCE_ENTRY_NOT_CONTIGUOUS = RUNTIME_COMP_ID | 0x15, }; }; diff --git a/src/include/usr/runtime/tceif.H b/src/include/usr/runtime/tceif.H new file mode 100644 index 000000000..9dcc7ca14 --- /dev/null +++ b/src/include/usr/runtime/tceif.H @@ -0,0 +1,83 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/runtime/tceif.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* 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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __TCEIF_H +#define __TCEIF_H + +#include +#include +#include +#include + + +namespace TCE +{ + /** + * @brief Responsible for initalizing the TCE entries + * + * @return errl - Return Error Handle if failed. + * + */ + errlHndl_t createTceTable(); + + /** + * @brief Responsible for setting up the Processors to point to the TCE + * table + * + * @return errl - Return Error Handle if failed. + * + */ + errlHndl_t initTceInHdw(); + + /** + * @brief Responsible for allocating TCE Entries + * + * @param[in] i_startingAddress - Starting address to TCE + * @param[in] i_size - Size of the address space + * @param[out] startingToken - Starting Entry into the table. + * (this is an offset into the array based on the + * TCE index * PAGESIZE. Each TCE entry maps to a + * pagesize of memory) + * + * Note: Must run createTceTable and InitTceInHdw or allocate will not work + * + * @return errl - Return Error Handle if failed. + * + */ + errlHndl_t allocateTces(uint64_t startingAddress, uint64_t size, uint64_t& + startingToken); + + /** + * @brief Responsible for deallocating TCE Entries + * + * @param[in] i_startingToken - Token indicating the starting entry to + * remove + * @param[in] i_size - Size of memory space to remove TCE entries + * associated + * + * @return errl - Return Error Handle if fatal failure occurred. + * + */ + errlHndl_t deallocateTces(uint64_t startingToken, uint64_t size); +}; + +#endif -- cgit v1.2.3