]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: move pin-init API into its own directory
authorBenno Lossin <benno.lossin@proton.me>
Sat, 8 Mar 2025 11:04:00 +0000 (11:04 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 16 Mar 2025 20:59:18 +0000 (21:59 +0100)
commitfbf8fb328d1bfe3bd17d5c5626cb485a1ca1a50d
tree22b074c2654735cbd823648911ed92fba3910637
parent206dea39e55968d8f3ad56771507361eb799dfc7
rust: move pin-init API into its own directory

In preparation of splitting off the pin-init crate from the kernel
crate, move all pin-init API code (including proc-macros) into
`rust/pin-init`.

Moved modules have their import path adjusted via the `#[path = "..."]`
attribute. This allows the files to still be imported in the kernel
crate even though the files are in different directories.

Code that is moved out of files (but the file itself stays where it is)
is imported via the `include!` macro. This also allows the code to be
moved while still being part of the kernel crate.

Note that this commit moves the generics parsing code out of the GPL-2.0
file `rust/macros/helpers.rs` into the Apache-2.0 OR MIT file
`rust/pin_init/internal/src/helpers.rs`. I am the sole author of that
code and it already is available with that license at [1].
The same is true for the entry-points of the proc-macros `pin_data`,
`pinned_drop` and `derive_zeroable` in `rust/macros/lib.rs` that are
moved to `rust/pin_data/internal/src/lib.rs`. Although there are some
smaller patches that fix the doctests.

Link: https://github.com/Rust-for-Linux/pinned-init
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250308110339.2997091-3-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/lib.rs
rust/macros/helpers.rs
rust/macros/lib.rs
rust/pin-init/internal/src/helpers.rs [new file with mode: 0644]
rust/pin-init/internal/src/lib.rs [new file with mode: 0644]
rust/pin-init/internal/src/pin_data.rs [moved from rust/macros/pin_data.rs with 100% similarity]
rust/pin-init/internal/src/pinned_drop.rs [moved from rust/macros/pinned_drop.rs with 100% similarity]
rust/pin-init/internal/src/zeroable.rs [moved from rust/macros/zeroable.rs with 100% similarity]
rust/pin-init/src/__internal.rs [moved from rust/kernel/init/__internal.rs with 100% similarity]
rust/pin-init/src/lib.rs [moved from rust/kernel/init.rs with 100% similarity]
rust/pin-init/src/macros.rs [moved from rust/kernel/init/macros.rs with 100% similarity]