[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190128132003.GA744@infradead.org>
Date: Mon, 28 Jan 2019 05:20:03 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Thomas Bogendoerfer <tbogendoerfer@...e.de>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
James Hogan <jhogan@...nel.org>, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, linux-pci@...r.kernel.org,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Paul Burton <paul.burton@...s.com>,
Ralf Baechle <ralf@...ux-mips.org>
Subject: Re: [PATCH 2/7] MIPS: SGI-IP27: clean up bridge access and header
files
On Thu, Jan 24, 2019 at 06:47:23PM +0100, Thomas Bogendoerfer wrote:
> #ifndef __ASSEMBLY__
> +/* Address translation entry for mapped pci32 accesses */
> +union bridge_ate {
> + u64 ent;
> + struct ate_s {
> + u64 rmf:16;
> + u64 addr:36;
> + u64 targ:4;
> + u64 reserved:3;
> + u64 barrier:1;
> + u64 prefetch:1;
> + u64 precise:1;
> + u64 coherent:1;
> + u64 valid:1;
> + } field;
Note that we generally try to avoid using bitfields for hardware
descriptions and instead use masking/shifting, possibly hidden in
macros. The portability argument for that doesn't really apply
here as the code is obviously MIPS/big endian specific, but I think
it generally is a good example and more readable as well.
Powered by blists - more mailing lists