*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
+ * Software Foundation; either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* more details.
*
* You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 675
- * Mass Ave, Cambridge, MA 02139, USA.
+ * this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
+#include "config.h"
#include <signal.h>
#include <string.h>
#include <stdio.h>
/* Forward declarations */
-static int batch PARAMS ((struct pstate *sregs, char *fname));
-static void set_rega PARAMS ((struct pstate *sregs, char *reg, uint32 rval));
-static void disp_reg PARAMS ((struct pstate *sregs, char *reg));
-static uint32 limcalc PARAMS ((float32 freq));
-static void int_handler PARAMS ((int32 sig));
-static void init_event PARAMS ((void));
-static int disp_fpu PARAMS ((struct pstate *sregs));
-static void disp_regs PARAMS ((struct pstate *sregs, int cwp));
-static void disp_ctrl PARAMS ((struct pstate *sregs));
-static void disp_mem PARAMS ((uint32 addr, uint32 len));
+static int batch (struct pstate *sregs, char *fname);
+static void set_rega (struct pstate *sregs, char *reg, uint32 rval);
+static void disp_reg (struct pstate *sregs, char *reg);
+static uint32 limcalc (float32 freq);
+static void int_handler (int32 sig);
+static void init_event (void);
+static int disp_fpu (struct pstate *sregs);
+static void disp_regs (struct pstate *sregs, int cwp);
+static void disp_ctrl (struct pstate *sregs);
+static void disp_mem (uint32 addr, uint32 len);
static int
batch(sregs, fname)
}
} else if (strncmp(cmd1, "cont", clen) == 0) {
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
- stat = run_sim(sregs, -1, 0);
+ stat = run_sim(sregs, UINT64_MAX, 0);
} else {
stat = run_sim(sregs, VAL(cmd1), 0);
}
if ((cmd2 = strtok(NULL, " \t\n\r")) != NULL) {
stat = run_sim(sregs, VAL(cmd2), 0);
} else {
- stat = run_sim(sregs, -1, 0);
+ stat = run_sim(sregs, UINT64_MAX, 0);
}
daddr = sregs->pc;
sim_halt();
reset_all();
reset_stat(sregs);
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
- stat = run_sim(sregs, -1, 0);
+ stat = run_sim(sregs, UINT64_MAX, 0);
} else {
stat = run_sim(sregs, VAL(cmd1), 0);
}
sim_halt();
} else if (strncmp(cmd1, "tcont", clen) == 0) {
sregs->tlimit = limcalc(sregs->freq);
- stat = run_sim(sregs, -1, 0);
+ stat = run_sim(sregs, UINT64_MAX, 0);
daddr = sregs->pc;
sim_halt();
} else if (strncmp(cmd1, "tgo", clen) == 0) {
sregs->pc = len & ~3;
sregs->npc = sregs->pc + 4;
printf("resuming at 0x%08x\n",sregs->pc);
- stat = run_sim(sregs, -1, 0);
+ stat = run_sim(sregs, UINT64_MAX, 0);
daddr = sregs->pc;
sim_halt();
} else if (strncmp(cmd1, "tlimit", clen) == 0) {
sregs->tlimit / sregs->freq / 1000);
} else if (strncmp(cmd1, "tra", clen) == 0) {
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
- stat = run_sim(sregs, -1, 1);
+ stat = run_sim(sregs, UINT64_MAX, 1);
} else {
stat = run_sim(sregs, VAL(cmd1), 1);
}
reset_all();
reset_stat(sregs);
sregs->tlimit = limcalc(sregs->freq);
- stat = run_sim(sregs, -1, 0);
+ stat = run_sim(sregs, UINT64_MAX, 0);
daddr = sregs->pc;
sim_halt();
} else
event(cfunc, arg, delta)
void (*cfunc) ();
int32 arg;
- uint32 delta;
+ uint64 delta;
{
struct evcell *ev1, *evins;
struct evcell *evrem;
void (*cfunc) ();
- uint32 arg, endtime;
+ uint32 arg;
+ uint64 endtime;
#ifdef STAT
sregs->fholdt += sregs->fhold;
{
struct evcell *evrem;
void (*cfunc) ();
- int32 arg, endtime;
+ int32 arg;
+ uint64 endtime;
if (ebase.eq.nxt == NULL)
printf("Warning: event queue empty - power-down mode not entered\n");
#include "ansidecl.h"
-#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "libiberty.h"
#include "bfd.h"