/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_MICROBLAZE_CMPXCHG_H #define _ASM_MICROBLAZE_CMPXCHG_H #include <linux/irqflags.h> void __bad_xchg(volatile void *ptr, int size);
static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) { unsigned long ret; unsigned long flags; switch (size) { case 1: local_irq_save(flags); ret = *(volatile unsigned char *)ptr; *(volatile unsigned char *)ptr = x; local_irq_restore(flags); break; case 4: local_irq_save(flags); ret = *(volatile unsigned long *)ptr; *(volatile unsigned long *)ptr = x; local_irq_restore(flags); break; default: __bad_xchg(ptr, size), ret = 0; break; } return ret; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 122 | 100.00% | 1 | 100.00% |
Total | 122 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 159 | 97.55% | 1 | 33.33% |
Michal Simek | 3 | 1.84% | 1 | 33.33% |
Greg Kroah-Hartman | 1 | 0.61% | 1 | 33.33% |
Total | 163 | 100.00% | 3 | 100.00% |