Title: [8932] trunk/fs/binfmt_flat.c: [!no_src_qa!]
Revision
8932
Author
bhsong
Date
2010-06-22 05:02:36 -0400 (Tue, 22 Jun 2010)

Log Message

[!no_src_qa!]
revert my last L1 stack patch as we need more discussion about the solution

Modified Paths

Diff

Modified: trunk/fs/binfmt_flat.c (8931 => 8932)


--- trunk/fs/binfmt_flat.c	2010-06-21 16:12:47 UTC (rev 8931)
+++ trunk/fs/binfmt_flat.c	2010-06-22 09:02:36 UTC (rev 8932)
@@ -122,16 +122,10 @@
  * memory and creates the pointer tables from them, and puts their
  * addresses on the "stack", returning the new stack pointer value.
  */
-#ifndef CONFIG_APP_STACK_L1
+
 static unsigned long create_flat_tables(
 	unsigned long pp,
 	struct linux_binprm * bprm)
-#else
-static unsigned long create_flat_tables(
-	unsigned long pp,
-	struct linux_binprm * bprm,
-	unsigned long l1_ram_offset)
-#endif
 {
 	unsigned long *argv,*envp;
 	unsigned long * sp;
@@ -154,11 +148,7 @@
 	put_user(argc, sp);
 	current->mm->arg_start = (unsigned long) p;
 	while (argc-->0) {
-#ifndef CONFIG_APP_STACK_L1
 		put_user((unsigned long) p, argv++);
-#else
-		put_user((unsigned long) p + l1_ram_offset, argv++);
-#endif
 		do {
 			get_user(dummy, p); p++;
 		} while (dummy);
@@ -166,11 +156,7 @@
 	put_user((unsigned long) NULL, argv);
 	current->mm->arg_end = current->mm->env_start = (unsigned long) p;
 	while (envc-->0) {
-#ifndef CONFIG_APP_STACK_L1
-		put_user((unsigned long)p, envp++);
-#else
-		put_user((unsigned long)p + l1_ram_offset, envp++);
-#endif
+		put_user((unsigned long)p, envp); envp++;
 		do {
 			get_user(dummy, p); p++;
 		} while (dummy);
@@ -404,7 +390,7 @@
 #endif
 	flat_v2_reloc_t	r;
 	unsigned long *ptr;
-
+	
 	r.value = rl;
 #if defined(CONFIG_COLDFIRE)
 	ptr = (unsigned long *) (current->mm->start_code + r.reloc.offset);
@@ -417,7 +403,7 @@
 		"(address %p, currently %x) into segment %s\n",
 		r.reloc.offset, ptr, (int)*ptr, segment[r.reloc.type]);
 #endif
-
+	
 	switch (r.reloc.type) {
 	case OLD_FLAT_RELOC_TYPE_TEXT:
 		*ptr += current->mm->start_code;
@@ -436,7 +422,7 @@
 #ifdef DEBUG
 	printk("Relocation became %x\n", (int)*ptr);
 #endif
-}
+}		
 
 /****************************************************************************/
 
@@ -495,7 +481,7 @@
 		ret = -ENOEXEC;
 		goto err;
 	}
-
+	
 	/* Don't allow old format executables to use shared libraries */
 	if (rev == OLD_FLAT_VERSION && id != 0) {
 		printk("BINFMT_FLAT: shared libraries are not available before rev 0x%x\n",
@@ -601,7 +587,7 @@
 		fpos = ntohl(hdr->data_start);
 #ifdef CONFIG_BINFMT_ZFLAT
 		if (flags & FLAT_FLAG_GZDATA) {
-			result = decompress_exec(bprm, fpos, (char *) datapos,
+			result = decompress_exec(bprm, fpos, (char *) datapos, 
 						 data_len + (relocs * sizeof(unsigned long)), 0);
 		} else
 #endif
@@ -736,7 +722,7 @@
 	libinfo->lib_list[id].loaded = 1;
 	libinfo->lib_list[id].entry = (0x00ffffff & ntohl(hdr->entry)) + textpos;
 	libinfo->lib_list[id].build_date = ntohl(hdr->build_date);
-
+	
 	/*
 	 * We just load the allocations into some temporary memory to
 	 * help simplify all this mumbo jumbo
@@ -816,7 +802,7 @@
 		for (i=0; i < relocs; i++)
 			old_reloc(ntohl(reloc[i]));
 	}
-
+	
 	flush_icache_range(start_code, end_code);
 
 	if (flags & FLAT_FLAG_L1STK) {
@@ -840,7 +826,7 @@
 	}
 
 	/* zero the BSS,  BRK and stack areas */
-	memset((void*)(datapos + data_len), 0, bss_len +
+	memset((void*)(datapos + data_len), 0, bss_len + 
 			(memp + memp_size - stack_len -		/* end brk */
 			libinfo->lib_list[id].start_brk) +	/* start brk */
 			stack_len);
@@ -926,12 +912,12 @@
 	stack_len += (bprm->argc + 1) * sizeof(char *); /* the argv array */
 	stack_len += (bprm->envc + 1) * sizeof(char *); /* the envp array */
 	stack_len += FLAT_STACK_ALIGN - 1;  /* reserve for upcoming alignment */
-
+	
 	l1stack_base = 0;
 	res = load_flat_file(bprm, &libinfo, 0, &stack_len, &l1stack_base);
 	if (IS_ERR_VALUE(res))
 		return res;
-
+	
 	/* Update data segment pointers for all libraries */
 	for (i=0; i<MAX_SHARED_LIBS; i++)
 		if (libinfo.lib_list[i].loaded)
@@ -954,16 +940,8 @@
 		* (char *) --p =
 			((char *) page_address(bprm->page[i/PAGE_SIZE]))[i % PAGE_SIZE];
 
-#ifndef CONFIG_APP_STACK_L1
 	sp = (unsigned long *) create_flat_tables(p, bprm);
-#else
-	if (l1stack_base)
-		sp = (unsigned long *) create_flat_tables(p, bprm, l1stack_base +
-				stack_len - ramstack_top);
-	else
-		sp = (unsigned long *) create_flat_tables(p, bprm, 0);
-#endif
-
+	
 	/* Fake some return addresses to ensure the call chain will
 	 * initialise library in order for us.  We are required to call
 	 * lib 1 first, then 2, ... and finally the main program (id 0).
@@ -979,7 +957,7 @@
 		}
 	}
 #endif
-
+	
 	/* Stash our initial stack pointer into the mm structure */
 	current->mm->start_stack = (unsigned long )sp;
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to