From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0EA91BE23E; Wed, 19 Feb 2025 09:08:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739956123; cv=none; b=sGMDiEZAGmtt0uPfZQ9nZwo1AMR2O2q+sqn1sJv3kTzYQvEyDSCzQswmYnK9sYVKeQxbt60Cd4J/8NOxxC2KSbDYAAm5Papfcmds37gtHRQiBOdLyZT1GGlsSc6qvtRN0/l4jDimWWXVhnRxEcoVCz7f0X5xxAs1kPF4OoshP7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739956123; c=relaxed/simple; bh=mRHu5GKeGdi/fBRDCPUsJtMi24AJ5fwDCKwrvkiX1kM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=pJlM9fTvSrfvF5+X11fsuJdRve5DaSApa4DdL6mH4XFYASXt6IuC8NbSFk/49OXxUGD0nKaqv0DVfle+0dnQQCe/GQWNmxi5rbmMPtkppXQiLB9dluHs53QuNAGnbBCLF/9DNEeR9w7M53g15nqZ3LwCCgTXjbd+eB/1Ai1HJaM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oSKIp+Fp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oSKIp+Fp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0D4AC4CED1; Wed, 19 Feb 2025 09:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739956123; bh=mRHu5GKeGdi/fBRDCPUsJtMi24AJ5fwDCKwrvkiX1kM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=oSKIp+FpJXbsJcx68oDcZRbtB4YhjSS4nr9aoP5Usn3nXhyC6x1MkfGoMxBjW0jzG r5zheFplSjLMjS0aFb2+SBz8Hsg2AvE9WVd+jyr+TvHtfzijyCPJKdPKQR4resuGnt vIXtFisE1iy3PiDYlxHj7q+a3e2hUD/YtJkNki/UJRNvFmE8ml1E7KwbgskWFAqIJR 6f/ekYyNhmPo3PRjd/9t5tMJYjt93o/Hoe3uSeTBotXzwkxupCrvQW26R7chZjB+8M 5hz7NI5IgZFeY00j2qQULenJEobHUSUIFahGRtmQMRlgkVXmcahLplHSDtTHHVOVgS eK2IMURUn4ZGA== From: Andreas Hindborg To: "Asahi Lina" Cc: "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , "Benno Lossin" , "Alice Ryhl" , "Trevor Gross" , "Jann Horn" , "Matthew Wilcox" , "Paolo Bonzini" , "Danilo Krummrich" , "Wedson Almeida Filho" , "Valentin Obst" , "Andrew Morton" , , , "Abdiel Janulgue" , , , Subject: Re: [PATCH 4/6] rust: addr: Add a module to declare core address types In-Reply-To: <20250202-rust-page-v1-4-e3170d7fe55e@asahilina.net> (Asahi Lina's message of "Sun, 02 Feb 2025 22:05:46 +0900") References: <20250202-rust-page-v1-0-e3170d7fe55e@asahilina.net> <20250202-rust-page-v1-4-e3170d7fe55e@asahilina.net> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Wed, 19 Feb 2025 09:51:11 +0100 Message-ID: <87zfiico74.fsf@kernel.org> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Asahi Lina" writes: > Encapsulates the core physical/DMA address types, so they can be used by > Rust abstractions. > > Signed-off-by: Asahi Lina > --- > rust/kernel/addr.rs | 15 +++++++++++++++ > rust/kernel/lib.rs | 1 + > 2 files changed, 16 insertions(+) > > diff --git a/rust/kernel/addr.rs b/rust/kernel/addr.rs > new file mode 100644 > index 0000000000000000000000000000000000000000..06aff10a0332355597060c5518d7fd6e114cf630 > --- /dev/null > +++ b/rust/kernel/addr.rs > @@ -0,0 +1,15 @@ > +// SPDX-License-Identifier: GPL-2.0 > + > +//! Kernel core address types. How about just "Kernel address tyeps"? What does "core" mean here? > + > +use bindings; > +use core::ffi; > + > +/// A physical memory address (which may be wider than the CPU pointer size) Missing period at end of sentence. > +pub type PhysicalAddr = bindings::phys_addr_t; > +/// A DMA memory address (which may be narrower than `PhysicalAddr` on some systems) Same. > +pub type DmaAddr = bindings::dma_addr_t; > +/// A physical resource size, typically the same width as `PhysicalAddr` Same. Best regards, Andreas Hindborg