[OpenBIOS] r477 - forth/wrapper

svn at openbios.org svn at openbios.org
Fri Jul 20 03:00:03 CEST 2007


Author: wmb
Date: 2007-07-20 03:00:03 +0200 (Fri, 20 Jul 2007)
New Revision: 477

Modified:
   forth/wrapper/wrapper.c
Log:
wrapper: Improved the ifdef structure so it is slightly less hideous.



Modified: forth/wrapper/wrapper.c
===================================================================
--- forth/wrapper/wrapper.c	2007-07-20 00:34:15 UTC (rev 476)
+++ forth/wrapper/wrapper.c	2007-07-20 01:00:03 UTC (rev 477)
@@ -162,7 +162,6 @@
 #else
 # ifdef __i386__
 #  ifndef CKERNEL
-    char *host_cpu = "x86";
 #   define LinuxX86
 #   define HOST_LITTLE_ENDIAN
 #  endif
@@ -172,12 +171,8 @@
 
 #ifdef NT
 char *host_os = "nt";
-#ifdef POWERPC
-char *host_cpu = "powerpc";
-#else
 char *host_cpu = "x86";
 #endif
-#endif
 
 #ifdef OSF1
 char *host_os = "osf1";
@@ -185,7 +180,7 @@
 #endif
 
 
-#ifdef POWERPC
+#ifdef TARGET_POWERPC
 char *target_cpu = "powerpc";
 #ifndef LinuxPOWERPC
 #define TOCCALL
@@ -284,7 +279,7 @@
 
 #include <signal.h>
 
-#ifdef POWERPC
+#ifdef TARGET_POWERPC
 #ifdef LinuxPOWERPC
 #define NOGLUE
 #else
@@ -308,10 +303,6 @@
 #endif
 #endif
 
-#ifdef SIM
-#define HELPER
-#endif
-
 #ifdef WIN32
 #define isatty _isatty
 #define kbhit  _kbhit
@@ -352,7 +343,7 @@
 INTERNAL long	f_ioctl();
 INTERNAL long	f_lseek();
 INTERNAL long	f_crstr();
-#ifdef SIM
+#ifdef PPCSIM
 /* These are not INTERNAL because the PowerPC simulator uses then */
          long	c_key();
          long	s_bye();
@@ -397,9 +388,6 @@
 INTERNAL long   s_ioperm();
 INTERNAL long   f_mkdir();
 INTERNAL long   f_rmdir();
-#ifdef SIM
-INTERNAL long printnum();
-#endif
 #ifdef DLOPEN
 extern   long	dlopen(), dlsym(), dlerror(), dlclose();
 #endif
@@ -988,7 +976,7 @@
 	dictsize = sizeof(header) + imagesize +  extrasize ; 
 	dictsize += 16;		/* Allow for alignment */
 
-# ifdef SIM
+# ifdef PPCSIM
 	printf("PowerPC Instruction Set Simulator\n");
 	printf("Copyright 1994 FirmWorks   All rights reserved\n");
 # endif
@@ -1016,7 +1004,7 @@
 
 	f_close(f);
 
-# if defined(POWERPC) && defined(HOST_LITTLE_ENDIAN)
+# if defined(TARGET_POWERPC) && defined(HOST_LITTLE_ENDIAN)
 	lbflips((long *)(loadaddr + sizeof(header) + header.h_tlen),
 		header.h_dlen);
 	qlbflips((long *)(loadaddr + sizeof(header)),
@@ -1059,7 +1047,7 @@
 		 argc, argv));
 #endif
 
-#ifdef HELPER
+#ifdef PPCSIM
 	simulate(0L, loadaddr+sizeof(header)+START_OFFSET,
 		 loadaddr, functions, ((long)loadaddr+dictsize - 16) & ~15,
 		 argc, argv, 1 /* 0=POWER, 1=PowerPC */);
@@ -1081,7 +1069,7 @@
 	}
 # elif !defined(TOCCALL)
 
-#  ifdef POWERPC
+#  ifdef TARGET_POWERPC
 	s_bye((*(long (*) ())(loadaddr+sizeof(header)+START_OFFSET))
 		(loadaddr, ((char *)functions)+1, ((long)loadaddr+dictsize - 16) & ~15,
 		 argc, argv, 1));
@@ -2227,13 +2215,6 @@
 
 	return((long)mem);
 }
-#ifdef SIM
-INTERNAL long printnum(n1,n2,n3)
-long n1,n2,n3;
-{
-	printf("%x %x %x\n", n3,n2,n1);
-}
-#endif
 
 /* ARGSUSED */
 INTERNAL long




More information about the OpenBIOS mailing list