linux-mips
[Top] [All Lists]

Re: initrd_header for mips64 kernel

To: geert@linux-m68k.org
Subject: Re: initrd_header for mips64 kernel
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sat, 03 May 2003 14:15:18 +0900 (JST)
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <Pine.GSO.4.21.0305021617560.5468-100000@vervain.sonytel.be>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20030502.220517.74756988.anemo@mba.ocn.ne.jp> <Pine.GSO.4.21.0305021617560.5468-100000@vervain.sonytel.be>
Sender: linux-mips-bounce@linux-mips.org
>>>>> On Fri, 2 May 2003 16:18:42 +0200 (MEST), Geert Uytterhoeven 
>>>>> <geert@linux-m68k.org> said:
geert> I think you better use u32 if it must be a 32-bit value.

Certainly.  Also it is better to use u32 in 32bit kernel too.

diff -ur linux-mips-cvs/arch/mips/kernel/setup.c 
linux.new/arch/mips/kernel/setup.c
--- linux-mips-cvs/arch/mips/kernel/setup.c     Thu Apr 17 23:54:17 2003
+++ linux.new/arch/mips/kernel/setup.c  Sat May  3 14:09:27 2003
@@ -246,17 +246,17 @@
 {
 #ifdef CONFIG_BLK_DEV_INITRD
        unsigned long tmp;
-       unsigned long *initrd_header;
+       u32 *initrd_header;
 #endif
        unsigned long bootmap_size;
        unsigned long start_pfn, max_pfn, max_low_pfn, first_usable_pfn;
        int i;
 
 #ifdef CONFIG_BLK_DEV_INITRD
-       tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8;
+       tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - sizeof(u32) 
* 2;
        if (tmp < (unsigned long)&_end)
                tmp += PAGE_SIZE;
-       initrd_header = (unsigned long *)tmp;
+       initrd_header = (u32 *)tmp;
        if (initrd_header[0] == 0x494E5244) {
                initrd_start = (unsigned long)&initrd_header[2];
                initrd_end = initrd_start + initrd_header[1];
diff -ur linux-mips-cvs/arch/mips64/kernel/setup.c 
linux.new/arch/mips64/kernel/setup.c
--- linux-mips-cvs/arch/mips64/kernel/setup.c   Wed Apr  9 22:06:57 2003
+++ linux.new/arch/mips64/kernel/setup.c        Sat May  3 14:09:35 2003
@@ -245,17 +245,17 @@
 {
 #ifdef CONFIG_BLK_DEV_INITRD
        unsigned long tmp;
-       unsigned long *initrd_header;
+       u32 *initrd_header;
 #endif
        unsigned long bootmap_size;
        unsigned long start_pfn, max_pfn;
        int i;
 
 #ifdef CONFIG_BLK_DEV_INITRD
-       tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8;
+       tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - sizeof(u32) 
* 2;
        if (tmp < (unsigned long)&_end)
                tmp += PAGE_SIZE;
-       initrd_header = (unsigned long *)tmp;
+       initrd_header = (u32 *)tmp;
        if (initrd_header[0] == 0x494E5244) {
                initrd_start = (unsigned long)&initrd_header[2];
                initrd_end = initrd_start + initrd_header[1];
---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>