~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/alpha/include/asm/word-at-a-time.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_WORD_AT_A_TIME_H
  3 #define _ASM_WORD_AT_A_TIME_H
  4 
  5 #include <asm/compiler.h>
  6 
  7 /*
  8  * word-at-a-time interface for Alpha.
  9  */
 10 
 11 /*
 12  * We do not use the word_at_a_time struct on Alpha, but it needs to be
 13  * implemented to humour the generic code.
 14  */
 15 struct word_at_a_time {
 16         const unsigned long unused;
 17 };
 18 
 19 #define WORD_AT_A_TIME_CONSTANTS { 0 }
 20 
 21 /* Return nonzero if val has a zero */
 22 static inline unsigned long has_zero(unsigned long val, unsigned long *bits, const struct word_at_a_time *c)
 23 {
 24         unsigned long zero_locations = __kernel_cmpbge(0, val);
 25         *bits = zero_locations;
 26         return zero_locations;
 27 }
 28 
 29 static inline unsigned long prep_zero_mask(unsigned long val, unsigned long bits, const struct word_at_a_time *c)
 30 {
 31         return bits;
 32 }
 33 
 34 #define create_zero_mask(bits) (bits)
 35 
 36 static inline unsigned long find_zero(unsigned long bits)
 37 {
 38 #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
 39         /* Simple if have CIX instructions */
 40         return __kernel_cttz(bits);
 41 #else
 42         unsigned long t1, t2, t3;
 43         /* Retain lowest set bit only */
 44         bits &= -bits;
 45         /* Binary search for lowest set bit */
 46         t1 = bits & 0xf0;
 47         t2 = bits & 0xcc;
 48         t3 = bits & 0xaa;
 49         if (t1) t1 = 4;
 50         if (t2) t2 = 2;
 51         if (t3) t3 = 1;
 52         return t1 + t2 + t3;
 53 #endif
 54 }
 55 
 56 #define zero_bytemask(mask) ((2ul << (find_zero(mask) * 8)) - 1)
 57 
 58 #endif /* _ASM_WORD_AT_A_TIME_H */
 59 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php