Commit ab4a969
authored
refactor: improve iter (#6)
* Remove unused property parsing module and associated tests
- Deleted the `property.rs` module which provided functionality for parsing and accessing device tree properties.
- Removed tests related to device tree headers and memory reservations that relied on the deleted module.
- Updated `Cargo.toml` to reflect the removal of the module and incremented the version to 0.2.0.
* feat: Enhance FDT parsing and formatting utilities
- Added new constants for size calculations in FDT parsing (`U32_SIZE`, `MEM_RSV_ENTRY_SIZE`).
- Improved `Bytes` struct with additional documentation and examples for clarity.
- Refactored `Fdt` struct methods to utilize new utility functions for path splitting and address translation.
- Introduced `fmt_utils` module for shared formatting functions, improving code organization and readability.
- Updated `Property` formatting to handle various types more gracefully, including a new method for typed formatting.
- Enhanced error handling in iterators to allow for graceful degradation during parsing.
- Added comprehensive documentation to several structs and methods to improve maintainability and usability.
* feat: Add path tracking to FDT nodes and iterators
* feat: Add batch address translation method to FDT parser
* feat: Refactor address translation methods for improved batch processing
* feat: Add method to find direct children of a node by path and corresponding tests
* feat: Add fdt-edit module with Node and Property structures for device tree manipulation
* feat: Implement editable FDT structure with node iteration and testing
* feat: Refactor node iteration with new NodeRef and NodeRefMut structures
* feat: Update property formatting in NodeRef display implementation
* feat: Refactor Node handling with NodeGeneric and update NodeRef/NodeRefMut implementations
* feat: Refactor Node iteration and enhance NodeKind with NodeOp trait
* feat: Enhance compatible property formatting in NodeGeneric display implementation
* feat: Add NodeMemory struct and enhance NodeKind with memory node support
* feat: Enhance NodeIterMeta to support parent path tracking and update NodeIter for path construction
* feat: Add path retrieval method to NodeKind and implement exact path lookup in Fdt
* Refactor device tree node iteration and viewing
- Removed obsolete node iteration and memory handling code from `node_iter` module.
- Introduced `NodeView` and `NodeViewMut` for safe, typed access to device tree nodes.
- Implemented visitor traits (`Visit` and `VisitMut`) for traversing device tree nodes.
- Updated tests to validate new node iteration and classification logic.
- Enhanced path lookup functionality to ensure correct resolution of node paths.
* feat: Add methods to NodeType for accessing node properties and enhance test for node classification
* feat: Add enum_dispatch dependency and implement NodeView for safe access to device tree nodes
* Implement specialized node views for device tree nodes
- Added `NodeGeneric` and `NodeGenericMut` for generic node views.
- Introduced `IntcNodeView` and `IntcNodeViewMut` for interrupt controller nodes.
- Created `MemoryNodeView` and `MemoryNodeViewMut` for memory nodes, including methods for parsing memory regions.
- Refactored `NodeView` and `NodeType` to support new specialized views.
- Removed the visitor traits and related implementations for traversing device tree nodes.
- Updated tests to reflect changes in node view access and removed obsolete visitor tests.
* fix: Adjust imports in memory and header modules for consistency
* feat: Enhance Fdt with alias resolution and path normalization methods
* feat: Implement address translation for memory regions and add tests
* feat: Implement address translation for device tree node registers and add corresponding tests
* fix: Remove unused set_regs method from IntcNodeViewMut and MemoryNodeViewMut
* fix: Refactor path_of method to use while let for cleaner code and add dead code allowance for parent_mut method
* feat: Add ViewMutOp trait and implement for NodeGenericMut; enhance child node addition methods
* feat: Enhance ViewMutOp trait with new implementations for IntcNodeViewMut and MemoryNodeViewMut; adjust visibility of add_child method in NodeGenericMut
* feat: Add root_mut method to Fdt for mutable access to the root node
* feat: Implement parent mapping in Fdt and update node structure for parent access
* feat: 添加 FDT 编码模块及相关测试用例,支持将 FDT 结构序列化为 DTB 格式
* feat: 修改 find_children_by_path 方法以返回 ChildrenIter,优化路径处理逻辑
* feat: 优化 find_children_by_path 方法,改进返回值处理和日志记录
* feat: 添加 FDT 重建测试,验证解析和编码的正确性
* feat: 添加时钟和PCI节点视图模块及相关测试,增强设备树解析能力
* feat: 优化代码格式,调整多个测试文件中的打印语句和属性设置的格式
* feat: 简化 Clippy 和构建命令,移除不必要的 manifest-path 和包参数
* feat: 优化 PciNodeView 中的地址和中断填充逻辑,使用更清晰的函数替代
* feat: 移除 CI 配置中的目标架构,简化构建和检查步骤1 parent 943d275 commit ab4a969
File tree
83 files changed
+3512
-10700
lines changed- .claude
- .github/workflows
- dtb-tool
- src
- fdt-edit
- examples
- src
- node
- view
- prop
- tests
- fdt-parser
- examples
- src
- base
- node
- cache
- node
- tests
- fdt-raw
- src
- node
- prop
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
83 files changed
+3512
-10700
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | | - | |
| 26 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Binary file not shown.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
13 | 10 | | |
14 | | - | |
| 11 | + | |
15 | 12 | | |
16 | 13 | | |
17 | | - | |
18 | | - | |
| 14 | + | |
19 | 15 | | |
| 16 | + | |
20 | 17 | | |
21 | 18 | | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
0 commit comments