[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 42/68] kern/task.c: remove forward declarations
From: |
Marin Ramesa |
Subject: |
[PATCH 42/68] kern/task.c: remove forward declarations |
Date: |
Fri, 29 Nov 2013 22:54:07 +0100 |
* ipc/ipc_mqueue.h: Include ipc/ipc_kmsg_queue.h.
* kern/ipc_kobject.h: Move includes into ifndef.
* kern/syscall_emulation.h: Include kern/task.h.
(eml_init, eml_task_reference, eml_task_deallocate): Add prototypes.
* kern/task.c: Include kern/syscall_emulation.h.
(eml_init, eml_task_reference, eml_task_deallocate): Remove forward
declarations
---
ipc/ipc_mqueue.h | 1 +
kern/ipc_kobject.h | 5 ++---
kern/syscall_emulation.h | 6 ++++++
kern/task.c | 5 +----
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/ipc/ipc_mqueue.h b/ipc/ipc_mqueue.h
index ef0f942..f8a2f1e 100644
--- a/ipc/ipc_mqueue.h
+++ b/ipc/ipc_mqueue.h
@@ -38,6 +38,7 @@
#include <kern/assert.h>
#include <kern/lock.h>
#include <kern/macro_help.h>
+#include <ipc/ipc_kmsg_queue.h>
#include <ipc/ipc_kmsg.h>
#include <ipc/ipc_thread.h>
diff --git a/kern/ipc_kobject.h b/kern/ipc_kobject.h
index cb79574..606a66a 100644
--- a/kern/ipc_kobject.h
+++ b/kern/ipc_kobject.h
@@ -36,13 +36,12 @@
* Declarations for letting a port represent a kernel object.
*/
-#include <ipc/ipc_kmsg.h>
-#include <ipc/ipc_types.h>
-
#ifndef _KERN_IPC_KOBJECT_H_
#define _KERN_IPC_KOBJECT_H_
#include <mach/machine/vm_types.h>
+#include <ipc/ipc_types.h>
+#include <ipc/ipc_kmsg.h>
typedef vm_offset_t ipc_kobject_t;
diff --git a/kern/syscall_emulation.h b/kern/syscall_emulation.h
index 501b0a8..bf20e44 100644
--- a/kern/syscall_emulation.h
+++ b/kern/syscall_emulation.h
@@ -33,6 +33,7 @@
#ifndef __ASSEMBLER__
#include <mach/machine/vm_types.h>
#include <kern/lock.h>
+#include <kern/task.h>
typedef vm_offset_t eml_routine_t;
@@ -56,6 +57,11 @@ typedef vm_offset_t *emulation_vector_t; /* Variable-length
array */
#define EML_MOD (err_kern|err_sub(2))
#define EML_BAD_TASK (EML_MOD|0x0001)
#define EML_BAD_CNT (EML_MOD|0x0002)
+
+extern void eml_init(void);
+extern void eml_task_reference(task_t task, task_t parent);
+extern void eml_task_deallocate(task_t task);
+
#endif /* __ASSEMBLER__ */
#endif /* _KERN_SYSCALL_EMULATION_H_ */
diff --git a/kern/task.c b/kern/task.c
index f62e47b..933a90e 100644
--- a/kern/task.c
+++ b/kern/task.c
@@ -47,16 +47,13 @@
#include <kern/processor.h>
#include <kern/sched_prim.h> /* for thread_wakeup */
#include <kern/ipc_tt.h>
+#include <kern/syscall_emulation.h>
#include <vm/vm_kern.h> /* for kernel_map, ipc_kernel_map */
#include <machine/machspl.h> /* for splsched */
task_t kernel_task = TASK_NULL;
struct kmem_cache task_cache;
-extern void eml_init(void);
-extern void eml_task_reference(task_t, task_t);
-extern void eml_task_deallocate(task_t);
-
void task_init(void)
{
kmem_cache_init(&task_cache, "task", sizeof(struct task), 0,
--
1.8.1.4
- [PATCH 34/68] kern/bootstrap.c: remove forward declarations, (continued)
- [PATCH 34/68] kern/bootstrap.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 35/68] kern/debug.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 36/68] kern/ipc_mig.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 37/68] kern/processor.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 39/68] kern/startup.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 38/68] kern/sched_prim.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 40/68] kern/syscall_subr.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 41/68] kern/syscall_sw.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 42/68] kern/task.c: remove forward declarations,
Marin Ramesa <=
- [PATCH 43/68] kern/thread.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 44/68] kern: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 45/68] ipc/ipc_kmsg.h: update comment, Marin Ramesa, 2013/11/29
- [PATCH 46/68] kern/ipc_kobject.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 47/68] vm/vm_fault.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 48/68] vm/vm_kern.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 50/68] vm/vm_pageout.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 49/68] vm/vm_map.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 52/68] vm/vm_user.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 51/68] vm/vm_resident.c: correct comment, Marin Ramesa, 2013/11/29