rust: pin-init: add `std` and `alloc` support from the user-space version
authorBenno Lossin <benno.lossin@proton.me>
Sat, 8 Mar 2025 11:05:12 +0000 (11:05 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 16 Mar 2025 20:59:19 +0000 (21:59 +0100)
commit9b2299af3b92eb5b2c2f87965a5fa24a93e90d06
tree95e5e6dd0ab9ede77d0e35a7cf608079b3e9fd9c
parentdbd5058ba60c3499b24a7133a4e2e24dba6ea77b
rust: pin-init: add `std` and `alloc` support from the user-space version

To synchronize the kernel's version of pin-init with the user-space
version, introduce support for `std` and `alloc`. While the kernel uses
neither, the user-space version has to support both. Thus include the
required `#[cfg]`s and additional code.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250308110339.2997091-17-benno.lossin@proton.me
[ Undo the temporary `--extern force:alloc` since now we have contents
  for `alloc` here. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/Makefile
rust/pin-init/src/__internal.rs
rust/pin-init/src/alloc.rs [new file with mode: 0644]
rust/pin-init/src/lib.rs