patch-2.3.23 linux/init/main.c

Next file: linux/ipc/shm.c
Previous file: linux/include/pcmcia/version.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.22/linux/init/main.c linux/init/main.c
@@ -24,6 +24,7 @@
 #include <linux/blk.h>
 #include <linux/hdreg.h>
 #include <linux/iobuf.h>
+#include <linux/bootmem.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -56,6 +57,10 @@
 #include <linux/isapnp.h>
 #endif
 
+#ifdef CONFIG_IRDA
+#include <net/irda/irda_device.h>
+#endif
+
 /*
  * Versions of gcc older than that listed below may actually compile
  * and link okay, but the end product can have subtle run time bugs.
@@ -75,7 +80,6 @@
 
 extern void init_IRQ(void);
 extern void init_modules(void);
-extern long console_init(long, long);
 extern void sock_init(void);
 extern void fork_init(unsigned long);
 extern void mca_init(void);
@@ -106,9 +110,6 @@
 
 extern void time_init(void);
 
-static unsigned long memory_start = 0;
-static unsigned long memory_end = 0;
-
 int rows, cols;
 
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -419,7 +420,7 @@
 }
 
 
-extern void setup_arch(char **, unsigned long *, unsigned long *);
+extern void setup_arch(char **);
 extern void cpu_idle(void);
 
 #ifndef __SMP__
@@ -446,15 +447,15 @@
 asmlinkage void __init start_kernel(void)
 {
 	char * command_line;
-
+	unsigned long mempages;
 /*
  * Interrupts are still disabled. Do necessary setups, then
  * enable them
  */
 	lock_kernel();
 	printk(linux_banner);
-	setup_arch(&command_line, &memory_start, &memory_end);
-	memory_start = paging_init(memory_start,memory_end);
+	setup_arch(&command_line);
+	paging_init();
 	trap_init();
 	init_IRQ();
 	sched_init();
@@ -466,40 +467,45 @@
 	 * 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);
+	console_init();
 #ifdef CONFIG_MODULES
 	init_modules();
 #endif
 	if (prof_shift) {
-		prof_buffer = (unsigned int *) memory_start;
+		unsigned int size;
 		/* only text is profiled */
 		prof_len = (unsigned long) &_etext - (unsigned long) &_stext;
 		prof_len >>= prof_shift;
-		memory_start += prof_len * sizeof(unsigned int);
-		memset(prof_buffer, 0, prof_len * sizeof(unsigned int));
+		
+		size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1;
+		prof_buffer = (unsigned int *) alloc_bootmem(size);
+		memset(prof_buffer, 0, size);
 	}
 
-	memory_start = kmem_cache_init(memory_start, memory_end);
+	kmem_cache_init();
 	sti();
 	calibrate_delay();
 #ifdef CONFIG_BLK_DEV_INITRD
+	// FIXME, use the bootmem.h interface.
 	if (initrd_start && !initrd_below_start_ok && initrd_start < memory_start) {
 		printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
 		    "disabling it.\n",initrd_start,memory_start);
 		initrd_start = 0;
 	}
 #endif
-	mem_init(memory_start,memory_end);
+	mem_init();
 	kmem_cache_sizes_init();
 #ifdef CONFIG_PROC_FS
 	proc_root_init();
 #endif
-	fork_init(memory_end-memory_start);
+	mempages = num_physpages;
+
+	fork_init(mempages);
 	filescache_init();
 	dcache_init();
 	vma_init();
-	buffer_init(memory_end-memory_start);
-	page_cache_init(memory_end-memory_start);
+	buffer_init(mempages);
+	page_cache_init(mempages);
 	kiobuf_init();
 	signals_init();
 	inode_init();

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)