1
Index: arch/mips/kernel/setup.c
2
===================================================================
3
RCS file: /cvs/linux/arch/mips/kernel/setup.c,v
4
retrieving revision 1.96.2.12
5
diff -u -u -r1.96.2.12 setup.c
6
--- arch/mips/kernel/setup.c 2002/02/15 21:05:48 1.96.2.12
7
+++ arch/mips/kernel/setup.c 2002/05/09 17:17:59
12
+static inline void parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_end)
14
+ char c = ' ', *to = command_line, *from = saved_command_line;
16
+ unsigned long rd_size = 0;
20
+ * "rd_start=0xNNNNNNNN" defines the memory address of an initrd
21
+ * "rd_size=0xNN" it's size
23
+ if (c == ' ' && !memcmp(from, "rd_start=", 9)) {
24
+ if (to != command_line)
26
+ (*rd_start) = memparse(from + 9, &from);
28
+ if (c == ' ' && !memcmp(from, "rd_size=", 8)) {
29
+ if (to != command_line)
31
+ rd_size = memparse(from + 8, &from);
36
+ if (CL_SIZE <= ++len)
41
+ (*rd_end) = (*rd_start) + rd_size;
44
void __init setup_arch(char **cmdline_p)
46
void atlas_setup(void);
49
unsigned long bootmap_size;
50
unsigned long start_pfn, max_pfn, max_low_pfn, first_usable_pfn;
51
-#ifdef CONFIG_BLK_DEV_INITRD
53
- unsigned long* initrd_header;
55
+ unsigned long end = &_end;
60
#define MAXMEM_PFN PFN_DOWN(MAXMEM)
62
#ifdef CONFIG_BLK_DEV_INITRD
63
- tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8;
64
- if (tmp < (unsigned long)&_end)
66
- initrd_header = (unsigned long *)tmp;
67
- if (initrd_header[0] == 0x494E5244) {
68
- initrd_start = (unsigned long)&initrd_header[2];
69
- initrd_end = initrd_start + initrd_header[1];
70
+ parse_rd_cmdline(&initrd_start, &initrd_end);
71
+ if(initrd_start && initrd_end)
74
+ initrd_start = initrd_end = 0;
76
- start_pfn = PFN_UP(__pa((&_end)+(initrd_end - initrd_start) + PAGE_SIZE));
78
+#endif /* CONFIG_BLK_DEV_INITRD */
80
* Partially used pages are not usable - thus
81
* we are rounding upwards.
83
- start_pfn = PFN_UP(__pa(&_end));
84
-#endif /* CONFIG_BLK_DEV_INITRD */
85
+ start_pfn = PFN_UP(__pa(end));
87
/* Find the highest page frame number we have available. */