lkml.org 
[lkml]   [2019]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2019-01-28 14:20    [W:0.118 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site