diff --git a/kernel/amd64/smp.c b/kernel/amd64/smp.c index e5a3e48..d25d39b 100644 --- a/kernel/amd64/smp.c +++ b/kernel/amd64/smp.c @@ -102,10 +102,10 @@ static void smp_bootstrap (struct limine_mp_info* mp_info) { DEBUG ("CPU %u is online!\n", thiscpu->id); - atomic_fetch_sub (&cpu_counter, 1); - cpu->kproc = kproc_create (); + atomic_fetch_sub (&cpu_counter, 1); + __asm__ volatile ("sti"); struct reschedule_ctx rctx; @@ -116,6 +116,9 @@ static void smp_bootstrap (struct limine_mp_info* mp_info) { spin_lock (&spin_proc->cpu->lock, &fc); do_sched (spin_proc, &spin_proc->cpu->lock, fc); + + for (;;) + ; } /// Initialize SMP subsystem for AMD64. Start AP CPUs @@ -133,7 +136,7 @@ void smp_init (void) { DEBUG ("Waiting for other CPUs:\n"); while (atomic_load (&cpu_counter) > 0) - debugprintf (".\n"); + ; DEBUG ("All CPUs are up!\n"); } diff --git a/kernel/mm/_malloc_port.c b/kernel/mm/_malloc_port.c index 6abbbee..09cb013 100644 --- a/kernel/mm/_malloc_port.c +++ b/kernel/mm/_malloc_port.c @@ -25,6 +25,7 @@ #define HAVE_MORECORE 0 #define NO_MALLOC_STATS 1 #define USE_LOCKS 1 +#define USE_SPIN_LOCKS 1 #define MALLOC_FAILURE_ACTION \ do { \ DEBUG ("malloc failure\n"); \