atomic: move atomic out of spinlock file
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
5c55192c76
commit
86164688a5
3 changed files with 12 additions and 3 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <kernel/types.h>
|
#include <kernel/types.h>
|
||||||
|
|
||||||
typedef u64 spinlock_t;
|
typedef u32 spinlock_t;
|
||||||
|
|
||||||
void spinlock_acquire(spinlock_t *lock);
|
void spinlock_acquire(spinlock_t *lock);
|
||||||
void spinlock_release(spinlock_t *lock);
|
void spinlock_release(spinlock_t *lock);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
#include <kernel/common.h>
|
#include <kernel/common.h>
|
||||||
#include <kernel/spinlock.h>
|
#include <kernel/spinlock.h>
|
||||||
|
#include <kernel/atomic.h>
|
||||||
int atomic_cmpxchg(spinlock_t *lock, int a, int b);
|
|
||||||
|
|
||||||
static uint64_t spinlock_attempt_acquire(spinlock_t *lock)
|
static uint64_t spinlock_attempt_acquire(spinlock_t *lock)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
10
include/kernel/atomic.h
Normal file
10
include/kernel/atomic.h
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
#ifndef _ATOMIC_H_
|
||||||
|
#define _ATOMIC_H_
|
||||||
|
|
||||||
|
#include <kernel/types.h>
|
||||||
|
|
||||||
|
int atomic_cmpxchg(u32 *ptr, int a, int b);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _ATOMIC_H_ */
|
||||||
Loading…
Reference in a new issue