summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/aarch64/conf/GENERIC7
-rw-r--r--sys/arch/amd64/amd64/mp.c17
-rw-r--r--sys/arch/amd64/conf/GENERIC8
-rw-r--r--sys/conf/BLACKLIST1
-rw-r--r--sys/conf/GENERIC9
5 files changed, 21 insertions, 21 deletions
diff --git a/sys/arch/aarch64/conf/GENERIC b/sys/arch/aarch64/conf/GENERIC
index eeb9d9d..702a248 100644
--- a/sys/arch/aarch64/conf/GENERIC
+++ b/sys/arch/aarch64/conf/GENERIC
@@ -1,10 +1,3 @@
// Kernel options
option SERIAL_DEBUG yes // Enable kmsg serial logging
option USER_KMSG yes // Show kmsg in user consoles
-
-// Kernel constants
-setval SCHED_NQUEUE 4 // Number of scheduler queues (for MLFQ)
-
-// Console attributes
-setval CONSOLE_BG 0x000000
-setval CONSOLE_FG 0xB57614
diff --git a/sys/arch/amd64/amd64/mp.c b/sys/arch/amd64/amd64/mp.c
index 21881b2..20f550f 100644
--- a/sys/arch/amd64/amd64/mp.c
+++ b/sys/arch/amd64/amd64/mp.c
@@ -56,6 +56,7 @@ static void
ap_trampoline(struct limine_smp_info *si)
{
struct cpu_info *ci;
+ struct proc *idle;
ci = dynalloc(sizeof(*ci));
__assert(ci != NULL);
@@ -64,6 +65,11 @@ ap_trampoline(struct limine_smp_info *si)
cpu_startup(ci);
spinlock_acquire(&ci_list_lock);
ci_list[ncpu_up] = ci;
+
+ ci->id = ncpu_up;
+ spawn(&g_proc0, sched_enter, NULL, 0, &idle);
+ proc_pin(idle, ci->id);
+
spinlock_release(&ci_list_lock);
atomic_inc_int(&ncpu_up);
@@ -110,6 +116,7 @@ mp_bootstrap_aps(struct cpu_info *ci)
{
struct limine_smp_response *resp = g_smp_req.response;
struct limine_smp_info **cpus;
+ struct proc *idle;
size_t cpu_init_counter;
uint32_t ncpu;
@@ -121,6 +128,10 @@ mp_bootstrap_aps(struct cpu_info *ci)
cpu_init_counter = ncpu - 1;
ci_list[0] = ci;
+ /* Pin an idle thread to the BSP */
+ spawn(&g_proc0, sched_enter, NULL, 0, &idle);
+ proc_pin(idle, 0);
+
if (resp->cpu_count == 1) {
pr_trace("CPU has 1 core, no APs to bootstrap...\n");
return;
@@ -136,12 +147,6 @@ mp_bootstrap_aps(struct cpu_info *ci)
cpus[i]->goto_address = ap_trampoline;
}
- /* Start up idle threads */
- pr_trace("kicking %d idle threads...\n", ncpu);
- for (uint32_t i = 0; i < ncpu; ++i) {
- spawn(&g_proc0, sched_enter, NULL, 0, NULL);
- }
-
/* Wait for all cores to be ready */
while ((ncpu_up - 1) < cpu_init_counter);
}
diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC
index e407fa9..6f573f3 100644
--- a/sys/arch/amd64/conf/GENERIC
+++ b/sys/arch/amd64/conf/GENERIC
@@ -9,12 +9,4 @@ option SPECTRE_IBRS no // Enable the IBRS CPU feature
option SERIAL_DEBUG yes // Enable kmsg serial logging
option USER_KMSG no // Show kmsg in user consoles
option CPU_SMEP yes // Supervisor Memory Exec Protection
-option PANIC_SCR no // Clear screen on panic
option I8042_POLL yes // Use polling for the i8042
-
-// Kernel constants
-setval SCHED_NQUEUE 4 // Number of scheduler queues (for MLFQ)
-
-// Console attributes
-setval CONSOLE_BG 0x000000
-setval CONSOLE_FG 0xB57614
diff --git a/sys/conf/BLACKLIST b/sys/conf/BLACKLIST
new file mode 100644
index 0000000..4eb32d8
--- /dev/null
+++ b/sys/conf/BLACKLIST
@@ -0,0 +1 @@
+xhci ahci nvme
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC
new file mode 100644
index 0000000..5734c43
--- /dev/null
+++ b/sys/conf/GENERIC
@@ -0,0 +1,9 @@
+// Kernel options
+option PANIC_SCR no // Clear screen on panic
+
+// Kernel constants
+setval SCHED_NQUEUE 4 // Number of scheduler queues (for MLFQ)
+
+// Console attributes
+setval CONSOLE_BG 0x000000
+setval CONSOLE_FG 0xB57614