summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-08-19 21:51:06 +0200
committerMiguel <m.i@gmx.at>2018-08-19 21:51:06 +0200
commitfa22576a525135895d16deb3fc6def685a7baf8a (patch)
tree69654ea4f27ce2bda4461e9bc037482def3ef901
parent7dbbfea6ad0a458e1b1e2685a5dc947e0c43fdbf (diff)
invalidated spinlocks
-rw-r--r--asm/x86.s14
-rw-r--r--kernel/smp.c4
-rw-r--r--kernel/spinlock.c4
3 files changed, 4 insertions, 18 deletions
diff --git a/asm/x86.s b/asm/x86.s
index 9794111..3243352 100644
--- a/asm/x86.s
+++ b/asm/x86.s
@@ -65,19 +65,6 @@ x86_sti:
sti
ret
-x86_xchg:
-// -- uint8_t result;
-// --
-// -- // The + in "+m" denotes a read-modify-write operand.
-// -- asm volatile("lock xchgb %0, %1" :
-// -- "+m" (*addr), "=a" (result) :
-// -- "1" (val) :
-// -- "cc");
-// --
-// -- return result;
-// -- }
- ret
-
x86_get_cr:
mov 4(%esp), %ecx
cmp $0,%ecx
@@ -134,4 +121,3 @@ set_cr3:
set_cr4:
mov %eax,%cr4
ret
-
diff --git a/kernel/smp.c b/kernel/smp.c
index a562df3..b2697fc 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -66,9 +66,9 @@ void kernel_ap()
{
cpu_counter[p]++;
- lock_spin(0);
+ //lock_spin(0);
if(cpu_counter[p]%1000000==0)log(FOOLOS_MODULE_NAME,FOOLOS_LOG_DEBUG,"cpu[%d] %d",p,cpu_counter[p]);
- lock_release(0);
+ //lock_release(0);
}
}
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index 2a546a8..04e359a 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -17,16 +17,16 @@ void check_spinlocks()
log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"%d",spinlocks[i]);
}
+/*
void lock_spin(uint32_t i)
{
uint32_t *addr=spinlocks+i;
-// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"locking %d (0x%08X)",i,addr);
while(x86_xchg(addr,1));
}
+*/
void lock_release(uint32_t i)
{
-// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"unlocking %d",i);
uint32_t *addr=spinlocks+i;
asm("movb $0,%0"::"m"(*addr));
}