From 45ab1dd925162659d59d65a95105120d9dc96978 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 28 Jun 2024 23:12:32 -0400 Subject: kernel/amd64: Focus md_td_init() to fork MD code Rename md_td_init() to md_fork() and change up what it does to keep things as simple as possible. Signed-off-by: Ian Moffett --- sys/kern/init_main.c | 3 --- sys/kern/kern_fork.c | 8 +------- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index df955ee..a5bdf1c 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -56,9 +56,6 @@ main(void) /* Startup the BSP */ cpu_startup(&g_bsp_ci); - /* Init process 0 */ - md_td_init(&proc0, NULL, 0); - /* Init the virtual file system */ vfs_init(); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 64e0caf..ce5f3a6 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -54,13 +54,7 @@ fork1(struct proc *cur, int flags, void(*ip)(void), struct proc **newprocp) if (newproc == NULL) return -ENOMEM; - /* - * We want to zero the proc to ensure it is in known - * state. We then want to initialize machine dependent - * fields. - */ - memset(newproc, 0, sizeof(*newproc)); - status = md_td_init(newproc, cur, (uintptr_t)ip); + status = md_fork(newproc, cur, (uintptr_t)ip); if (status != 0) goto done; -- cgit v1.2.3