Lines Matching refs:hwspinlock

14 A generic hwspinlock framework allows platform-independent drivers to use
15 the hwspinlock device in order to access data structures that are shared
28 the remote processors, and access to it is synchronized using the hwspinlock
32 A common hwspinlock interface makes it possible to have generic, platform-
37 struct hwspinlock *hwspin_lock_request(void);
38 - dynamically assign an hwspinlock and return its address, or NULL
39 in case an unused hwspinlock isn't available. Users of this
44 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
45 - assign a specific hwspinlock id and return its address, or NULL
46 if that hwspinlock is already in use. Usually board code will
47 be calling this function in order to reserve specific hwspinlock
51 int hwspin_lock_free(struct hwspinlock *hwlock);
52 - free a previously-assigned hwspinlock; returns 0 on success, or an
53 appropriate error code on failure (e.g. -EINVAL if the hwspinlock
57 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);
58 - lock a previously-assigned hwspinlock with a timeout limit (specified in
59 msecs). If the hwspinlock is already taken, the function will busy loop
62 the caller must not sleep, and is advised to release the hwspinlock as
66 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
69 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);
70 - lock a previously-assigned hwspinlock with a timeout limit (specified in
71 msecs). If the hwspinlock is already taken, the function will busy loop
75 release the hwspinlock as soon as possible.
77 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
80 int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to,
82 - lock a previously-assigned hwspinlock with a timeout limit (specified in
83 msecs). If the hwspinlock is already taken, the function will busy loop
88 release the hwspinlock as soon as possible.
90 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
93 int hwspin_trylock(struct hwspinlock *hwlock);
94 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
97 caller must not sleep, and is advised to release the hwspinlock as soon as
101 notably -EBUSY if the hwspinlock was already taken).
104 int hwspin_trylock_irq(struct hwspinlock *hwlock);
105 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
109 release the hwspinlock as soon as possible.
111 notably -EBUSY if the hwspinlock was already taken).
114 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);
115 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
120 to release the hwspinlock as soon as possible.
122 notably -EBUSY if the hwspinlock was already taken).
125 void hwspin_unlock(struct hwspinlock *hwlock);
126 - unlock a previously-locked hwspinlock. Always succeed, and can be called
128 unlock an hwspinlock which is already unlocked (there is no protection
131 void hwspin_unlock_irq(struct hwspinlock *hwlock);
132 - unlock a previously-locked hwspinlock and enable local interrupts.
133 The caller should _never_ unlock an hwspinlock which is already unlocked.
139 hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);
140 - unlock a previously-locked hwspinlock.
141 The caller should _never_ unlock an hwspinlock which is already unlocked.
147 int hwspin_lock_get_id(struct hwspinlock *hwlock);
148 - retrieve id number of a given hwspinlock. This is needed when an
149 hwspinlock is dynamically assigned: before it can be used to achieve
152 Returns the hwspinlock id number, or -EINVAL if hwlock is null.
156 #include <linux/hwspinlock.h>
161 struct hwspinlock *hwlock;
164 /* dynamically assign a hwspinlock */
194 struct hwspinlock *hwlock;
198 * assign a specific hwspinlock id - this should be called early
233 order to register a new hwspinlock device (which is usually a bank of
240 to unregister an hwspinlock device (which is usually a bank of numerous
243 Returns the address of hwspinlock on success, or NULL on error (e.g.
244 if the hwspinlock is still in use).
249 of hardware locks. It is registered by the underlying hwspinlock
255 * @ops: platform-specific hwspinlock handlers
258 * @lock: dynamically allocated array of 'struct hwspinlock'
265 struct hwspinlock lock[0];
268 struct hwspinlock_device contains an array of hwspinlock structs, each
272 * struct hwspinlock - this struct represents a single hwspinlock instance
274 * @lock: initialized and used by hwspinlock core
275 * @priv: private data, owned by the underlying platform-specific hwspinlock drv
277 struct hwspinlock {
283 When registering a bank of locks, the hwspinlock driver only needs to
285 initialized by the hwspinlock core itself.
292 int (*trylock)(struct hwspinlock *lock);
293 void (*unlock)(struct hwspinlock *lock);
294 void (*relax)(struct hwspinlock *lock);
305 The ->relax() callback is optional. It is called by hwspinlock core while