디바이스 트리를 관리하는 주요 자료 구조는 다음과 같습니다.
* of_root
* of_aliases
* of_chosen
* of_stdout
of_root
of_root 전역 변수는 다음과 같습니다.
of_root = 0xF6B49F44 -> (
name = 0xF6B4A16C -> "",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6B49F94 -> "/",
properties = 0xF6B49F98,
deadprops = 0x0,
parent = 0x0,
child = 0xF6B4A170 -> (
name = 0xF6B4A264 -> "cpus",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6B4A1C0 -> "/cpus", // '/cpu' 노드가 자식임
properties = 0xF6B4A1C8,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0xF6B4A26C,
sibling = 0xF6B4DD28,
kobj = (name = 0xF562FF00 -> "cpus", entry = (next = 0xF6B4A294, prev = 0xF6B49F6C), parent = 0xF6B49F68, kse
_flags = 0,
data = 0x0),
sibling = 0x0,
kobj = (name = 0xF562FC40 -> "base", entry = (next = 0xF6B4A198, prev = 0xF562FB40), parent = 0xF562FB4C, kset
_flags = 16,
data = 0x0)
0xF6B4A170 주소에 있는 '/cpu' 노드의 sibling 정보를 확인하면 '/soc'로 확인됩니다.
of_root = 0xF6B49F44 -> (
name = 0xF6B4A16C -> "",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6B49F94 -> "/",
...
parent = 0x0,
child = 0xF6B4A170 -> (
name = 0xF6B4A264 -> "cpus",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6B4A1C0 -> "/cpus",
properties = 0xF6B4A1C8,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0xF6B4A26C,
sibling = 0xF6B4DD28 -> (
name = 0xF6B4DE84 -> "soc",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6B4DD78 -> "/soc",
properties = 0xF6B4DD80,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0xF6B4DE88,
sibling = 0xF6BE855C,
...
'/soc'의 sibling 정보를 확인하면, 아래와 같습니다.
sibling = 0xF6B4DD28 -> (
name = 0xF6B4DE84 -> "soc",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6B4DD78 -> "/soc",
properties = 0xF6B4DD80,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0xF6B4DE88,
sibling = 0xF6BE855C -> (
name = 0xF6BE8754 -> "chosen",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6BE85AC -> "/chosen",
properties = 0xF6BE85B4,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0x0,
sibling = 0xF6BE875C -> (
name = 0xF6BE8BC8 -> "aliases",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6BE87AC -> "/aliases",
properties = 0xF6BE87B8,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0x0,
sibling = 0xF6BE8BD0 -> (
name = 0xF6BE8CC4 -> "memory",
type = 0xC3437FD0 -> "memory",
phandle = 0,
full_name = 0xF6BE8C20 -> "/memory",
이 정보를 참고로 트리 구조는 다음과 같이 그릴 수 있습니다.
/
|--- /cpus
|--- /soc
|--- /chosen
|--- /aliases
|--- /memory
|--- /firmware
|--- /reserved-memory
|--- /psci
sibling = 0xF6BE8BD0 -> (
name = 0xF6BE8CC4 -> "memory",
type = 0xC3437FD0 -> "memory",
phandle = 0,
full_name = 0xF6BE8C20 -> "/memory",
properties = 0xF6BE8C28,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0x0,
sibling = 0xF6BE8CCC -> (
name = 0xF6BE8D5C -> "firmware",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6BE8D1C -> "/firmware",
properties = 0xF6BE8D28,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0xF6BE8D68,
sibling = 0xF6BE92DC -> (
name = 0xF6BE9410 -> "reserved-memory",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6BE932C -> "/reserved-memory",
properties = 0xF6BE9340,
deadprops = 0x0,
parent = 0xF6B49F44,
child = 0xF6BE9420,
sibling = 0xF6BEAA14 -> (
name = 0xF6BEAB08 -> "psci",
type = 0xC157AEAB -> "<NULL>",
phandle = 0,
full_name = 0xF6BEAA64 -> "/psci",
properties = 0xF6BEAA6C,
'[Debugging] Tips' 카테고리의 다른 글
유용한 TRACE32(T32) 명령어 (0) | 2023.05.04 |
---|---|
[리눅스커널] 리눅스 커널 브링업 패치 [1] (4.14v) (0) | 2023.05.04 |
[TRACE32] 메모리 덤프에서 검색(서치)하는 명령어: data.find (0) | 2023.05.04 |
[TRACE32] struct devce 정보 덤프: dpm_device_list_dump.cmm (0) | 2023.05.04 |
[GDB] Arm(Armv7): C 코드와 어셈블리 코드를 동시에 디버깅하기 (0) | 2023.05.04 |