blob: 33e43203c77c862261f1fcd6ae3c94d56919f682 [file] [log] [blame]
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -06001#pragma once
2
Zane Shelleya0299852020-11-13 13:38:04 -06003#include <libpdbg.h>
4
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -06005#include <hei_main.hpp>
6
7namespace util
8{
9
10namespace pdbg
11{
12
Zane Shelleya0299852020-11-13 13:38:04 -060013/** @return The target associated with the given chip. */
14pdbg_target* getTrgt(const libhei::Chip& i_chip);
15
16/** @return A string representing the given target's devtree path. */
17const char* getPath(pdbg_target* i_trgt);
18
19/** @return A string representing the given chip's devtree path. */
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -060020const char* getPath(const libhei::Chip& i_chip);
21
Zane Shelleya0299852020-11-13 13:38:04 -060022/** @return The absolute position of the given target. */
23uint32_t getChipPos(pdbg_target* i_trgt);
24
25/** @return The absolute position of the given chip. */
26uint32_t getChipPos(const libhei::Chip& i_chip);
27
28/** @return The target type of the given target. */
29uint8_t getTrgtType(pdbg_target* i_trgt);
30
31/** @return The target type of the given chip. */
32uint8_t getTrgtType(const libhei::Chip& i_chip);
33
Zane Shelley171a2e02020-11-13 13:56:13 -060034/**
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 */
39pdbg_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 */
45void getActiveChips(std::vector<libhei::Chip>& o_chips);
46
Zane Shelleyf4bd5ff2020-11-05 22:26:04 -060047} // namespace pdbg
48
49} // namespace util