[openfirmware] [commit] r2833 - forth/wrapper

repository service svn at openfirmware.info
Tue Jan 17 01:07:05 CET 2012


Author: wmb
Date: Tue Jan 17 01:07:05 2012
New Revision: 2833
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2833

Log:
Wrapper - Fixed problem with wrapper running under ARM Linux, introduced by svn 2830.

Modified:
   forth/wrapper/wrapper.c

Modified: forth/wrapper/wrapper.c
==============================================================================
--- forth/wrapper/wrapper.c	Mon Jan 16 22:05:34 2012	(r2832)
+++ forth/wrapper/wrapper.c	Tue Jan 17 01:07:05 2012	(r2833)
@@ -697,6 +697,14 @@
 char bpval[MAXPATHLEN];
 char hostdirval[MAXPATHLEN];
 
+/*
+ * Set psuedo-environment-variable values for
+ *   ${BP}        - The top of the OFW build tree
+ *   ${HOSTDIR}   - The directory containing the host wrapper program
+ * Internal management of these values (see fetchenv()) eliminates the
+ * need for an external shell script to set them, thus making the build
+ * system more portable to platforms without Unix-style shells.
+ */
 void set_bp(void);
 void
 set_bp(void)
@@ -704,7 +712,16 @@
 	char here[MAXPATHLEN];
 	getcwd(here, MAXPATHLEN);
 	getcwd(bpval, MAXPATHLEN);
-	while (access("ofw", F_OK)) {
+	while (1) {
+		if (access(host_cpu, F_OK) == 0) {
+			getcwd(hostdirval, MAXPATHLEN);
+			strcat(hostdirval, "/");
+			strcat(hostdirval, host_cpu);
+			strcat(hostdirval, "/");
+			strcat(hostdirval, host_os);
+		}
+		if (access("ofw", F_OK) == 0)
+			break;
 		chdir("..");
 		getcwd(bpval, MAXPATHLEN);
 		if (strcmp(bpval, "/") == 0) {
@@ -1105,6 +1122,7 @@
 # endif
 #endif
 
+#ifdef __APPLE_CC__
 	{
 	/*
 	 * XCode specific behavior: if your function has a prototype, the compiler
@@ -1117,6 +1135,11 @@
 	fflush(stdout);
 	s_bye(func((char *)-1, functions, (long)loadaddr + memsize, argc, argv));
 	}
+#endif
+
+	s_bye((*(long (*) ())(loadaddr+sizeof(header)+START_OFFSET))
+		(loadaddr, functions, ((long)loadaddr+dictsize - 16) & ~15,
+		 argc, argv));
 
 	restoremode();
 	return 0;



More information about the openfirmware mailing list