__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Atomic operations for the Hexagon architecture
*
* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*/
#ifndef _ASM_ATOMIC_H
#define _ASM_ATOMIC_H
#include <linux/types.h>
#include <asm/cmpxchg.h>
#include <asm/barrier.h>
/* Normal writes in our arch don't clear lock reservations */
static inline void arch_atomic_set(atomic_t *v, int new)
{
asm volatile(
"1: r6 = memw_locked(%0);\n"
" memw_locked(%0,p0) = %1;\n"
" if (!P0) jump 1b;\n"
:
: "r" (&v->counter), "r" (new)
: "memory", "p0", "r6"
);
}
#define arch_atomic_set_release(v, i) arch_atomic_set((v), (i))
#define arch_atomic_read(v) READ_ONCE((v)->counter)
#define ATOMIC_OP(op) \
static inline void arch_atomic_##op(int i, atomic_t *v) \
{ \
int output; \
\
__asm__ __volatile__ ( \
"1: %0 = memw_locked(%1);\n" \
" %0 = "#op "(%0,%2);\n" \
" memw_locked(%1,P3)=%0;\n" \
" if (!P3) jump 1b;\n" \
: "=&r" (output) \
: "r" (&v->counter), "r" (i) \
: "memory", "p3" \
); \
} \
#define ATOMIC_OP_RETURN(op) \
static inline int arch_atomic_##op##_return(int i, atomic_t *v) \
{ \
int output; \
\
__asm__ __volatile__ ( \
"1: %0 = memw_locked(%1);\n" \
" %0 = "#op "(%0,%2);\n" \
" memw_locked(%1,P3)=%0;\n" \
" if (!P3) jump 1b;\n" \
: "=&r" (output) \
: "r" (&v->counter), "r" (i) \
: "memory", "p3" \
); \
return output; \
}
#define ATOMIC_FETCH_OP(op) \
static inline int arch_atomic_fetch_##op(int i, atomic_t *v) \
{ \
int output, val; \
\
__asm__ __volatile__ ( \
"1: %0 = memw_locked(%2);\n" \
" %1 = "#op "(%0,%3);\n" \
" memw_locked(%2,P3)=%1;\n" \
" if (!P3) jump 1b;\n" \
: "=&r" (output), "=&r" (val) \
: "r" (&v->counter), "r" (i) \
: "memory", "p3" \
); \
return output; \
}
#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
ATOMIC_OPS(add)
ATOMIC_OPS(sub)
#define arch_atomic_add_return arch_atomic_add_return
#define arch_atomic_sub_return arch_atomic_sub_return
#define arch_atomic_fetch_add arch_atomic_fetch_add
#define arch_atomic_fetch_sub arch_atomic_fetch_sub
#undef ATOMIC_OPS
#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
ATOMIC_OPS(and)
ATOMIC_OPS(or)
ATOMIC_OPS(xor)
#define arch_atomic_fetch_and arch_atomic_fetch_and
#define arch_atomic_fetch_or arch_atomic_fetch_or
#define arch_atomic_fetch_xor arch_atomic_fetch_xor
#undef ATOMIC_OPS
#undef ATOMIC_FETCH_OP
#undef ATOMIC_OP_RETURN
#undef ATOMIC_OP
static inline int arch_atomic_fetch_add_unless(atomic_t *v, int a, int u)
{
int __oldval;
register int tmp;
asm volatile(
"1: %0 = memw_locked(%2);"
" {"
" p3 = cmp.eq(%0, %4);"
" if (p3.new) jump:nt 2f;"
" %1 = add(%0, %3);"
" }"
" memw_locked(%2, p3) = %1;"
" {"
" if (!p3) jump 1b;"
" }"
"2:"
: "=&r" (__oldval), "=&r" (tmp)
: "r" (v), "r" (a), "r" (u)
: "memory", "p3"
);
return __oldval;
}
#define arch_atomic_fetch_add_unless arch_atomic_fetch_add_unless
#endif
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Kbuild | File | 193 B | 0644 |
|
| asm-offsets.h | File | 35 B | 0644 |
|
| atomic.h | File | 3.13 KB | 0644 |
|
| bitops.h | File | 6.46 KB | 0644 |
|
| cache.h | File | 555 B | 0644 |
|
| cacheflush.h | File | 2.8 KB | 0644 |
|
| checksum.h | File | 685 B | 0644 |
|
| cmpxchg.h | File | 1.97 KB | 0644 |
|
| delay.h | File | 344 B | 0644 |
|
| dma.h | File | 300 B | 0644 |
|
| elf.h | File | 5.62 KB | 0644 |
|
| exec.h | File | 398 B | 0644 |
|
| fixmap.h | File | 369 B | 0644 |
|
| fpu.h | File | 90 B | 0644 |
|
| futex.h | File | 2.25 KB | 0644 |
|
| hexagon_vm.h | File | 5.77 KB | 0644 |
|
| intrinsics.h | File | 369 B | 0644 |
|
| io.h | File | 2.54 KB | 0644 |
|
| irq.h | File | 576 B | 0644 |
|
| irqflags.h | File | 860 B | 0644 |
|
| kgdb.h | File | 754 B | 0644 |
|
| linkage.h | File | 237 B | 0644 |
|
| mem-layout.h | File | 2.8 KB | 0644 |
|
| mmu.h | File | 490 B | 0644 |
|
| mmu_context.h | File | 1.51 KB | 0644 |
|
| page.h | File | 3.58 KB | 0644 |
|
| perf_event.h | File | 207 B | 0644 |
|
| pgalloc.h | File | 2.64 KB | 0644 |
|
| pgtable.h | File | 10.99 KB | 0644 |
|
| processor.h | File | 2.94 KB | 0644 |
|
| ptrace.h | File | 626 B | 0644 |
|
| setup.h | File | 527 B | 0644 |
|
| smp.h | File | 707 B | 0644 |
|
| spinlock.h | File | 3.22 KB | 0644 |
|
| spinlock_types.h | File | 551 B | 0644 |
|
| string.h | File | 472 B | 0644 |
|
| suspend.h | File | 238 B | 0644 |
|
| switch_to.h | File | 478 B | 0644 |
|
| syscall.h | File | 1.14 KB | 0644 |
|
| syscalls.h | File | 204 B | 0644 |
|
| thread_info.h | File | 3.27 KB | 0644 |
|
| time.h | File | 346 B | 0644 |
|
| timex.h | File | 495 B | 0644 |
|
| tlb.h | File | 253 B | 0644 |
|
| tlbflush.h | File | 1.46 KB | 0644 |
|
| traps.h | File | 410 B | 0644 |
|
| uaccess.h | File | 1.1 KB | 0644 |
|
| unistd.h | File | 244 B | 0644 |
|
| vdso.h | File | 307 B | 0644 |
|
| vermagic.h | File | 299 B | 0644 |
|
| vm_fault.h | File | 359 B | 0644 |
|
| vm_mmu.h | File | 2.75 KB | 0644 |
|
| vmalloc.h | File | 99 B | 0644 |
|