proc: copy memmap from parent

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-19 00:07:08 -04:00
commit 30c14a0fef
6 changed files with 85 additions and 11 deletions

19
amd64/kernel/proc.c Normal file
View file

@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/proc.h>
#include <kernel/proc.h>
#include "arch/msr.h"
struct cpu_local *tls_get()
{
return (void *)rdmsr(IA32_GS_BASE);
}
struct proc *get_cur_proc()
{
struct cpu_local *l = tls_get();
if (!l)
return NULL;
if (!l->cur_thread)
return NULL;
return l->cur_thread->proc;
}