[openfirmware] [commit] r3788 - cpu/ppc/ppcsim
repository service
svn at openfirmware.info
Sat Nov 14 02:12:02 CET 2015
Author: quozl
Date: Sat Nov 14 02:12:02 2015
New Revision: 3788
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3788
Log:
ppcsim: modernize for ANSI C compilers
Contributed by Marcin Cieslak <saper at saper.info>
Modified:
cpu/ppc/ppcsim/ppcsim.c
cpu/ppc/ppcsim/simrom.c
Modified: cpu/ppc/ppcsim/ppcsim.c
==============================================================================
--- cpu/ppc/ppcsim/ppcsim.c Sat Nov 14 02:11:02 2015 (r3787)
+++ cpu/ppc/ppcsim/ppcsim.c Sat Nov 14 02:12:02 2015 (r3788)
@@ -39,6 +39,16 @@
#define ILLEGAL goto illegal
+void catch_signals();
+void trace(char *name, u_long instruction, u_long pc);
+int xfindnext(register u_char *adr,
+ register long strlen,
+ register long base,
+ register u_long link,
+ u_long *alf);
+
+void umtimes(u_long *dhighp, u_long *dlowp, u_long u1, u_long u2);
+
#ifdef TRACE
#define INSTR(a) trace(a, instruction, pc)
#else
@@ -1832,6 +1842,7 @@
}
+void
umtimes(dhighp, dlowp, u1, u2)
u_long *dhighp, *dlowp;
u_long u1, u2;
@@ -1868,6 +1879,7 @@
#ifdef TRACE
#include <sys/signal.h>
+void
dumpregs()
{
#ifdef ARGREGS
@@ -1916,6 +1928,7 @@
printf("\n");
#endif
}
+void
dumpallregs()
{
int i;
@@ -1937,6 +1950,8 @@
dumpregs();
s_bye(1);
}
+
+void
catch_signals()
{
signal(SIGINT,handle_signal);
@@ -1950,6 +1965,7 @@
#endif
}
+void
dumpmem(adr)
long adr;
{
@@ -1968,9 +1984,12 @@
#else
#define GETLINE
#endif
-trace(name, instruction)
+
+void
+trace(name, instruction, pc)
char *name;
u_long instruction;
+ u_long pc;
{
int done;
int arg;
Modified: cpu/ppc/ppcsim/simrom.c
==============================================================================
--- cpu/ppc/ppcsim/simrom.c Sat Nov 14 02:11:02 2015 (r3787)
+++ cpu/ppc/ppcsim/simrom.c Sat Nov 14 02:12:02 2015 (r3788)
@@ -3,13 +3,19 @@
* Main routine for calling the PowerPC simulator to simulate ROM images
*/
+#include <sys/types.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
extern void simulate();
-extern char *malloc();
char *loadaddr;
#define MEMSIZE 0x800000
+int
main()
{
int f;
More information about the openfirmware
mailing list