cregit-Linux how code gets into the kernel

Release 4.14 arch/parisc/lib/bitops.c

Directory: arch/parisc/lib
// SPDX-License-Identifier: GPL-2.0
/*
 * bitops.c: atomic operations which got too long to be inlined all over
 *      the place.
 * 
 * Copyright 1999 Philipp Rumpf (prumpf@tux.org)
 * Copyright 2000 Grant Grundler (grundler@cup.hp.com)
 */

#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/atomic.h>

#ifdef CONFIG_SMP

arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
	[0 ... (ATOMIC_HASH_SIZE-1)]  = __ARCH_SPIN_LOCK_UNLOCKED
};
#endif

#ifdef CONFIG_64BIT

unsigned long __xchg64(unsigned long x, unsigned long *ptr) { unsigned long temp, flags; _atomic_spin_lock_irqsave(ptr, flags); temp = *ptr; *ptr = x; _atomic_spin_unlock_irqrestore(ptr, flags); return temp; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)4287.50%133.33%
Matthew Wilcox612.50%266.67%
Total48100.00%3100.00%

#endif
unsigned long __xchg32(int x, int *ptr) { unsigned long flags; long temp; _atomic_spin_lock_irqsave(ptr, flags); temp = (long) *ptr; /* XXX - sign extension wanted? */ *ptr = x; _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)temp; }

Contributors

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)3665.45%125.00%
Matthew Wilcox1934.55%375.00%
Total55100.00%4100.00%


unsigned long __xchg8(char x, char *ptr) { unsigned long flags; long temp; _atomic_spin_lock_irqsave(ptr, flags); temp = (long) *ptr; /* XXX - sign extension wanted? */ *ptr = x; _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)temp; }

Contributors

PersonTokensPropCommitsCommitProp
Matthew Wilcox3054.55%375.00%
Linus Torvalds (pre-git)2545.45%125.00%
Total55100.00%4100.00%


u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new) { unsigned long flags; u64 prev; _atomic_spin_lock_irqsave(ptr, flags); if ((prev = *ptr) == old) *ptr = new; _atomic_spin_unlock_irqrestore(ptr, flags); return prev; }

Contributors

PersonTokensPropCommitsCommitProp
Matthew Wilcox4885.71%250.00%
Helge Deller58.93%125.00%
Linus Torvalds (pre-git)35.36%125.00%
Total56100.00%4100.00%


unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsigned int new) { unsigned long flags; unsigned int prev; _atomic_spin_lock_irqsave(ptr, flags); if ((prev = *ptr) == old) *ptr = new; _atomic_spin_unlock_irqrestore(ptr, flags); return (unsigned long)prev; }

Contributors

PersonTokensPropCommitsCommitProp
Matthew Wilcox65100.00%2100.00%
Total65100.00%2100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Matthew Wilcox17454.21%436.36%
Linus Torvalds (pre-git)13742.68%19.09%
Helge Deller61.87%218.18%
Thomas Gleixner20.62%218.18%
Greg Kroah-Hartman10.31%19.09%
Arun Sharma10.31%19.09%
Total321100.00%11100.00%
Directory: arch/parisc/lib
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.