0x07FC
0x07FC

Reputation: 523

How the function do_raw_spin_lock is implemented in linux

While debugging panic issue realted to spinlock, I came across this definition of spinlock in

include/linux/spinlock.h

. It is rather hard for me to understand this definition. Why is __acquires(lock) used after the do_raw_spin_lock function? What is the signification of such declaration?

static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock)
{
        __acquire(lock);
        arch_spin_lock(&lock->raw_lock);
}

Please help me how such declaration are decoded and work.

Upvotes: 1

Views: 703

Answers (1)

Adrian Panasiuk
Adrian Panasiuk

Reputation: 7343

It is used for static analysis.

http://en.wikipedia.org/wiki/Sparse

Upvotes: 1

Related Questions