summaryrefslogtreecommitdiffstats
path: root/src/usr/util/runtime/rt_cmds.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/util/runtime/rt_cmds.C')
-rw-r--r--src/usr/util/runtime/rt_cmds.C38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/usr/util/runtime/rt_cmds.C b/src/usr/util/runtime/rt_cmds.C
index 8ccb60852..b9c0e4324 100644
--- a/src/usr/util/runtime/rt_cmds.C
+++ b/src/usr/util/runtime/rt_cmds.C
@@ -44,6 +44,8 @@
#include <p9_hcd_memmap_base.H> // for reload_pm_complex
#include <p9_stop_data_struct.H> // for reload_pm_complex
+extern char hbi_ImageId;
+
// need this here so compile works, linker will later find this
namespace RTPM
{
@@ -931,6 +933,26 @@ int cmd_reload_pm_complex( char*& o_output, uint64_t stopAt )
return rc;
}
+
+/**
+ * @brief Read version of HBRT
+ * @param[out] o_output Output display buffer, memory allocated here
+ */
+void cmd_readHBRTversion( char*& o_output )
+{
+ UTIL_FT( "cmd_readHBRTversion");
+
+ const char * const l_title = "Hostboot Build ID: ";
+ o_output = new char[strlen(l_title) + strlen(&hbi_ImageId) + 1];
+ // Set beginning of output string
+ strcpy(o_output, l_title);
+ // Concatenate the Hostboot Image ID
+ strcat(o_output, &hbi_ImageId);
+
+ UTIL_FT( "%s", o_output);
+}
+
+
/**
* @brief Execute an arbitrary command inside Hostboot Runtime
* @param[in] Number of arguments (standard C args)
@@ -1149,6 +1171,20 @@ int hbrtCommand( int argc,
}
rc = cmd_reload_pm_complex(*l_output, breakPoint);
}
+ else if( !strcmp( argv[0], "readHBRTversion" ) )
+ {
+ // readHBRTversion
+ if( argc == 1 )
+ {
+ cmd_readHBRTversion( *l_output );
+ }
+ else
+ {
+ *l_output = new char[100];
+ sprintf( *l_output,
+ "ERROR: readHBRTversion\n" );
+ }
+ }
else
{
*l_output = new char[50+100*10];
@@ -1174,6 +1210,8 @@ int hbrtCommand( int argc,
strcat( *l_output, l_tmpstr );
sprintf( l_tmpstr, "reload_pm_complex [<breakPoint>]\n");
strcat( *l_output, l_tmpstr );
+ sprintf( l_tmpstr, "readHBRTversion\n");
+ strcat( *l_output, l_tmpstr );
}
if( l_traceOut && (*l_output != NULL) )
OpenPOWER on IntegriCloud