Skip to content

Commit 74f49b3

Browse files
authored
feat: add ARMv7-A support with page table structures and tests (#31)
* feat: add ARMv7-A support with page table structures and tests * feat: add contiguous frame allocation and deallocation methods to PagingHandler * feat: remove unused feature flag for stmt_expr_attributes * feat: refactor ARMv7-A descriptor checks and add virtual address index extraction functions * format code * Re-exports architecture-specific items for easier access Unifies the public API by re-exporting architecture-specific definitions, making them accessible to downstream users without direct module imports. Improves usability and reduces friction for multi-arch consumers. * feat: add inline annotations to descriptor attribute functions for optimization * code fmt * refactor: consolidate common flag logic in descriptor attribute functions * refactor: remove unused bits32 module for 32-bit architecture * refactor: simplify address validation and improve table access methods * docs: update README to include ARM (32-bit) and correct links for page table structures * refactor: update TLB flush implementation to use a zero variable * refactor: enhance descriptor attribute handling for L2 Small Page and improve common flag logic * refactor: improve code formatting and readability in DescriptorAttr and GenericPTE implementations * test: add configuration for 32-bit pointer width in ARM32 deallocation test * test: add conditional compilation for 32-bit pointer width in run_test_for_32bit function * fix: ensure PageTable32 is imported in 32-bit test function * code fmt * fix: update conditional compilation for 32-bit and 64-bit modules * fix: remove unused bits32 module and clean up imports in lib.rs * code fmt * fix: update version and rust-version in Cargo.toml; enhance ARM page table structures * fix: update conditional compilation for 32-bit and 64-bit modules to include documentation support * fix: rename allocation functions for clarity and consistency * fix: implement frame allocation in PagingHandler and remove duplicate function * fix: add inline attribute to common_flags function in DescriptorAttr * Rename parameter 'align_pow2' to 'align' in alloc_frames * feat: add borrowed_entries to PageTable32 for tracking borrowed frames * feat: add TlbFlusher enum and SMALL_FLUSH_THRESHOLD constant for page table management
1 parent df2f8a7 commit 74f49b3

File tree

11 files changed

+1218
-38
lines changed

11 files changed

+1218
-38
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
rust-toolchain: [nightly]
12-
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat]
12+
targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat, loongarch64-unknown-none-softfloat, armv7a-none-eabi]
1313
steps:
1414
- uses: actions/checkout@v4
1515
- uses: dtolnay/rust-toolchain@nightly

page_table_entry/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ Currently supported architectures and page table entry types:
1111

1212
- x86: [`x86_64::X64PTE`][1]
1313
- ARM: [`aarch64::A64PTE`][2]
14-
- RISC-V: [`riscv::Rv64PTE`][3]
15-
- LoongArch: [`loongarch64::LA64PTE`][4]
14+
- ARM (32-bit): [`arm::A32PTE`][3]
15+
- RISC-V: [`riscv::Rv64PTE`][4]
16+
- LoongArch: [`loongarch64::LA64PTE`][5]
1617

17-
All these types implement the [`GenericPTE`][5] trait, which provides unified
18+
All these types implement the [`GenericPTE`][6] trait, which provides unified
1819
methods for manipulating various page table entries.
1920

2021
[1]: https://docs.rs/page_table_entry/latest/page_table_entry/x86_64/struct.X64PTE.html
2122
[2]: https://docs.rs/page_table_entry/latest/page_table_entry/aarch64/struct.A64PTE.html
22-
[3]: https://docs.rs/page_table_entry/latest/page_table_entry/riscv/struct.Rv64PTE.html
23-
[4]: https://docs.rs/page_table_entry/latest/page_table_entry/loongarch64/struct.LA64PTE.html
24-
[5]: https://docs.rs/page_table_entry/latest/page_table_entry/trait.GenericPTE.html
23+
[3]: https://docs.rs/page_table_entry/latest/page_table_entry/arm/struct.A32PTE.html
24+
[4]: https://docs.rs/page_table_entry/latest/page_table_entry/riscv/struct.Rv64PTE.html
25+
[5]: https://docs.rs/page_table_entry/latest/page_table_entry/loongarch64/struct.LA64PTE.html
26+
[6]: https://docs.rs/page_table_entry/latest/page_table_entry/trait.GenericPTE.html
2527

2628
## Examples (x86_64)
2729

0 commit comments

Comments
 (0)