Release 4.14 arch/mips/lib/bitops.c
/*
* 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)
{
unsigned long *a = (unsigned long *)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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 64 | 92.75% | 1 | 50.00% |
David Daney | 5 | 7.25% | 1 | 50.00% |
Total | 69 | 100.00% | 2 | 100.00% |
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)
{
unsigned long *a = (unsigned long *)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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 65 | 92.86% | 1 | 50.00% |
David Daney | 5 | 7.14% | 1 | 50.00% |
Total | 70 | 100.00% | 2 | 100.00% |
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)
{
unsigned long *a = (unsigned long *)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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 64 | 92.75% | 1 | 50.00% |
David Daney | 5 | 7.25% | 1 | 50.00% |
Total | 69 | 100.00% | 2 | 100.00% |
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)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
int res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
raw_local_irq_save(flags);
res = (mask & *a) != 0;
*a |= mask;
raw_local_irq_restore(flags);
return res;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 78 | 90.70% | 1 | 33.33% |
David Daney | 8 | 9.30% | 2 | 66.67% |
Total | 86 | 100.00% | 3 | 100.00% |
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)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
int res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
raw_local_irq_save(flags);
res = (mask & *a) != 0;
*a |= mask;
raw_local_irq_restore(flags);
return res;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 78 | 90.70% | 1 | 33.33% |
David Daney | 8 | 9.30% | 2 | 66.67% |
Total | 86 | 100.00% | 3 | 100.00% |
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)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
int res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
raw_local_irq_save(flags);
res = (mask & *a) != 0;
*a &= ~mask;
raw_local_irq_restore(flags);
return res;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 79 | 90.80% | 1 | 33.33% |
David Daney | 8 | 9.20% | 2 | 66.67% |
Total | 87 | 100.00% | 3 | 100.00% |
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)
{
unsigned long *a = (unsigned long *)addr;
unsigned bit = nr & SZLONG_MASK;
unsigned long mask;
unsigned long flags;
int res;
a += nr >> SZLONG_LOG;
mask = 1UL << bit;
raw_local_irq_save(flags);
res = (mask & *a) != 0;
*a ^= mask;
raw_local_irq_restore(flags);
return res;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 78 | 90.70% | 1 | 33.33% |
David Daney | 8 | 9.30% | 2 | 66.67% |
Total | 86 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(__mips_test_and_change_bit);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jim Quinlan | 556 | 91.90% | 1 | 25.00% |
David Daney | 47 | 7.77% | 2 | 50.00% |
Ralf Bächle | 2 | 0.33% | 1 | 25.00% |
Total | 605 | 100.00% | 4 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.