-
Notifications
You must be signed in to change notification settings - Fork 1
Dev #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Introduced U32, FStr, and StringList property types in `cells.rs` to handle 32-bit unsigned integers, null-terminated strings, and lists of strings respectively. - Enhanced the `PropertyTrait` and `PropertyOp` traits to support new property types. - Refactored `mod.rs` to include new property modules and updated the `Property` enum to accommodate new types. - Created `phandle.rs` to manage phandle and status properties, including their serialization and deserialization. - Updated `define.rs` to implement `Deref` and `Display` traits for `Status` and added a `raw` method for `Phandle`. - Modified `fdt.rs` and `mod.rs` to remove deprecated properties and adjust the handling of existing properties. - Updated tests in `node.rs` to reflect changes in property handling and removed assertions related to deprecated properties.
- 删除 display_dts.rs 示例文件 - 删除 all_nodes.rs 测试文件 - 删除 builder_cells.rs 测试文件 - 删除 cells_scope.rs 测试文件 - 删除 display.rs 测试文件 - 删除 find_all.rs 测试文件 - 删除 remove_node.rs 测试文件 - 在 define.rs 中添加 MemoryReservation 结构体 - 在 fdt.rs 中实现 MemoryReservationIter 迭代器 - 更新 Fdt 结构体以支持内存保留条目的迭代 - 移除 mod.rs 中的多余空行 - 更新 node.rs 测试以移除对 model 属性的检查
…的 child_bus_address
…体以使用生命周期参数;增加 PCI 中断映射的测试用例
refactor: 在 NodePci 中添加对 masked_child_address 的初始化
…h 和 get_by_path 方法
…_from_raw 方法以增强错误处理
- Removed the PCI node implementation from `pci.rs`, consolidating PCI-related functionality. - Deleted `ref.rs` which contained NodeRef and NodeMut structures, simplifying node reference handling. - Updated `mod.rs` in the property module to streamline property representation, removing the PropertyKind enum and directly using a byte vector for property data. - Enhanced the `Reader` struct in `data.rs` to include a method for reading multiple cells as a single u64 value. - Made `data.rs` and `lib.rs` adjustments to ensure proper module visibility and organization.
- Replace Node::new_raw with Node::new throughout test file
- Update Node::root() to Node::new("") for root node creation
- Replace find_child_exact with get_child method
- These changes align test code with the refactored Node API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a major refactoring of the fdt-raw and fdt-edit libraries. The changes include:
- Refactored the Property enum to a struct-based approach with accessor methods
- Simplified test assertions using loops and arrays
- Introduced specialized node types (Clock, PCI, InterruptController, Memory)
- Reorganized the node module with better separation of concerns
- Added context-aware node iteration and references
- Improved property access patterns with caching
Key Changes:
- Converted Property from enum to struct with typed accessor methods
- Removed Reg struct in favor of RegIter directly
- Added specialized node reference types with domain-specific functionality
- Improved test organization with data-driven approaches
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| fdt-raw/tests/node.rs | Refactored assertions to use loop-based data structures for cleaner test code |
| fdt-raw/src/node/prop/reg.rs | Simplified RegIter implementation, removed Reg wrapper struct |
| fdt-raw/src/node/prop/mod.rs | Converted Property from enum to struct with accessor methods |
| fdt-raw/src/node/mod.rs | Split Node into NodeBase and added specialized node types |
| fdt-raw/src/data.rs | Added U32Iter and StrIter, improved Reader API |
| fdt-edit/src/node/mod.rs | Major refactoring: removed trait-based approach, added typed node references |
| fdt-edit/src/node/pci.rs | New PCI-specific node implementation with ranges and interrupt parsing |
| fdt-edit/src/node/clock.rs | New clock node implementation with clock reference support |
| fdt-edit/src/node/interrupt_controller.rs | New interrupt controller node implementation |
| fdt-edit/src/node/memory.rs | New memory node implementation with region parsing |
| fdt-edit/src/ctx.rs | New context module for managing node hierarchy and phandle lookups |
| fdt-edit/tests/*.rs | Updated tests to use new API patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.