lock: merge spinlock and mtx locks into one

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-13 14:19:10 -04:00
commit 2076f1dae1
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
32 changed files with 158 additions and 169 deletions

19
include/kernel/lock.h Normal file
View file

@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _LOCK_H_
#define _LOCK_H_
#include <kernel/types.h>
#include <kernel/common.h>
#define CLEANUP_SLOCK CLEANUP(cleanup_spinlock)
typedef u32 lock_t;
void spin_lock(lock_t *lock);
void spin_unlock(lock_t *lock);
void cleanup_spinlock(lock_t **lock_ptr);
void mtx_lock(lock_t *l);
void mtx_unlock(lock_t *l);
#endif /* _LOCK_H_ */