ssfn: try making normal renderer work (i hope google won't dmca this for adding noto inside lol)
This commit is contained in:
parent
a6f371b4ad
commit
442b26df09
13 changed files with 11150 additions and 261 deletions
18
kernel/src/lib/spinlock.h
Normal file
18
kernel/src/lib/spinlock.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct spinlock
|
||||
{
|
||||
volatile int locked;
|
||||
} spinlock_t;
|
||||
|
||||
inline void spinlock_acquire(spinlock_t *lock) {
|
||||
while (__sync_lock_test_and_set(&(lock)->locked, 1))
|
||||
while ((lock)->locked)
|
||||
__asm__ volatile("pause");
|
||||
}
|
||||
|
||||
inline void spinlock_release(spinlock_t *lock) {
|
||||
__sync_lock_release(&(lock)->locked);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue