-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 308487 b: refs/heads/master c: 1629372 h: refs/heads/master i: 308485: e7f7881 308483: f2267b3 308479: 32fd14a v: v3
- Loading branch information
Paul Mackerras
authored and
Linus Torvalds
committed
May 28, 2012
1 parent
217f0d8
commit c1aff9e
Showing
6 changed files
with
49 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 69ea6405980f217557b6a58f70ff60d8d88519a5 | ||
refs/heads/master: 1629372caaaf7ef744d3b983be56b99468a68ff8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef _ASM_WORD_AT_A_TIME_H | ||
#define _ASM_WORD_AT_A_TIME_H | ||
|
||
/* | ||
* Word-at-a-time interfaces for PowerPC. | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <asm/asm-compat.h> | ||
|
||
struct word_at_a_time { | ||
const unsigned long high_bits, low_bits; | ||
}; | ||
|
||
#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0xfe) + 1, REPEAT_BYTE(0x7f) } | ||
|
||
/* Bit set in the bytes that have a zero */ | ||
static inline long prep_zero_mask(unsigned long val, unsigned long rhs, const struct word_at_a_time *c) | ||
{ | ||
unsigned long mask = (val & c->low_bits) + c->low_bits; | ||
return ~(mask | rhs); | ||
} | ||
|
||
#define create_zero_mask(mask) (mask) | ||
|
||
static inline long find_zero(unsigned long mask) | ||
{ | ||
long leading_zero_bits; | ||
|
||
asm (PPC_CNTLZL "%0,%1" : "=r" (leading_zero_bits) : "r" (mask)); | ||
return leading_zero_bits >> 3; | ||
} | ||
|
||
static inline bool has_zero(unsigned long val, unsigned long *data, const struct word_at_a_time *c) | ||
{ | ||
unsigned long rhs = val | c->low_bits; | ||
*data = rhs; | ||
return (val + c->high_bits) & ~rhs; | ||
} | ||
|
||
#endif /* _ASM_WORD_AT_A_TIME_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters