pdbg util to get FSI target
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I9cd110fe43b1274c0e738c8b3e127c6c95760869
diff --git a/util/pdbg.cpp b/util/pdbg.cpp
index 0ca6574..e33098f 100644
--- a/util/pdbg.cpp
+++ b/util/pdbg.cpp
@@ -76,6 +76,24 @@
//------------------------------------------------------------------------------
+pdbg_target* getFsiTrgt(pdbg_target* i_procTrgt)
+{
+ // The input target must be a processor.
+ assert(0x05 == getTrgtType(i_procTrgt));
+
+ // Get the fsi path.
+ char path[16];
+ sprintf(path, "/proc%d/fsi", pdbg_target_index(i_procTrgt));
+
+ // Return the fsi target.
+ pdbg_target* fsiTrgt = pdbg_target_from_path(nullptr, path);
+ assert(nullptr != fsiTrgt);
+
+ return fsiTrgt;
+}
+
+//------------------------------------------------------------------------------
+
uint32_t __getChipId(pdbg_target* i_trgt)
{
uint32_t attr = 0;