Skip to content

Conversation

@ZR233
Copy link
Member

@ZR233 ZR233 commented Dec 7, 2025

No description provided.

ZR233 added 30 commits December 4, 2025 11:01
- 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 属性的检查
refactor: 在 NodePci 中添加对 masked_child_address 的初始化
ZR233 added 25 commits December 6, 2025 20:11
- 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
Copilot AI review requested due to automatic review settings December 7, 2025 09:56
@ZR233 ZR233 merged commit 07134b2 into main Dec 7, 2025
12 checks passed
@ZR233 ZR233 deleted the dev branch December 7, 2025 09:57
Copy link

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants