summaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /init/main.c
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c78
1 files changed, 43 insertions, 35 deletions
diff --git a/init/main.c b/init/main.c
index cc6657bbc..84bd1365e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -64,24 +64,26 @@ extern int bdflush(void *);
extern int kswapd(void *);
extern void kswapd_setup(void);
+extern void dquot_init(void);
extern void init_IRQ(void);
extern void init_modules(void);
extern long console_init(long, long);
extern void init_inventory(void);
extern void sock_init(void);
extern void uidcache_init(void);
-extern unsigned long pci_init(unsigned long, unsigned long);
-extern long mca_init(long, long);
+extern void mca_init(void);
extern long sbus_init(long, long);
extern long powermac_init(unsigned long, unsigned long);
extern void sysctl_init(void);
extern void filescache_init(void);
extern void signals_init(void);
-extern void dquot_init(void);
extern void smp_setup(char *str, int *ints);
+#ifdef __i386__
extern void ioapic_pirq_setup(char *str, int *ints);
+#endif
extern void no_scroll(char *str, int *ints);
+extern void kbd_reset_setup(char *str, int *ints);
extern void panic_setup(char *str, int *ints);
extern void bmouse_setup(char *str, int *ints);
extern void msmouse_setup(char *str, int *ints);
@@ -357,6 +359,9 @@ __initfunc(static void profile_setup(char *str, int *ints))
}
#endif
+#ifdef CONFIG_PCI
+#include <linux/pci.h>
+#endif
static struct dev_name_struct {
const char *name;
@@ -485,8 +490,10 @@ static struct kernel_param cooked_params[] __initdata = {
#ifdef __SMP__
{ "nosmp", smp_setup },
{ "maxcpus=", smp_setup },
+#ifdef __i386__
{ "pirq=", ioapic_pirq_setup },
#endif
+#endif
#ifdef CONFIG_BLK_DEV_RAM
{ "ramdisk_start=", ramdisk_start_setup },
{ "load_ramdisk=", load_ramdisk },
@@ -504,6 +511,7 @@ static struct kernel_param cooked_params[] __initdata = {
{ "console=", console_setup },
#ifdef CONFIG_VT
{ "no-scroll", no_scroll },
+ { "kbd-reset", kbd_reset_setup },
#endif
#ifdef CONFIG_BUGi386
{ "no-hlt", no_halt },
@@ -749,6 +757,9 @@ static struct kernel_param raw_params[] __initdata = {
#ifdef CONFIG_IP_PNP
{ "ip=", ip_auto_config_setup },
#endif
+#ifdef CONFIG_PCI
+ { "pci=", pci_setup },
+#endif
#ifdef CONFIG_PARIDE_PD
{ "pd.", pd_setup },
#endif
@@ -1013,6 +1024,12 @@ __initfunc(asmlinkage void start_kernel(void))
sched_init();
time_init();
parse_options(command_line);
+
+ /*
+ * HACK ALERT! This is early. We're enabling the console before
+ * we've done PCI setups etc, and console_init() must be aware of
+ * this. But we do want output early, in case something goes wrong.
+ */
memory_start = console_init(memory_start,memory_end);
#ifdef CONFIG_MODULES
init_modules();
@@ -1027,30 +1044,10 @@ __initfunc(asmlinkage void start_kernel(void))
memset(prof_buffer, 0, prof_len * sizeof(unsigned int));
}
#endif
-#ifdef CONFIG_SBUS
- memory_start = sbus_init(memory_start,memory_end);
-#endif
-#if defined(CONFIG_PMAC) || defined(CONFIG_CHRP)
- memory_start = powermac_init(memory_start, memory_end);
-#endif
-#if defined(CONFIG_PCI) && defined(CONFIG_PCI_CONSOLE)
- memory_start = pci_init(memory_start,memory_end);
-#endif
-#if HACK
- memory_start = console_init(memory_start,memory_end);
-#endif
-#if defined(CONFIG_PCI) && !defined(CONFIG_PCI_CONSOLE)
- memory_start = pci_init(memory_start,memory_end);
-#endif
+
#ifdef CONFIG_REMOTE_DEBUG
set_debug_traps();
/* breakpoint(); */ /* execute a BREAK insn */
-#endif
-#ifdef CONFIG_PCI
- memory_start = pci_init(memory_start,memory_end);
-#endif
-#ifdef CONFIG_MCA
- memory_start = mca_init(memory_start,memory_end);
#endif
memory_start = kmem_cache_init(memory_start, memory_end);
sti();
@@ -1092,12 +1089,30 @@ __initfunc(asmlinkage void start_kernel(void))
#ifdef CONFIG_SYSCTL
sysctl_init();
#endif
+
+ /*
+ * Ok, at this point all CPU's should be initialized, so
+ * we can start looking into devices..
+ */
+#ifdef CONFIG_PCI
+ pci_init();
+#endif
+#ifdef CONFIG_SBUS
+ sbus_init();
+#endif
+#if defined(CONFIG_PMAC) || defined(CONFIG_CHRP)
+ powermac_init();
+#endif
+#ifdef CONFIG_MCA
+ mca_init();
+#endif
+
/*
* We count on the initial thread going ok
* Like idlers init is an unlocked kernel thread, which will
* make syscalls (and thus be locked).
*/
- kernel_thread(init, NULL, 0);
+ kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
/*
* task[0] is meant to be used as an "idle" task: it may not sleep, but
* it might do some general things like count free pages or it could be
@@ -1136,16 +1151,16 @@ static int init(void * unused)
#endif
/* Launch bdflush from here, instead of the old syscall way. */
- kernel_thread(bdflush, NULL, 0);
+ kernel_thread(bdflush, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
/* Start the background pageout daemon. */
kswapd_setup();
- kernel_thread(kswapd, NULL, 0);
+ kernel_thread(kswapd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
#if CONFIG_AP1000
/* Start the async paging daemon. */
{
extern int asyncd(void *);
- kernel_thread(asyncd, NULL, 0);
+ kernel_thread(asyncd, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
}
#endif
@@ -1201,13 +1216,6 @@ static int init(void * unused)
}
#endif
-#ifdef CONFIG_KMOD
- {
- extern int kmod_init(void);
- kmod_init();
- }
-#endif
-
setup(1);
if (open("/dev/console", O_RDWR, 0) < 0)