add tty0tty module and support#1089
Closed
lwz23 wants to merge 1398 commits intoRust-for-Linux:rust-nextfrom
lwz23:main
Closed
add tty0tty module and support#1089lwz23 wants to merge 1398 commits intoRust-for-Linux:rust-nextfrom lwz23:main
lwz23 wants to merge 1398 commits intoRust-for-Linux:rust-nextfrom
lwz23:main
Conversation
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
We do not use `dylib`s, `cdylib`s nor cross-compiled proc macros. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
We do not deal with `libc`. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
The kernel is compiled with `-mgeneral-regs-only`, thus these should not be enabled. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Target specification cleanup
Linux 5.17-rc8 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Sync with v5.17-rc8
This makes `scripts/generate_rust_target.rs` take about 94% of the original time. From #692 (comment): > This will make the linker skip debuginfo from libstd (which > is shipped with debuginfo). ...which should be fine -- if somebody really needs to debug one of the host programs/scripts, they may as well enable debugging info for the actual code too. Suggested-by: bjorn3 <bjorn3_gh@protonmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Makefile: strip debug info for Rust host programs
This is for the associated type to have a clearer meaning, and to bring it in line with other traits like `irq::Chip` and `gpio::Chip` where the context data type is simply `Data`. This is a pure refactor with no functional changes intended. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
rust: rename `FileOperations::Wrapper` to `FileOperations::Data`
rust: add Hardware Random Number Generator subsystem
This is to avoid repeating the "file" prefix and for consistency with other modules that also have operations like `power::Operations`. This is a pure refactor, no functional changes are intended. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
This is so that we can `use` them with a wildcard (which we do in the prelude), which allows us to simplify expressions like `Err(Error::EINVAL)` to `Err(EINVAL)`. This is a pure refactor, no functional changes are intended. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
rust: move error codes to the `error::code` module
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
No functional change intended. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Also be consistent in path style. No functional change intended. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
These were in the bottom since previously we used secondary expansion, but now we do not, so we can put them at a better place. No functional change intended. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Many lines are shorter now, so reformat the whitespace. No functional change intended. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust: C files improvements & cleanups
scripts: generate_rust_target: add comment on `llvm-target`
rust: Makefile: simplifications & cleanups
rust: define fs context
rust: file: Add `FileFlags` type for `File` flags
This brings it in line with other cases (e.g., `irq::flags`, `fs::flags`, `mm::virt::flags`) and allows users to `use` all constants at once, for example, `use kernel::file::flags::*` if they so choose. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Re-implement concat_idents! in libmacros
rust: change `FileFlags` struct to `flags` module
This allows file system contexts to be further initialised with parameters from userspace before a fs is mounted or reconfigured. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Given the message is the main point of running `rustavailable` for normal users, and those that just want the status code may ignore it, change the target to print to `stdout`. Link: https://lore.kernel.org/lkml/CAK7LNAQZOTjxJyS3WC1sM7LE-An7DL8xoW=-s1ONe7cq4YukNQ@mail.gmail.com/ Suggested-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust: add support for file system parameters
They are also allowed to specify the type of superblock keying. With this change, drivers get a new callback, `fill_super`, that they need to implement to initialise new superblocks. In subsequent commits, they'll be able to populate the root with entries, but for now it's empty. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Adds a safe abstraction for msleep. Signed-off-by: John Baublitz <john.m.baublitz@gmail.com>
rust: delay: Add safe wrapper for msleep
Makefile: use `stdout` for `rustavailable`
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Lately I have noticed more CI jobs being slower than usual, so let's increase a bit the timeout. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
ci: increase timeout a bit
rust: delay: add `coarse_sleep` examples and tests
As Clang 14 supports the btf_type_tag attribute and building with PAHOLE_HAS_BTF_TAG defines BTF_TYPE_TAG(value) to be __attribute__((btf_type_tag(#value))). Because of this bindgen might get confused and discards constness of attributed function parameters that are indeed const pointers (like const char __user * -> char *). This patch fixes that by passing a BINDGEN_RUN definition to bindgen that causes BTF_TYPE_TAG(value) to be defined as nothing, thus generating proper definitions for functions like write in the file_operations struct. Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
rust: Proper bindgen sources for BTF debug builds
I get the following warning when using rust-analyzer and the `module` macro: Static variable `__rust_fs_4` should have UPPER_SNAKE_CASE name, e.g. `__RUST_FS_4` This patch emits an uppercase name for the static, which makes the warning go away. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
rust: allow fs driver to initialise new superblocks
Linux 5.19-rc8 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This reduces the amount of code needed to implement a module that only implements a file system. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Sync with v5.19-rc8
rust: add `module_fs` macro
rust: fix rust-analyzer warning in macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
it push all current tty0tty module work