From df9270ef134498d4fffb921286375137d3639ae5 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Mon, 12 Feb 2024 01:26:33 -0500 Subject: Replace kernel header includes in include/mach/mach_types.h with forward declarations. I was trying to reuse TASK_NAME_SIZE in kern/thread.h but it was impossible because files included from kern/task.h end up requiring kern/thread.h (through percpu.h), creating a recursive dependency. With this change, mach_types.h only defines forward declarations and modules have to explicitly include the appropriate header file if they want to be able touch those structures. Most of the other includes are required because we no longer grab many different includes through mach_types.h. Message-ID: <20240212062634.1082207-1-flaviocruz@gmail.com> --- kern/eventcount.h | 2 ++ kern/ipc_mig.h | 1 + kern/thread.c | 4 ++++ 3 files changed, 7 insertions(+) (limited to 'kern') diff --git a/kern/eventcount.h b/kern/eventcount.h index 7cc82207..598d7e02 100644 --- a/kern/eventcount.h +++ b/kern/eventcount.h @@ -35,6 +35,8 @@ #ifndef _KERN_EVENTCOUNT_H_ #define _KERN_EVENTCOUNT_H_ 1 +#include + /* kernel visible only */ typedef struct evc { diff --git a/kern/ipc_mig.h b/kern/ipc_mig.h index a8ee7869..422e8d84 100644 --- a/kern/ipc_mig.h +++ b/kern/ipc_mig.h @@ -28,6 +28,7 @@ #include #include +#include /* * Routine: mach_msg_send_from_kernel diff --git a/kern/thread.c b/kern/thread.c index de9d1982..23ee8b09 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -32,12 +32,15 @@ */ #include +#include #include #include #include #include #include #include +#include +#include #include #include #include @@ -59,6 +62,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3