rust: uapi: Add UAPI crate
authorAsahi Lina <lina@asahilina.net>
Mon, 3 Apr 2023 09:33:52 +0000 (18:33 +0900)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 21 Apr 2023 23:46:45 +0000 (01:46 +0200)
commit4e1746656839ab1e88d76eec4d2fa0b41d585604
tree3636331016fa3b21e46f4d54d0741c3b7f1021d4
parent19096bce815716cf93fc1ef3965629c3affa26f1
rust: uapi: Add UAPI crate

This crate mirrors the `bindings` crate, but will contain only UAPI
bindings. Unlike the bindings crate, drivers may directly use this crate
if they have to interface with userspace.

Initially, just bind the generic ioctl stuff.

In the future, we would also like to add additional checks to ensure
that all types exposed by this crate satisfy UAPI-safety guarantees
(that is, they are safely castable to/from a "bag of bits").

[ Miguel: added support for the `rustdoc` and `rusttest` targets,
  since otherwise they fail, and we want to keep them working. ]

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Link: https://lore.kernel.org/r/20230329-rust-uapi-v2-1-bca5fb4d4a12@asahilina.net
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/.gitignore
rust/Makefile
rust/kernel/lib.rs
rust/uapi/lib.rs [new file with mode: 0644]
rust/uapi/uapi_helper.h [new file with mode: 0644]