diff options
| author | Miguel <m.i@gmx.at> | 2018-09-06 01:58:10 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-06 01:58:10 +0200 |
| commit | ef4943053475cd8bf341c42dd0b538bc630b92a3 (patch) | |
| tree | b7f59c937797a0ce0603af9ef46a194d4a64ef22 /kernel/spinlock.c | |
| parent | f67ad595650954195ef064a8b91038dbd0e16842 (diff) | |
working on smp
Diffstat (limited to 'kernel/spinlock.c')
| -rw-r--r-- | kernel/spinlock.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 03efa6e..b7ff6b7 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c @@ -1,26 +1,17 @@ #include "spinlock.h" - #include "kernel.h" #include "asm_x86.h" - static volatile uint32_t spinlocks[NUMBER_SPINLOCKS]; -void check_spinlocks() -{ - klog("Spinlocks at 0x%08X ",spinlocks); - for(int i=0;i<NUMBER_SPINLOCKS;i++) - klog("%d",spinlocks[i]); -} - -void lock_spin(uint32_t i) +void spinlock_spin(uint32_t i) { uint32_t *addr=spinlocks+i; while(x86_xchg(addr,1)); } -void lock_release(uint32_t i) +void spinlock_release(uint32_t i) { uint32_t *addr=spinlocks+i; asm("movb $0,%0"::"m"(*addr)); |
