summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt/htmgt_utility.H
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2014-09-03 15:50:37 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-11-12 13:30:08 -0600
commit2b5b8c76b99f51ae483f2c70363d5af9d263cfe5 (patch)
tree0437e5658535a4e82f59fb2408eb0336ea6befda /src/usr/htmgt/htmgt_utility.H
parent0f8700c742b7b176dc5333fa20b630e312e92ef8 (diff)
downloadtalos-hostboot-2b5b8c76b99f51ae483f2c70363d5af9d263cfe5.tar.gz
talos-hostboot-2b5b8c76b99f51ae483f2c70363d5af9d263cfe5.zip
HTMGT add required HW procedures and setup HTMGT component
Change-Id: Ie61cf3d076dec6de23028d7a816c8719f66fb4ab RTC:115384 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13477 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Christopher Cain <cjcain@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt/htmgt_utility.H')
-rw-r--r--src/usr/htmgt/htmgt_utility.H94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/usr/htmgt/htmgt_utility.H b/src/usr/htmgt/htmgt_utility.H
new file mode 100644
index 000000000..5ff06d0b0
--- /dev/null
+++ b/src/usr/htmgt/htmgt_utility.H
@@ -0,0 +1,94 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/htmgt/tmgtutility.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2014 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef HTMGT_UTILITY_H
+#define HTMGT_UTILITY_H
+
+#include <stdint.h>
+#include <trace/interface.H>
+#include <errl/errlmanager.H>
+
+
+#define TMGT_DBG( _fmt_, _args_...) \
+ TRACDCOMP( g_trac_htmgt, "D>" _fmt_, ##_args_ )
+
+#define TMGT_INF( _fmt_, _args_...) \
+ TRACFCOMP( g_trac_htmgt, _fmt_, ##_args_ )
+
+#define TMGT_WRN( _fmt_, _args_...) \
+ TRACFCOMP( g_trac_htmgt, "W>" _fmt_, ##_args_ )
+
+#define TMGT_ERR( _fmt_, _args_...) \
+ TRACFCOMP( g_trac_htmgt, "E>" _fmt_, ##_args_ )
+
+#define TMGT_DBG_BIN( _fmt_, _args_...) \
+ TRACDBIN( g_trac_htmgt, "D>" _fmt_, ##_args_ )
+
+#define TMGT_BIN( _fmt_, _args_...) \
+ TRACFBIN( g_trac_htmgt, _fmt_, ##_args_ )
+
+inline uint16_t UINT16_GET(const uint8_t * i_ptr)
+{
+ return (*i_ptr) << 8 | *(i_ptr+1);
+}
+
+inline uint32_t UINT32_GET(const uint8_t * i_ptr)
+{
+ return (UINT16_GET(i_ptr) << 16) | UINT16_GET(i_ptr + 2);
+}
+
+inline void UINT16_PUT(uint8_t * i_ptr, uint16_t i_value)
+{
+ *i_ptr = (uint8_t) (i_value >> 8);
+ *(i_ptr + 1) = (uint8_t) (i_value);
+}
+
+inline void UINT32_PUT(uint8_t * i_ptr, uint32_t i_value)
+{
+ *i_ptr = (uint8_t)(i_value >> 24);
+ *(i_ptr + 1) = (uint8_t)(i_value >> 16);
+ *(i_ptr + 2) = (uint8_t)(i_value >> 8);
+ *(i_ptr + 3) = (uint8_t)(i_value);
+}
+
+
+namespace HTMGT
+{
+ // Trace definition
+ extern trace_desc_t* g_trac_htmgt;
+
+ // Create/Build an Error log and add HTMGT component trace
+ void bldErrLog(errlHndl_t & io_err,
+ const uint8_t i_modid,
+ const uint16_t i_rc,
+ const uint32_t i_data1 = 0,
+ const uint32_t i_data2 = 0,
+ const uint32_t i_data3 = 0,
+ const uint32_t i_data4 = 0,
+ const ERRORLOG::errlSeverity_t i_sev = ERRORLOG::ERRL_SEV_INFORMATIONAL);
+
+
+
+} // end namespace
+#endif
OpenPOWER on IntegriCloud