]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86/cpufeature: Add helper macro for mask check macros
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 29 Jun 2016 20:01:10 +0000 (13:01 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 30 Jun 2016 07:11:32 +0000 (09:11 +0200)
commit8eda072e9d7c3429a372e3635dc5851f4a42dee1
tree6993803c4833ce2947eb086196a6862e9a9a7282
parent1e61f78baf893c7eb49f633d23ccbb420c8f808e
x86/cpufeature: Add helper macro for mask check macros

Every time we add a word to our cpu features, we need to add
something like this in two places:

(((bit)>>5)==16 && (1UL<<((bit)&31) & REQUIRED_MASK16))

The trick is getting the "16" in this case in both places.  I've
now screwed this up twice, so as pennance, I've come up with
this patch to keep me and other poor souls from doing the same.

I also commented the logic behind the bit manipulation showcased
above.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160629200110.1BA8949E@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/cpufeature.h