Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame] | 3 | #include <libpdbg.h> |
| 4 | |
Zane Shelley | 7ae9c8c | 2020-12-02 20:10:31 -0600 | [diff] [blame] | 5 | #include <vector> |
| 6 | |
| 7 | // Forward reference to avoid pulling the libhei library into everything that |
| 8 | // includes this header. |
| 9 | namespace libhei |
| 10 | { |
| 11 | class Chip; |
| 12 | } |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 13 | |
| 14 | namespace util |
| 15 | { |
| 16 | |
| 17 | namespace pdbg |
| 18 | { |
| 19 | |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame] | 20 | /** @return The target associated with the given chip. */ |
| 21 | pdbg_target* getTrgt(const libhei::Chip& i_chip); |
| 22 | |
| 23 | /** @return A string representing the given target's devtree path. */ |
| 24 | const char* getPath(pdbg_target* i_trgt); |
| 25 | |
| 26 | /** @return A string representing the given chip's devtree path. */ |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 27 | const char* getPath(const libhei::Chip& i_chip); |
| 28 | |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame] | 29 | /** @return The absolute position of the given target. */ |
| 30 | uint32_t getChipPos(pdbg_target* i_trgt); |
| 31 | |
| 32 | /** @return The absolute position of the given chip. */ |
| 33 | uint32_t getChipPos(const libhei::Chip& i_chip); |
| 34 | |
| 35 | /** @return The target type of the given target. */ |
| 36 | uint8_t getTrgtType(pdbg_target* i_trgt); |
| 37 | |
| 38 | /** @return The target type of the given chip. */ |
| 39 | uint8_t getTrgtType(const libhei::Chip& i_chip); |
| 40 | |
Zane Shelley | 171a2e0 | 2020-11-13 13:56:13 -0600 | [diff] [blame] | 41 | /** |
| 42 | * @return The pib target associated with the given proc target. |
| 43 | * @note Will assert the given target is a proc target. |
| 44 | * @note Will assert the returned pib target it not nullptr. |
| 45 | */ |
| 46 | pdbg_target* getPibTrgt(pdbg_target* i_procTrgt); |
| 47 | |
| 48 | /** |
Zane Shelley | ff76b6b | 2020-11-18 13:54:26 -0600 | [diff] [blame] | 49 | * @return The fsi target associated with the given proc target. |
| 50 | * @note Will assert the given target is a proc target. |
| 51 | * @note Will assert the returned fsi target it not nullptr. |
| 52 | */ |
| 53 | pdbg_target* getFsiTrgt(pdbg_target* i_procTrgt); |
| 54 | |
| 55 | /** |
Zane Shelley | 171a2e0 | 2020-11-13 13:56:13 -0600 | [diff] [blame] | 56 | * @brief Returns the list of all active chips in the system. |
| 57 | * @param o_chips The returned list of chips. |
| 58 | */ |
| 59 | void getActiveChips(std::vector<libhei::Chip>& o_chips); |
| 60 | |
Zane Shelley | 7ae9c8c | 2020-12-02 20:10:31 -0600 | [diff] [blame] | 61 | /** |
| 62 | * @return True, if hardware analysis is supported on this system. False, |
| 63 | * otherwise. |
| 64 | * @note Support for hardware analysis from the BMC started with P10 systems |
| 65 | * and is not supported on any older chip generations. |
| 66 | */ |
| 67 | bool queryHardwareAnalysisSupported(); |
| 68 | |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 69 | } // namespace pdbg |
| 70 | |
| 71 | } // namespace util |