summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-04-22 22:33:28 +0200
committerAlmuHS <almuhs@github.com>2019-04-22 22:33:28 +0200
commita864694b37c374e6f0bff0b5efa768887a61466a (patch)
tree4d5cbcd5d9efeb8d088eb8b3385e826839d4f197
parenta3e8b6f7c240c7a3bf784570357790bf38a30a58 (diff)
created new mutex
-rw-r--r--i386/i386/mp_desc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index e35750e9..5ed28d6d 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -77,6 +77,8 @@ char eintstack[]; /* top */
static struct kmutex mp_cpu_boot_lock;
+static struct kmutex mp_ap_thread_lock;
+
/*
* Multiprocessor i386/i486 systems use a separate copy of the
@@ -276,9 +278,8 @@ cpu_setup(){
int i = 1;
while(i < ncpu && (machine_slot[i].running == TRUE)) i++;
- kmutex_init(&mp_cpu_boot_lock);
-
+ kmutex_init(&mp_ap_thread_lock);
unsigned apic_id = (((ApicLocalUnit*)phystokv(lapic_addr))->apic_id.r >> 24) & 0xff;
@@ -326,10 +327,9 @@ cpu_setup(){
break;
}
- kmutex_lock(&mp_cpu_boot_lock, FALSE);
+ kmutex_lock(&mp_ap_thread_lock, FALSE);
slave_main(i);
- kmutex_unlock(&mp_cpu_boot_lock);
-
+ kmutex_unlock(&mp_ap_thread_lock);
printf("launched first thread of cpu %d\n", i);