smp: enable smp

This is a very large patch. Don't feel like splitting it up.

Change locking discipline for rbtrees. Most changes are this.

Fix stack init logic for application processors, and start them up.

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-13 14:07:55 -04:00
commit 3e5abada9b
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
17 changed files with 123 additions and 52 deletions

View file

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <kernel/common.h>
#include <lib/stdio.h>
#include <arch/proc.h>
#include "arch/reg.h"
static const char *exception_names[] = {
@ -37,11 +38,11 @@ static const char *exception_names[] = {
"Triple Fault",
};
void exception_handler(u64 no, u64 err)
void exception_handler(u64 no, u64 err, u64 rip)
{
if (no == 0x0e) {
panic("(Page fault) addr: 0x%16x err: %x\n", cr2_read(), err);
panic("(Page fault) cpu%d ip:0x%016lx addr:0x%016lx err:%x\n", cpu_id(), rip, cr2_read(), err);
}
panic("(Exception) %s(%02xh) err: %x\n", exception_names[no], no, err);
panic("(Exception) cpu%d ip:0x%016lx %s(%02xh) err: %x\n", cpu_id(), rip, exception_names[no], no, err);
}