Re: [PATCH 1/4] rust: sizes: add SZ_4G constant
From: Alvin Sun
Date: Tue Apr 21 2026 - 11:19:05 EST
On 4/20/26 23:15, Gary Guo wrote:
On Fri Apr 17, 2026 at 2:05 AM BST, Alvin Sun wrote:
Add SZ_4G constant defined as SZ_2G * 2. This constant will be used byHow is this supposed to work with 32-bit arch?
the Tyr driver for calculating user and kernel VA layout.
Signed-off-by: Alvin Sun <alvin.sun@xxxxxxxxx>
---
rust/kernel/sizes.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rust/kernel/sizes.rs b/rust/kernel/sizes.rs
index 661e680d93306..872f5bb181ecf 100644
--- a/rust/kernel/sizes.rs
+++ b/rust/kernel/sizes.rs
@@ -48,3 +48,5 @@
pub const SZ_1G: usize = bindings::SZ_1G as usize;
/// 0x80000000
pub const SZ_2G: usize = bindings::SZ_2G as usize;
+/// 0x100000000
+pub const SZ_4G: usize = SZ_2G * 2;
Thank you for pointing out these issues! I didn't properly consider
word size differences across architectures and wasn't sensitive enough
to using `usize` appropriately.
I'll fix both issues in the next version of the patchset.
Best regards,
Alvin Sun
Best,
Gary