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 | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 5 | #include <hei_main.hpp> |
| 6 | |
| 7 | namespace util |
| 8 | { |
| 9 | |
| 10 | namespace pdbg |
| 11 | { |
| 12 | |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame] | 13 | /** @return The target associated with the given chip. */ |
| 14 | pdbg_target* getTrgt(const libhei::Chip& i_chip); |
| 15 | |
| 16 | /** @return A string representing the given target's devtree path. */ |
| 17 | const char* getPath(pdbg_target* i_trgt); |
| 18 | |
| 19 | /** @return A string representing the given chip's devtree path. */ |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 20 | const char* getPath(const libhei::Chip& i_chip); |
| 21 | |
Zane Shelley | a029985 | 2020-11-13 13:38:04 -0600 | [diff] [blame] | 22 | /** @return The absolute position of the given target. */ |
| 23 | uint32_t getChipPos(pdbg_target* i_trgt); |
| 24 | |
| 25 | /** @return The absolute position of the given chip. */ |
| 26 | uint32_t getChipPos(const libhei::Chip& i_chip); |
| 27 | |
| 28 | /** @return The target type of the given target. */ |
| 29 | uint8_t getTrgtType(pdbg_target* i_trgt); |
| 30 | |
| 31 | /** @return The target type of the given chip. */ |
| 32 | uint8_t getTrgtType(const libhei::Chip& i_chip); |
| 33 | |
Zane Shelley | 171a2e0 | 2020-11-13 13:56:13 -0600 | [diff] [blame^] | 34 | /** |
| 35 | * @return The pib target associated with the given proc target. |
| 36 | * @note Will assert the given target is a proc target. |
| 37 | * @note Will assert the returned pib target it not nullptr. |
| 38 | */ |
| 39 | pdbg_target* getPibTrgt(pdbg_target* i_procTrgt); |
| 40 | |
| 41 | /** |
| 42 | * @brief Returns the list of all active chips in the system. |
| 43 | * @param o_chips The returned list of chips. |
| 44 | */ |
| 45 | void getActiveChips(std::vector<libhei::Chip>& o_chips); |
| 46 | |
Zane Shelley | f4bd5ff | 2020-11-05 22:26:04 -0600 | [diff] [blame] | 47 | } // namespace pdbg |
| 48 | |
| 49 | } // namespace util |