summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-05-01 17:18:51 +0200
committerAlmuHS <almuhs@github.com>2019-05-01 17:18:51 +0200
commit8684c5f8c1d0ecd2726949a61ce0ef83b9ab8a8d (patch)
tree0b3bf3f1c2eaa44428f03cd675da18d3d6220d62
parent9812e8c51ab26040534214928a5028ba31ab4bcc (diff)
try to fix: stack crash
-rw-r--r--i386/i386/mp_desc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index ca08bfcb..25a69655 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -129,7 +129,7 @@ extern void* *apboot, *apbootend;
#define AP_BOOT_ADDR (0x7000)
//cpu stack
-extern void* *stack_ptr;
+extern void* stack_ptr;
extern void *stack_bsp;
//ICR Destination mode
@@ -526,6 +526,7 @@ start_other_cpus(void)
int cpu;
vm_offset_t stack_start;
int apic_id = lapic->apic_id.r >>24;
+
printf("found %d cpus\n", ncpu);
printf("The current cpu is: %d\n", cpu_number());
@@ -553,12 +554,12 @@ start_other_cpus(void)
//Initialize cpu stack
cpu_stack[cpu] = stack_start;
_cpu_stack_top[cpu] = stack_start + STACK_SIZE;
- stack_start += STACK_SIZE;
- stack_ptr = (void*) cpu_stack[cpu];
+ stack_ptr = (void*) &cpu_stack[cpu];
machine_slot[cpu].running = FALSE;
cpu_start(cpu);
+ stack_start += STACK_SIZE;
}
}
}