[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 39/68] kern/startup.c: remove forward declarations
From: |
Marin Ramesa |
Subject: |
[PATCH 39/68] kern/startup.c: remove forward declarations |
Date: |
Fri, 29 Nov 2013 22:54:04 +0100 |
* Makefrag.am: Include kern/bootstrap.h.
Include vm/vm_init.h.
Include device/device_init.h.
* device/device_init.h: New file.
Add copyright.
[_DEVICE_DEVICE_INIT_H_]: Add ifndef.
(device_service_create): Add prototype.
* i386/i386/mp_desc.h (start_other_cpus): Add prototype.
* kern/bootstrap.h: New file.
Add copyright.
[_KERN_BOOTSTRAP_H_]: Add ifndef.
(bootstrap_create): Add prototype.
* kern/sched_prim.h (idle_thread, sched_thread): Add prototypes.
* kern/startup.c: Include kern/bootstrap.h.
Include kern/startup.h.
Include vm/vm_init.h.
Include vm/vm_pageout.h.
Include device/device_init.h.
(vm_mem_init, vm_mem_bootstrap, init_timeout, machine_init, idle_thread,
vm_pageout, reaper_thread, swapin_thread, sched_thread, bootstrap_create,
device_service_create, cpu_launch_first_thread, start_kernel_threads,
start_other_cpus, action_thread): Remove forward declarations.
[NCPUS > 1] Include machine/mp_desc.h and kern/machine.h.
* kern/startup.h: Include kern/thread.h.
(cpu_launch_first_thread, start_kernel_threads): Add prototypes.
* vm/vm_init.h: New file.
Add copyright.
[_VM_VM_INIT_H_]: Add ifndef.
(vm_mem_init, vm_mem_bootstrap): Add prototypes.
* vm/vm_pageout.h (vm_pageout): Add prototype.
---
Makefrag.am | 3 +++
device/device_init.h | 24 ++++++++++++++++++++++++
i386/i386/mp_desc.h | 2 ++
kern/bootstrap.h | 24 ++++++++++++++++++++++++
kern/sched_prim.h | 3 +++
kern/startup.c | 26 +++++++-------------------
kern/startup.h | 4 ++++
vm/vm_init.h | 25 +++++++++++++++++++++++++
vm/vm_pageout.h | 2 ++
9 files changed, 94 insertions(+), 19 deletions(-)
create mode 100644 device/device_init.h
create mode 100644 kern/bootstrap.h
create mode 100644 vm/vm_init.h
diff --git a/Makefrag.am b/Makefrag.am
index 2d09b62..b3f9521 100644
--- a/Makefrag.am
+++ b/Makefrag.am
@@ -135,6 +135,7 @@ libkernel_a_SOURCES += \
kern/ast.h \
kern/boot_script.h \
kern/bootstrap.c \
+ kern/bootstrap.h \
kern/counters.c \
kern/counters.h \
kern/cpu_number.h \
@@ -247,6 +248,7 @@ libkernel_a_SOURCES += \
vm/vm_fault.c \
vm/vm_fault.h \
vm/vm_init.c \
+ vm/vm_init.h \
vm/vm_kern.c \
vm/vm_kern.h \
vm/vm_map.c \
@@ -290,6 +292,7 @@ libkernel_a_SOURCES += \
device/dev_name.c \
device/dev_pager.c \
device/device_init.c \
+ device/device_init.h \
device/device_port.h \
device/device_types_kernel.h \
device/ds_routines.c \
diff --git a/device/device_init.h b/device/device_init.h
new file mode 100644
index 0000000..175b34d
--- /dev/null
+++ b/device/device_init.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2013 Free Software Foundation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _DEVICE_DEVICE_INIT_H_
+#define _DEVICE_DEVICE_INIT_H_
+
+extern void device_service_create(void);
+
+#endif /* _DEVICE_DEVICE_INIT_H_ */
diff --git a/i386/i386/mp_desc.h b/i386/i386/mp_desc.h
index 03d7194..9f96312 100644
--- a/i386/i386/mp_desc.h
+++ b/i386/i386/mp_desc.h
@@ -79,4 +79,6 @@ extern struct mp_desc_table * mp_desc_init(int);
#endif /* MULTIPROCESSOR */
+extern void start_other_cpus(void);
+
#endif /* _I386_MP_DESC_H_ */
diff --git a/kern/bootstrap.h b/kern/bootstrap.h
new file mode 100644
index 0000000..37a76c7
--- /dev/null
+++ b/kern/bootstrap.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2013 Free Software Foundation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _KERN_BOOTSTRAP_H_
+#define _KERN_BOOTSTRAP_H_
+
+extern void bootstrap_create(void);
+
+#endif /* _KERN_BOOTSTRAP_H_ */
diff --git a/kern/sched_prim.h b/kern/sched_prim.h
index b7ecba7..07b5bf0 100644
--- a/kern/sched_prim.h
+++ b/kern/sched_prim.h
@@ -181,4 +181,7 @@ void checkrq(run_queue_t rq, char *msg);
void thread_check(thread_t th, run_queue_t rq);
#endif /* DEBUG */
+extern void idle_thread(void);
+extern void sched_thread(void);
+
#endif /* _KERN_SCHED_PRIM_H_ */
diff --git a/kern/startup.c b/kern/startup.c
index 22e9997..be83f6b 100644
--- a/kern/startup.c
+++ b/kern/startup.c
@@ -47,45 +47,33 @@
#include <kern/thread_swap.h>
#include <kern/timer.h>
#include <kern/xpr.h>
+#include <kern/bootstrap.h>
#include <kern/time_stamp.h>
+#include <kern/startup.h>
#include <vm/vm_kern.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
+#include <vm/vm_init.h>
+#include <vm/vm_pageout.h>
#include <machine/machspl.h>
#include <machine/pcb.h>
#include <machine/pmap.h>
#include <machine/model_dep.h>
#include <mach/version.h>
+#include <device/device_init.h>
#if MACH_KDB
#include <device/cons.h>
#endif /* MACH_KDB */
-extern void vm_mem_init();
-extern void vm_mem_bootstrap();
-extern void init_timeout();
-extern void machine_init();
-
-extern void idle_thread();
-extern void vm_pageout();
-extern void reaper_thread();
-extern void swapin_thread();
-extern void sched_thread();
-
-extern void bootstrap_create();
-extern void device_service_create();
-
-void cpu_launch_first_thread(); /* forward */
-void start_kernel_threads(); /* forward */
-
#if ! MACH_KBD
boolean_t reboot_on_panic = 1;
#endif
#if NCPUS > 1
-extern void start_other_cpus();
-extern void action_thread();
+#include <machine/mp_desc.h>
+#include <kern/machine.h>
#endif /* NCPUS > 1 */
/* XX */
diff --git a/kern/startup.h b/kern/startup.h
index 07deb80..0a42e45 100644
--- a/kern/startup.h
+++ b/kern/startup.h
@@ -19,6 +19,10 @@
#ifndef _KERN_STARTUP_H_
#define _KERN_STARTUP_H_
+#include <kern/thread.h>
+
extern void setup_main(void);
+void cpu_launch_first_thread(thread_t th);
+void start_kernel_threads(void);
#endif /* _KERN_STARTUP_H_ */
diff --git a/vm/vm_init.h b/vm/vm_init.h
new file mode 100644
index 0000000..42ef48b
--- /dev/null
+++ b/vm/vm_init.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013 Free Software Foundation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _VM_VM_INIT_H_
+#define _VM_VM_INIT_H_
+
+extern void vm_mem_init(void);
+extern void vm_mem_bootstrap(void);
+
+#endif /* _VM_VM_INIT_H_ */
diff --git a/vm/vm_pageout.h b/vm/vm_pageout.h
index d41ee30..90e45a7 100644
--- a/vm/vm_pageout.h
+++ b/vm/vm_pageout.h
@@ -44,4 +44,6 @@ extern vm_page_t vm_pageout_setup(vm_page_t, vm_offset_t,
vm_object_t,
vm_offset_t, boolean_t);
extern void vm_pageout_page(vm_page_t, boolean_t, boolean_t);
+extern void vm_pageout(void);
+
#endif /* _VM_VM_PAGEOUT_H_ */
--
1.8.1.4
- [PATCH 29/68] i386/i386at/pic_isa.c: remove forward declaration, (continued)
- [PATCH 29/68] i386/i386at/pic_isa.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 30/68] i386/intel/pmap.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 32/68] ipc/ipc_table.c: remove forward declaration, Marin Ramesa, 2013/11/29
- [PATCH 31/68] ipc/ipc_kmsg.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [PATCH 33/68] ipc/mach_msg.c: remove forward declarations, Marin Ramesa, 2013/11/29
- [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 <=
- [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, 2013/11/29
- [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