x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub
[linux/fpc-iii.git] / arch / powerpc / include / asm / word-at-a-time.h
blobd0b6d4ac6dda58c99d7fc6c884f0bbc11d4561e0
1 #ifndef _ASM_WORD_AT_A_TIME_H
2 #define _ASM_WORD_AT_A_TIME_H
4 /*
5 * Word-at-a-time interfaces for PowerPC.
6 */
8 #include <linux/kernel.h>
9 #include <asm/asm-compat.h>
11 struct word_at_a_time {
12 const unsigned long high_bits, low_bits;
15 #define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0xfe) + 1, REPEAT_BYTE(0x7f) }
17 /* Bit set in the bytes that have a zero */
18 static inline long prep_zero_mask(unsigned long val, unsigned long rhs, const struct word_at_a_time *c)
20 unsigned long mask = (val & c->low_bits) + c->low_bits;
21 return ~(mask | rhs);
24 #define create_zero_mask(mask) (mask)
26 static inline long find_zero(unsigned long mask)
28 long leading_zero_bits;
30 asm (PPC_CNTLZL "%0,%1" : "=r" (leading_zero_bits) : "r" (mask));
31 return leading_zero_bits >> 3;
34 static inline bool has_zero(unsigned long val, unsigned long *data, const struct word_at_a_time *c)
36 unsigned long rhs = val | c->low_bits;
37 *data = rhs;
38 return (val + c->high_bits) & ~rhs;
41 #endif /* _ASM_WORD_AT_A_TIME_H */