kv2: initialize memory manager, early pci devices
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
e5b55a6ba5
commit
a252a3f8e9
58 changed files with 1270 additions and 505 deletions
19
include/lib/rwlock.h
Normal file
19
include/lib/rwlock.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _RWLOCK_H_
|
||||
#define _RWLOCK_H_
|
||||
|
||||
#include <lib/sem.h>
|
||||
|
||||
typedef struct _rwlock {
|
||||
sem_t sem;
|
||||
spinlock_t reader_lock;
|
||||
u64 reader_count;
|
||||
} rwlock_t;
|
||||
|
||||
void read_lock(rwlock_t *lock);
|
||||
void read_unlock(rwlock_t *lock);
|
||||
void write_lock(rwlock_t *lock);
|
||||
void write_unlock(rwlock_t *lock);
|
||||
void rwlock_init(rwlock_t *lock);
|
||||
|
||||
#endif /* _RWLOCK_H_ */
|
||||
Loading…
Reference in a new issue