rust: add `kernel` crate
authorWedson Almeida Filho <wedsonaf@google.com>
Fri, 11 Feb 2022 19:25:34 +0000 (20:25 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 11 Feb 2022 19:42:03 +0000 (20:42 +0100)
commit9af92b3847ba3cbc997961e8a197e0c7cda1e774
treeae6b73fdcd3e51549c1d278c30e021099c0d6b79
parenta289bace34c98d622b8adceb4c041f320eec16e7
rust: add `kernel` crate

The `kernel` crate currently includes all the abstractions that wrap
kernel features written in C.

These abstractions call the C side of the kernel via the generated
bindings with the `bindgen` tool. Modules developed in Rust should
never call the bindings themselves.

In the future, as the abstractions grow in number, we may need
to split this crate into several, possibly following a similar
subdivision in subsystems as the kernel itself and/or moving
the code to the actual subsystems.

Co-developed-by: Alex Gaynor <alex.gaynor@gmail.com>
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
Co-developed-by: Geoffrey Thomas <geofft@ldpreload.com>
Signed-off-by: Geoffrey Thomas <geofft@ldpreload.com>
Co-developed-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Finn Behrens <me@kloenk.de>
Co-developed-by: Adam Bratschi-Kaye <ark.email@gmail.com>
Signed-off-by: Adam Bratschi-Kaye <ark.email@gmail.com>
Co-developed-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Co-developed-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Co-developed-by: Sven Van Asbroeck <thesven73@gmail.com>
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
Co-developed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Gary Guo <gary@garyguo.net>
Co-developed-by: Boris-Chengbiao Zhou <bobo1239@web.de>
Signed-off-by: Boris-Chengbiao Zhou <bobo1239@web.de>
Co-developed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Co-developed-by: Fox Chen <foxhlchen@gmail.com>
Signed-off-by: Fox Chen <foxhlchen@gmail.com>
Co-developed-by: Dan Robertson <daniel.robertson@starlab.io>
Signed-off-by: Dan Robertson <daniel.robertson@starlab.io>
Co-developed-by: Viktor Garske <viktor@v-gar.de>
Signed-off-by: Viktor Garske <viktor@v-gar.de>
Co-developed-by: Dariusz Sosnowski <dsosnowski@dsosnowski.pl>
Signed-off-by: Dariusz Sosnowski <dsosnowski@dsosnowski.pl>
Co-developed-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
Signed-off-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
Co-developed-by: Niklas Mohrin <dev@niklasmohrin.de>
Signed-off-by: Niklas Mohrin <dev@niklasmohrin.de>
Co-developed-by: Gioh Kim <gurugio@gmail.com>
Signed-off-by: Gioh Kim <gurugio@gmail.com>
Co-developed-by: Daniel Xu <dxu@dxuuu.xyz>
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Co-developed-by: Milan Landaverde <milan@mdaverde.com>
Signed-off-by: Milan Landaverde <milan@mdaverde.com>
Co-developed-by: Morgan Bartlett <mjmouse9999@gmail.com>
Signed-off-by: Morgan Bartlett <mjmouse9999@gmail.com>
Co-developed-by: Maciej Falkowski <m.falkowski@samsung.com>
Signed-off-by: Maciej Falkowski <m.falkowski@samsung.com>
Co-developed-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Co-developed-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
44 files changed:
kernel/printk/printk.c
rust/kernel/allocator.rs [new file with mode: 0644]
rust/kernel/amba.rs [new file with mode: 0644]
rust/kernel/bindings.rs [new file with mode: 0644]
rust/kernel/bindings_helper.h [new file with mode: 0644]
rust/kernel/buffer.rs [new file with mode: 0644]
rust/kernel/build_assert.rs [new file with mode: 0644]
rust/kernel/c_types.rs [new file with mode: 0644]
rust/kernel/chrdev.rs [new file with mode: 0644]
rust/kernel/clk.rs [new file with mode: 0644]
rust/kernel/cred.rs [new file with mode: 0644]
rust/kernel/device.rs [new file with mode: 0644]
rust/kernel/driver.rs [new file with mode: 0644]
rust/kernel/error.rs [new file with mode: 0644]
rust/kernel/file.rs [new file with mode: 0644]
rust/kernel/file_operations.rs [new file with mode: 0644]
rust/kernel/gpio.rs [new file with mode: 0644]
rust/kernel/io_buffer.rs [new file with mode: 0644]
rust/kernel/io_mem.rs [new file with mode: 0644]
rust/kernel/iov_iter.rs [new file with mode: 0644]
rust/kernel/irq.rs [new file with mode: 0644]
rust/kernel/lib.rs [new file with mode: 0644]
rust/kernel/linked_list.rs [new file with mode: 0644]
rust/kernel/miscdev.rs [new file with mode: 0644]
rust/kernel/mm.rs [new file with mode: 0644]
rust/kernel/module_param.rs [new file with mode: 0644]
rust/kernel/of.rs [new file with mode: 0644]
rust/kernel/pages.rs [new file with mode: 0644]
rust/kernel/platform.rs [new file with mode: 0644]
rust/kernel/power.rs [new file with mode: 0644]
rust/kernel/prelude.rs [new file with mode: 0644]
rust/kernel/print.rs [new file with mode: 0644]
rust/kernel/random.rs [new file with mode: 0644]
rust/kernel/raw_list.rs [new file with mode: 0644]
rust/kernel/rbtree.rs [new file with mode: 0644]
rust/kernel/revocable.rs [new file with mode: 0644]
rust/kernel/security.rs [new file with mode: 0644]
rust/kernel/static_assert.rs [new file with mode: 0644]
rust/kernel/std_vendor.rs [new file with mode: 0644]
rust/kernel/str.rs [new file with mode: 0644]
rust/kernel/sysctl.rs [new file with mode: 0644]
rust/kernel/task.rs [new file with mode: 0644]
rust/kernel/types.rs [new file with mode: 0644]
rust/kernel/user_ptr.rs [new file with mode: 0644]