-
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: 335623 b: refs/heads/master c: 92d1159 h: refs/heads/master i: 335621: fc212b2 335619: 1ad99df 335615: fc0bd36 v: v3
- Loading branch information
Jim Quinlan
authored and
Ralf Baechle
committed
Nov 9, 2012
1 parent
289fa42
commit a4830b5
Showing
6 changed files
with
215 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: 9de79c500600c5868e83712a2ea5b0b48f83af24 | ||
refs/heads/master: 92d11594f688c8b55b51e80f2eac4417396237a4 |
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
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,179 @@ | ||
/* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
* | ||
* Copyright (c) 1994-1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org) | ||
* Copyright (c) 1999, 2000 Silicon Graphics, Inc. | ||
*/ | ||
#include <linux/bitops.h> | ||
#include <linux/irqflags.h> | ||
#include <linux/export.h> | ||
|
||
|
||
/** | ||
* __mips_set_bit - Atomically set a bit in memory. This is called by | ||
* set_bit() if it cannot find a faster solution. | ||
* @nr: the bit to set | ||
* @addr: the address to start counting from | ||
*/ | ||
void __mips_set_bit(unsigned long nr, volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
*a |= mask; | ||
raw_local_irq_restore(flags); | ||
} | ||
EXPORT_SYMBOL(__mips_set_bit); | ||
|
||
|
||
/** | ||
* __mips_clear_bit - Clears a bit in memory. This is called by clear_bit() if | ||
* it cannot find a faster solution. | ||
* @nr: Bit to clear | ||
* @addr: Address to start counting from | ||
*/ | ||
void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
*a &= ~mask; | ||
raw_local_irq_restore(flags); | ||
} | ||
EXPORT_SYMBOL(__mips_clear_bit); | ||
|
||
|
||
/** | ||
* __mips_change_bit - Toggle a bit in memory. This is called by change_bit() | ||
* if it cannot find a faster solution. | ||
* @nr: Bit to change | ||
* @addr: Address to start counting from | ||
*/ | ||
void __mips_change_bit(unsigned long nr, volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
*a ^= mask; | ||
raw_local_irq_restore(flags); | ||
} | ||
EXPORT_SYMBOL(__mips_change_bit); | ||
|
||
|
||
/** | ||
* __mips_test_and_set_bit - Set a bit and return its old value. This is | ||
* called by test_and_set_bit() if it cannot find a faster solution. | ||
* @nr: Bit to set | ||
* @addr: Address to count from | ||
*/ | ||
int __mips_test_and_set_bit(unsigned long nr, | ||
volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
unsigned long res; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
res = (mask & *a); | ||
*a |= mask; | ||
raw_local_irq_restore(flags); | ||
return res; | ||
} | ||
EXPORT_SYMBOL(__mips_test_and_set_bit); | ||
|
||
|
||
/** | ||
* __mips_test_and_set_bit_lock - Set a bit and return its old value. This is | ||
* called by test_and_set_bit_lock() if it cannot find a faster solution. | ||
* @nr: Bit to set | ||
* @addr: Address to count from | ||
*/ | ||
int __mips_test_and_set_bit_lock(unsigned long nr, | ||
volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
unsigned long res; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
res = (mask & *a); | ||
*a |= mask; | ||
raw_local_irq_restore(flags); | ||
return res; | ||
} | ||
EXPORT_SYMBOL(__mips_test_and_set_bit_lock); | ||
|
||
|
||
/** | ||
* __mips_test_and_clear_bit - Clear a bit and return its old value. This is | ||
* called by test_and_clear_bit() if it cannot find a faster solution. | ||
* @nr: Bit to clear | ||
* @addr: Address to count from | ||
*/ | ||
int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
unsigned long res; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
res = (mask & *a); | ||
*a &= ~mask; | ||
raw_local_irq_restore(flags); | ||
return res; | ||
} | ||
EXPORT_SYMBOL(__mips_test_and_clear_bit); | ||
|
||
|
||
/** | ||
* __mips_test_and_change_bit - Change a bit and return its old value. This is | ||
* called by test_and_change_bit() if it cannot find a faster solution. | ||
* @nr: Bit to change | ||
* @addr: Address to count from | ||
*/ | ||
int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr) | ||
{ | ||
volatile unsigned long *a = addr; | ||
unsigned bit = nr & SZLONG_MASK; | ||
unsigned long mask; | ||
unsigned long flags; | ||
unsigned long res; | ||
|
||
a += nr >> SZLONG_LOG; | ||
mask = 1UL << bit; | ||
raw_local_irq_save(flags); | ||
res = (mask & *a); | ||
*a ^= mask; | ||
raw_local_irq_restore(flags); | ||
return res; | ||
} | ||
EXPORT_SYMBOL(__mips_test_and_change_bit); |