Kernel: Implement basic SpinLock
This commit is contained in:
19
kernel/kernel/SpinLock.cpp
Normal file
19
kernel/kernel/SpinLock.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <kernel/SpinLock.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
extern "C" void spinlock_lock_asm(int*);
|
||||
extern "C" void spinlock_unlock_asm(int*);
|
||||
|
||||
void SpinLock::lock()
|
||||
{
|
||||
spinlock_lock_asm(&m_lock);
|
||||
}
|
||||
|
||||
void SpinLock::unlock()
|
||||
{
|
||||
spinlock_unlock_asm(&m_lock);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user