[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] [patch] suzaku: move romfs if and only if CONFIG_MTD_UCLINUX is defined



hi,

on suzaku, we'd like to move attached romfs when CONFIG_MTD_UCLINX is
defined.

attached patch does it.  this patch affects suzaku only.

regards,
--
         yashi

---

* move attached romfs if and only if CONFIG_MTD_UCLINX is defined

 suzaku.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

Index: linux-suzaku/arch/microblaze/kernel/suzaku.c
===================================================================
--- linux-suzaku.orig/arch/microblaze/kernel/suzaku.c	2004-08-22 04:29:33.000000000 +0900
+++ linux-suzaku/arch/microblaze/kernel/suzaku.c	2004-08-22 05:48:04.370575237 +0900
@@ -72,6 +72,9 @@ unsigned long mach_gettimeoffset(void)
 /* Bytes to words, round up */
 #define get_romfs_len(addr) (((unsigned int *)(addr))[2])
 
+#define ROMFS_LOCATION (__bss_start)
+#define MOVE_ROMFS(dst, src, len) ({memmove(__bss_stop,__bss_start,len);})
+
 /* mach_early_init() is called very early, after the kernel stack and SDA 
    pointers are configured, but before BSS/SBSS are zeroed etc.  Be careful 
    what you do in here.  The bss and sbss sections are zeroed in here */
@@ -100,11 +103,14 @@ void __init mach_early_init (void)
 		*(dst++) = *(src++);
 	} while (src < &_intv_load_end);
 
-	/* Copy ROMFS above bss */
-	len = get_romfs_len(__bss_start);
+#ifdef CONFIG_MTD_UCLINUX
+        /* if CONFIG_MTD_UCLINUX is defined, assume ROMFS is at the
+         * end of kernel, which is ROMFS_LOCATION defined above. */
+	len = get_romfs_len(ROMFS_LOCATION);
 
 	/* Use memmove to handle likely case of memory overlap */
-	memmove(__bss_stop,__bss_start,len);
+	MOVE_ROMFS(__bss_stop,__bss_start,len);
+#endif
 
         _ramstart = (unsigned long)__bss_stop + len;
 	
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/