rust: add `kernel` crate
authorWedson Almeida Filho <wedsonaf@google.com>
Sat, 3 Jul 2021 15:16:07 +0000 (17:16 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 17 Jan 2022 02:20:27 +0000 (03:20 +0100)
commit08ce53e5594e13f1e02e2dac61159b24ec18cbcc
tree2aaf34b8c9c072ef5f2df064cf10c007e9e1577c
parent0ca0dcf881fb218764c02cd553f76e0e439cb235
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: Hsiang-Cheng Yang <rick68@gmail.com>
Signed-off-by: Hsiang-Cheng Yang <rick68@gmail.com>
Co-developed-by: Maciej Falkowski <m.falkowski@samsung.com>
Signed-off-by: Maciej Falkowski <m.falkowski@samsung.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>
53 files changed:
include/linux/spinlock.h
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/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/sync/arc.rs [new file with mode: 0644]
rust/kernel/sync/condvar.rs [new file with mode: 0644]
rust/kernel/sync/guard.rs [new file with mode: 0644]
rust/kernel/sync/locked_by.rs [new file with mode: 0644]
rust/kernel/sync/mod.rs [new file with mode: 0644]
rust/kernel/sync/mutex.rs [new file with mode: 0644]
rust/kernel/sync/revocable_mutex.rs [new file with mode: 0644]
rust/kernel/sync/seqlock.rs [new file with mode: 0644]
rust/kernel/sync/spinlock.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]