diff options
| author | Eliot Courtney <ecourtney@nvidia.com> | 2026-09-30 11:42:52 +0900 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2026-10-13 12:52:26 +0200 |
| commit | bf461edb197bd7c0462c1d13bb1c3b51d6892fd3 (patch) | |
| tree | 9d5ccd783c0f921efee747b7f200a630a0f2b941 /rust | |
| parent | 931790a91378f6513ba82730eb5607479c3184a0 (diff) | |
rust: sizes: add sub-1K size constants
Add some more size constants, mirroring include/linux/sizes.h. This is
useful for making `Alignment` implement `SizeConstants` in a following
patch, because these are more common alignment values.
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
Link: https://patch.msgid.link/20260930-chid-v9-3-0d6cca376cff@nvidia.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/kernel/sizes.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rust/kernel/sizes.rs b/rust/kernel/sizes.rs index 521b2b38bfe7..7d03361eae3d 100644 --- a/rust/kernel/sizes.rs +++ b/rust/kernel/sizes.rs @@ -35,6 +35,26 @@ macro_rules! define_sizes { ($($type:ty),* $(,)?) => { define_sizes!(@internal [$($type),*] + /// `0x0000_0001`. + SZ_1, + /// `0x0000_0002`. + SZ_2, + /// `0x0000_0004`. + SZ_4, + /// `0x0000_0008`. + SZ_8, + /// `0x0000_0010`. + SZ_16, + /// `0x0000_0020`. + SZ_32, + /// `0x0000_0040`. + SZ_64, + /// `0x0000_0080`. + SZ_128, + /// `0x0000_0100`. + SZ_256, + /// `0x0000_0200`. + SZ_512, /// `0x0000_0400`. SZ_1K, /// `0x0000_0800`. |
