diff options
| author | Alexandre Courbot <acourbot@nvidia.com> | 2026-03-14 10:06:17 +0900 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-03-17 20:04:11 +0100 |
| commit | 20ba6a1dbcb957152f6d858015b3a3311dd6da49 (patch) | |
| tree | 2a5f28ab4eddf4f401e55b34dade8e11673b42c3 /arch/v850/kernel/git@git.tavy.me:linux.git | |
| parent | 147b41ba23d63f43ed34e6940417a5506e323370 (diff) | |
rust: io: add `register!` macro
Add a macro for defining hardware register types with I/O accessors.
Each register field is represented as a `Bounded` of the appropriate bit
width, ensuring field values are never silently truncated.
Fields can optionally be converted to/from custom types, either fallibly
or infallibly.
The address of registers can be direct, relative, or indexed, supporting
most of the patterns in which registers are arranged.
Suggested-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/all/20250306222336.23482-6-dakr@kernel.org/
Co-developed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260314-register-v9-7-86805b2f7e9d@nvidia.com
[ * Improve wording and formatting of doc-comments,
* Import build_assert!(),
* Add missing inline annotations,
* Call static_assert!() with absolute path,
* Use expect instead of allow.
- Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'arch/v850/kernel/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
