kernel: add support for basic type spinlock_t
A spinlock is the most basic type of lock. It will attempt to acquire, and upon failure, will continue attempting indefinitely until it is successful.
This commit is contained in:
parent
95ce2af5c6
commit
8e6d0d4fbc
3 changed files with 42 additions and 0 deletions
11
include/kernel/lock.h
Normal file
11
include/kernel/lock.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _LOCK_H_
|
||||
#define _LOCK_H_
|
||||
|
||||
typedef int spinlock_t;
|
||||
|
||||
int atomic_cmpxchg(volatile int *ptr, int cmpval, int newval);
|
||||
void spinlock_acquire(spinlock_t *lock);
|
||||
void spinlock_release(spinlock_t *lock);
|
||||
|
||||
#endif /* _LOCK_H_ */
|
||||
Loading…
Reference in a new issue