Update of /cvsroot/linux-mips/linux/arch/mips/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv704
Modified Files:
setup.c
Log Message:
Glue initrd. This method has it's problems so we might have to change this once more but until then.
Index: setup.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/setup.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- setup.c 2001/10/17 06:33:14 1.20
+++ setup.c 2001/10/18 18:08:17 1.21
@@ -554,6 +554,8 @@
unsigned long bootmap_size;
unsigned long start_pfn, max_pfn, first_usable_pfn;
+ unsigned long tmp;
+ unsigned long* initrd_header;
int i;
@@ -695,11 +697,23 @@
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
#define PFN_PHYS(x) ((x) << PAGE_SHIFT)
+#ifdef CONFIG_BLK_DEV_INITRD
+ tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8;
+ if (tmp < (unsigned long)&_end)
+ tmp += PAGE_SIZE;
+ initrd_header = (unsigned long *)tmp;
+ if (initrd_header[0] == 0x494E5244) {
+ initrd_start = (unsigned long)&initrd_header[2];
+ initrd_end = initrd_start + initrd_header[1];
+ }
+ start_pfn = PFN_UP(__pa((&_end)+(initrd_end - initrd_start) + PAGE_SIZE));
+#else
/*
* Partially used pages are not usable - thus
* we are rounding upwards.
*/
start_pfn = PFN_UP(__pa(&_end));
+#endif /* CONFIG_BLK_DEV_INITRD */
/* Find the highest page frame number we have available. */
max_pfn = 0;
|