linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 01/10] powerpc: Add more PPC bit conversion macros
@ 2017-04-05  7:54 Benjamin Herrenschmidt
  2017-04-05  7:54 ` [PATCH v2 02/10] powerpc: Add optional smp_ops->prepare_cpu SMP callback Benjamin Herrenschmidt
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2017-04-05  7:54 UTC (permalink / raw)
  To: linuxppc-dev

Add 32 and 8 bit variants

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/include/asm/bitops.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index bc5fdfd..33a24fd 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -55,6 +55,14 @@
 #define PPC_BITEXTRACT(bits, ppc_bit, dst_bit)			\
 	((((bits) >> PPC_BITLSHIFT(ppc_bit)) & 1) << (dst_bit))
 
+#define PPC_BITLSHIFT32(be)	(32 - 1 - (be))
+#define PPC_BIT32(bit)		(1UL << PPC_BITLSHIFT32(bit))
+#define PPC_BITMASK32(bs, be)	((PPC_BIT32(bs) - PPC_BIT32(be))|PPC_BIT32(bs))
+
+#define PPC_BITLSHIFT8(be)	(8 - 1 - (be))
+#define PPC_BIT8(bit)		(1UL << PPC_BITLSHIFT8(bit))
+#define PPC_BITMASK8(bs, be)	((PPC_BIT8(bs) - PPC_BIT8(be))|PPC_BIT8(bs))
+
 #include <asm/barrier.h>
 
 /* Macro for generating the ***_bits() functions */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-04-12 11:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-05  7:54 [PATCH v2 01/10] powerpc: Add more PPC bit conversion macros Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 02/10] powerpc: Add optional smp_ops->prepare_cpu SMP callback Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 03/10] powerpc/smp: Remove migrate_irq() custom implementation Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 04/10] powerpc/xive: Native exploitation of the XIVE interrupt controller Benjamin Herrenschmidt
2017-04-05 22:46   ` kbuild test robot
2017-04-05 23:00     ` Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 05/10] powerpc/kvm: Massage order of #include Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 06/10] powerpc/kvm: Make kvmppc_xics_create_icp static Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 07/10] powerpc/kvm: Remove obsolete kvm_vm_ioctl_xics_irq declaration Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 08/10] powerpc: Consolidate variants of real-mode MMIOs Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 09/10] powerpc: Fixup LPCR:PECE and HEIC setting on POWER9 Benjamin Herrenschmidt
2017-04-05  7:54 ` [PATCH v2 10/10] powerpc/kvm: Native usage of the XIVE interrupt controller Benjamin Herrenschmidt
2017-04-06  0:00   ` kbuild test robot
2017-04-12 11:40 ` [v2,01/10] powerpc: Add more PPC bit conversion macros Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).