cregit-Linux how code gets into the kernel

Release 4.14 arch/score/include/asm/cmpxchg.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_SCORE_CMPXCHG_H

#define _ASM_SCORE_CMPXCHG_H

#include <linux/irqflags.h>



struct __xchg_dummy { unsigned long a[100]; };

#define __xg(x) ((struct __xchg_dummy *)(x))


static inline unsigned long __xchg(volatile unsigned long *m, unsigned long val) { unsigned long retval; unsigned long flags; local_irq_save(flags); retval = *m; *m = val; local_irq_restore(flags); return retval; }

Contributors

PersonTokensPropCommitsCommitProp
David Howells49100.00%1100.00%
Total49100.00%1100.00%

#define xchg(ptr, v) \ ((__typeof__(*(ptr))) __xchg((unsigned long *)(ptr), \ (unsigned long)(v)))
static inline unsigned long __cmpxchg(volatile unsigned long *m, unsigned long old, unsigned long new) { unsigned long retval; unsigned long flags; local_irq_save(flags); retval = *m; if (retval == old) *m = new; local_irq_restore(flags); return retval; }

Contributors

PersonTokensPropCommitsCommitProp
David Howells59100.00%1100.00%
Total59100.00%1100.00%

#define cmpxchg(ptr, o, n) \ ((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \ (unsigned long)(o), \ (unsigned long)(n))) #include <asm-generic/cmpxchg-local.h> #endif /* _ASM_SCORE_CMPXCHG_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
David Howells16499.39%150.00%
Greg Kroah-Hartman10.61%150.00%
Total165100.00%2100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.