remove PARAMS from sim

This removes the last uses of PARAMS from sim.

2014-01-06  Tom Tromey  <tromey@redhat.com>

	* README-HACKING: Don't use PARAMS.
	* arm/wrapper.c: Don't use PARAMS.
	* bfin/sim-main.h: Don't use PARAMS.
	* common/callback.c: Don't use PARAMS.
	* common/cgen-trace.c: Don't use PARAMS.
	* common/run-sim.h: Don't use PARAMS.
	* common/run.c: Don't use PARAMS.
	* common/sim-base.h: Don't use PARAMS.
	* common/sim-load.c: Don't use PARAMS.
	* common/sim-options.h: Don't use PARAMS.
	* common/sim-trace.c: Don't use PARAMS.
	* common/sim-trace.h: Don't use PARAMS.
	* common/sim-utils.h: Don't use PARAMS.
	* cr16/cr16_sim.h: Don't use PARAMS.
	* cr16/gencode.c: Don't use PARAMS.
	* cr16/interp.c: Don't use PARAMS.
	* cr16/simops.c: Don't use PARAMS.
	* d10v/d10v_sim.h: Don't use PARAMS.
	* d10v/gencode.c: Don't use PARAMS.
	* d10v/interp.c: Don't use PARAMS.
	* d10v/simops.c: Don't use PARAMS.
	* erc32/erc32.c: Don't use PARAMS.
	* erc32/exec.c: Don't use PARAMS.
	* erc32/float.c: Don't use PARAMS.
	* erc32/func.c: Don't use PARAMS.
	* erc32/sis.c: Don't use PARAMS.
	* erc32/sis.h: Don't use PARAMS.
	* mips/interp.c: Don't use PARAMS.
	* mips/sim-main.h: Don't use PARAMS.
	* sh/interp.c: Don't use PARAMS.
	* v850/sim-main.h: Don't use PARAMS.
	* v850/v850_sim.h: Don't use PARAMS.
This commit is contained in:
Tom Tromey 2014-01-04 21:43:21 -07:00
parent 1f635d209e
commit bdca5ee4bc
33 changed files with 448 additions and 419 deletions

View File

@ -1,3 +1,38 @@
2014-01-06 Tom Tromey <tromey@redhat.com>
* README-HACKING: Don't use PARAMS.
* arm/wrapper.c: Don't use PARAMS.
* bfin/sim-main.h: Don't use PARAMS.
* common/callback.c: Don't use PARAMS.
* common/cgen-trace.c: Don't use PARAMS.
* common/run-sim.h: Don't use PARAMS.
* common/run.c: Don't use PARAMS.
* common/sim-base.h: Don't use PARAMS.
* common/sim-load.c: Don't use PARAMS.
* common/sim-options.h: Don't use PARAMS.
* common/sim-trace.c: Don't use PARAMS.
* common/sim-trace.h: Don't use PARAMS.
* common/sim-utils.h: Don't use PARAMS.
* cr16/cr16_sim.h: Don't use PARAMS.
* cr16/gencode.c: Don't use PARAMS.
* cr16/interp.c: Don't use PARAMS.
* cr16/simops.c: Don't use PARAMS.
* d10v/d10v_sim.h: Don't use PARAMS.
* d10v/gencode.c: Don't use PARAMS.
* d10v/interp.c: Don't use PARAMS.
* d10v/simops.c: Don't use PARAMS.
* erc32/erc32.c: Don't use PARAMS.
* erc32/exec.c: Don't use PARAMS.
* erc32/float.c: Don't use PARAMS.
* erc32/func.c: Don't use PARAMS.
* erc32/sis.c: Don't use PARAMS.
* erc32/sis.h: Don't use PARAMS.
* mips/interp.c: Don't use PARAMS.
* mips/sim-main.h: Don't use PARAMS.
* sh/interp.c: Don't use PARAMS.
* v850/sim-main.h: Don't use PARAMS.
* v850/v850_sim.h: Don't use PARAMS.
2013-11-07 Will Newton <will.newton@linaro.org> 2013-11-07 Will Newton <will.newton@linaro.org>
PR gdb/15508 PR gdb/15508

View File

@ -175,9 +175,7 @@ C Language Assumptions
The programmer may assume that the simulator is being built using an The programmer may assume that the simulator is being built using an
ANSI C compiler that supports a 64 bit data type. Consequently: ANSI C compiler that supports a 64 bit data type. Consequently:
o prototypes can be used (although using o prototypes can be used
PARAMS() and K&R declarations wouldn't
go astray).
o If sim-types.h is included, the two o If sim-types.h is included, the two
types signed64 and unsigned64 are types signed64 and unsigned64 are

View File

@ -132,9 +132,9 @@ sim_size (size)
} }
void void
ARMul_ConsolePrint VPARAMS ((ARMul_State * state, ARMul_ConsolePrint (ARMul_State * state,
const char * format, const char * format,
...)) ...)
{ {
va_list ap; va_list ap;
@ -678,7 +678,7 @@ sim_fetch_register (sd, rn, memory, length)
#ifdef SIM_TARGET_SWITCHES #ifdef SIM_TARGET_SWITCHES
static void sim_target_parse_arg_array PARAMS ((char **)); static void sim_target_parse_arg_array (char **);
typedef struct typedef struct
{ {

View File

@ -99,10 +99,10 @@ struct sim_state {
bfin_trace_queue (cpu, oldpc, newpc, hwloop); \ bfin_trace_queue (cpu, oldpc, newpc, hwloop); \
} while (0) } while (0)
extern void trace_register PARAMS ((SIM_DESC sd, extern void trace_register (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
const char *fmt, const char *fmt,
...)) ...)
__attribute__((format (printf, 3, 4))); __attribute__((format (printf, 3, 4)));
#define TRACE_REGISTER(cpu, fmt, ...) \ #define TRACE_REGISTER(cpu, fmt, ...) \
do { \ do { \

View File

@ -62,43 +62,43 @@
/* ??? sim_cb_printf should be cb_printf, but until the callback support is /* ??? sim_cb_printf should be cb_printf, but until the callback support is
broken out of the simulator directory, these are here to not require broken out of the simulator directory, these are here to not require
sim-utils.h. */ sim-utils.h. */
void sim_cb_printf PARAMS ((host_callback *, const char *, ...)); void sim_cb_printf (host_callback *, const char *, ...);
void sim_cb_eprintf PARAMS ((host_callback *, const char *, ...)); void sim_cb_eprintf (host_callback *, const char *, ...);
extern CB_TARGET_DEFS_MAP cb_init_syscall_map[]; extern CB_TARGET_DEFS_MAP cb_init_syscall_map[];
extern CB_TARGET_DEFS_MAP cb_init_errno_map[]; extern CB_TARGET_DEFS_MAP cb_init_errno_map[];
extern CB_TARGET_DEFS_MAP cb_init_open_map[]; extern CB_TARGET_DEFS_MAP cb_init_open_map[];
extern int system PARAMS ((const char *)); extern int system (const char *);
static int os_init PARAMS ((host_callback *)); static int os_init (host_callback *);
static int os_shutdown PARAMS ((host_callback *)); static int os_shutdown (host_callback *);
static int os_unlink PARAMS ((host_callback *, const char *)); static int os_unlink (host_callback *, const char *);
static long os_time PARAMS ((host_callback *, long *)); static long os_time (host_callback *, long *);
static int os_system PARAMS ((host_callback *, const char *)); static int os_system (host_callback *, const char *);
static int os_rename PARAMS ((host_callback *, const char *, const char *)); static int os_rename (host_callback *, const char *, const char *);
static int os_write_stdout PARAMS ((host_callback *, const char *, int)); static int os_write_stdout (host_callback *, const char *, int);
static void os_flush_stdout PARAMS ((host_callback *)); static void os_flush_stdout (host_callback *);
static int os_write_stderr PARAMS ((host_callback *, const char *, int)); static int os_write_stderr (host_callback *, const char *, int);
static void os_flush_stderr PARAMS ((host_callback *)); static void os_flush_stderr (host_callback *);
static int os_write PARAMS ((host_callback *, int, const char *, int)); static int os_write (host_callback *, int, const char *, int);
static int os_read_stdin PARAMS ((host_callback *, char *, int)); static int os_read_stdin (host_callback *, char *, int);
static int os_read PARAMS ((host_callback *, int, char *, int)); static int os_read (host_callback *, int, char *, int);
static int os_open PARAMS ((host_callback *, const char *, int)); static int os_open (host_callback *, const char *, int);
static int os_lseek PARAMS ((host_callback *, int, long, int)); static int os_lseek (host_callback *, int, long, int);
static int os_isatty PARAMS ((host_callback *, int)); static int os_isatty (host_callback *, int);
static int os_get_errno PARAMS ((host_callback *)); static int os_get_errno (host_callback *);
static int os_close PARAMS ((host_callback *, int)); static int os_close (host_callback *, int);
static void os_vprintf_filtered PARAMS ((host_callback *, const char *, va_list)); static void os_vprintf_filtered (host_callback *, const char *, va_list);
static void os_evprintf_filtered PARAMS ((host_callback *, const char *, va_list)); static void os_evprintf_filtered (host_callback *, const char *, va_list);
static void os_error PARAMS ((host_callback *, const char *, ...)) static void os_error (host_callback *, const char *, ...)
#ifdef __GNUC__ #ifdef __GNUC__
__attribute__ ((__noreturn__)) __attribute__ ((__noreturn__))
#endif #endif
; ;
static int fdmap PARAMS ((host_callback *, int)); static int fdmap (host_callback *, int);
static int fdbad PARAMS ((host_callback *, int)); static int fdbad (host_callback *, int);
static int wrap PARAMS ((host_callback *, int)); static int wrap (host_callback *, int);
/* Set the callback copy of errno from what we see now. */ /* Set the callback copy of errno from what we see now. */

View File

@ -299,7 +299,7 @@ cgen_trace_printf (SIM_CPU *cpu, char *fmt, ...)
/* sprintf to a "stream" */ /* sprintf to a "stream" */
int int
sim_disasm_sprintf VPARAMS ((SFILE *f, const char *format, ...)) sim_disasm_sprintf (SFILE *f, const char *format, ...)
{ {
#ifndef __STDC__ #ifndef __STDC__
SFILE *f; SFILE *f;

View File

@ -26,11 +26,11 @@
/* Parse the command line, extracting any target specific switches /* Parse the command line, extracting any target specific switches
before the generic simulator code gets a chance to complain before the generic simulator code gets a chance to complain
about them. Returns the adjusted value of argc. */ about them. Returns the adjusted value of argc. */
int sim_target_parse_command_line PARAMS ((int, char **)); int sim_target_parse_command_line (int, char **);
/* Display a list of target specific switches supported by this /* Display a list of target specific switches supported by this
target. */ target. */
void sim_target_display_usage PARAMS ((int help)); void sim_target_display_usage (int help);
#endif #endif
@ -40,7 +40,7 @@ void sim_target_display_usage PARAMS ((int help));
This procedure does not take a SIM_DESC argument as it is This procedure does not take a SIM_DESC argument as it is
used before sim_open. */ used before sim_open. */
void sim_set_callbacks PARAMS ((struct host_callback_struct *)); void sim_set_callbacks (struct host_callback_struct *);
/* Set the size of the simulator memory array. /* Set the size of the simulator memory array.
@ -49,7 +49,7 @@ void sim_set_callbacks PARAMS ((struct host_callback_struct *));
This procedure does not take a SIM_DESC argument as it is This procedure does not take a SIM_DESC argument as it is
used before sim_open. */ used before sim_open. */
void sim_size PARAMS ((int i)); void sim_size (int i);
/* Single-step simulator with tracing enabled. /* Single-step simulator with tracing enabled.
@ -60,7 +60,7 @@ void sim_size PARAMS ((int i));
be continued using sim_trace() calls; ``1'' indicating that the be continued using sim_trace() calls; ``1'' indicating that the
simulation has finished. */ simulation has finished. */
int sim_trace PARAMS ((SIM_DESC sd)); int sim_trace (SIM_DESC sd);
/* Enable tracing. /* Enable tracing.
@ -70,7 +70,7 @@ int sim_trace PARAMS ((SIM_DESC sd));
be continued using sim_trace() calls; ``1'' indicating that the be continued using sim_trace() calls; ``1'' indicating that the
simulation has finished. */ simulation has finished. */
void sim_set_trace PARAMS ((void)); void sim_set_trace (void);
/* Configure the size of the profile buffer. /* Configure the size of the profile buffer.
@ -79,7 +79,7 @@ void sim_set_trace PARAMS ((void));
This procedure does not take a SIM_DESC argument as it is This procedure does not take a SIM_DESC argument as it is
used before sim_open. */ used before sim_open. */
void sim_set_profile_size PARAMS ((int n)); void sim_set_profile_size (int n);
/* Kill the running program. /* Kill the running program.
@ -88,6 +88,6 @@ void sim_set_profile_size PARAMS ((int n));
This procedure will be replaced as part of the introduction of This procedure will be replaced as part of the introduction of
multi-cpu simulators. */ multi-cpu simulators. */
void sim_kill PARAMS ((SIM_DESC sd)); void sim_kill (SIM_DESC sd);
#endif #endif

View File

@ -50,8 +50,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "run-sim.h" #include "run-sim.h"
#include "version.h" #include "version.h"
static void usage PARAMS ((int help)); static void usage (int help);
static void print_version PARAMS ((void)); static void print_version (void);
extern int optind; extern int optind;
extern char *optarg; extern char *optarg;
@ -63,7 +63,7 @@ extern int getopt ();
#ifdef NEED_UI_LOOP_HOOK #ifdef NEED_UI_LOOP_HOOK
/* Gdb foolery. This is only needed for gdb using a gui. */ /* Gdb foolery. This is only needed for gdb using a gui. */
int (*deprecated_ui_loop_hook) PARAMS ((int signo)); int (*deprecated_ui_loop_hook) (int signo);
#endif #endif
static SIM_DESC sd; static SIM_DESC sd;

View File

@ -244,7 +244,7 @@ typedef struct {
} sim_state_base; } sim_state_base;
/* Functions for allocating/freeing a sim_state. */ /* Functions for allocating/freeing a sim_state. */
SIM_DESC sim_state_alloc PARAMS ((SIM_OPEN_KIND kind, host_callback *callback)); SIM_DESC sim_state_alloc (SIM_OPEN_KIND kind, host_callback *callback);
void sim_state_free PARAMS ((SIM_DESC)); void sim_state_free (SIM_DESC);
#endif /* SIM_BASE_H */ #endif /* SIM_BASE_H */

View File

@ -36,11 +36,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "gdb/callback.h" #include "gdb/callback.h"
#include "gdb/remote-sim.h" #include "gdb/remote-sim.h"
static void eprintf PARAMS ((host_callback *, const char *, ...)); static void eprintf (host_callback *, const char *, ...);
static void xprintf PARAMS ((host_callback *, const char *, ...)); static void xprintf (host_callback *, const char *, ...);
static void report_transfer_performance static void report_transfer_performance
PARAMS ((host_callback *, unsigned long, time_t, time_t)); (host_callback *, unsigned long, time_t, time_t);
static void xprintf_bfd_vma PARAMS ((host_callback *, bfd_vma)); static void xprintf_bfd_vma (host_callback *, bfd_vma);
/* Load program PROG into the simulator using the function DO_LOAD. /* Load program PROG into the simulator using the function DO_LOAD.
If PROG_BFD is non-NULL, the file has already been opened. If PROG_BFD is non-NULL, the file has already been opened.
@ -169,7 +169,7 @@ sim_load_file (sd, myname, callback, prog, prog_bfd, verbose_p, lma_p, do_write)
} }
static void static void
xprintf VPARAMS ((host_callback *callback, const char *fmt, ...)) xprintf (host_callback *callback, const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -181,7 +181,7 @@ xprintf VPARAMS ((host_callback *callback, const char *fmt, ...))
} }
static void static void
eprintf VPARAMS ((host_callback *callback, const char *fmt, ...)) eprintf (host_callback *callback, const char *fmt, ...)
{ {
va_list ap; va_list ap;

View File

@ -33,10 +33,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
argument, NULL if optional and missing; arg#5 is nonzero if a argument, NULL if optional and missing; arg#5 is nonzero if a
command is being interpreted. */ command is being interpreted. */
typedef SIM_RC (OPTION_HANDLER) PARAMS ((SIM_DESC, sim_cpu *, int, char *, int)); typedef SIM_RC (OPTION_HANDLER) (SIM_DESC, sim_cpu *, int, char *, int);
/* Declare option handlers with a macro so it's usable on k&r systems. */ /* Declare option handlers with a macro so it's usable on k&r systems. */
#define DECLARE_OPTION_HANDLER(fn) SIM_RC fn PARAMS ((SIM_DESC, sim_cpu *, int, char *, int)) #define DECLARE_OPTION_HANDLER(fn) SIM_RC fn (SIM_DESC, sim_cpu *, int, char *, int)
typedef struct { typedef struct {
@ -129,20 +129,20 @@ typedef struct option_list {
/* Add a set of options to the simulator. /* Add a set of options to the simulator.
CPU is the cpu the options apply to or NULL for all cpus. CPU is the cpu the options apply to or NULL for all cpus.
TABLE is an array of OPTIONS terminated by a NULL `opt.name' entry. */ TABLE is an array of OPTIONS terminated by a NULL `opt.name' entry. */
SIM_RC sim_add_option_table PARAMS ((SIM_DESC sd, sim_cpu *cpu, const OPTION *table)); SIM_RC sim_add_option_table (SIM_DESC sd, sim_cpu *cpu, const OPTION *table);
/* Install handler for the standard options. */ /* Install handler for the standard options. */
MODULE_INSTALL_FN standard_install; MODULE_INSTALL_FN standard_install;
/* Called by sim_open to parse the arguments. */ /* Called by sim_open to parse the arguments. */
SIM_RC sim_parse_args PARAMS ((SIM_DESC sd, char **argv)); SIM_RC sim_parse_args (SIM_DESC sd, char **argv);
/* Print help messages for the options. IS_COMMAND is non-zero when /* Print help messages for the options. IS_COMMAND is non-zero when
this function is called from the command line interpreter. */ this function is called from the command line interpreter. */
void sim_print_help PARAMS ((SIM_DESC sd, int is_command)); void sim_print_help (SIM_DESC sd, int is_command);
/* Try to parse the command as if it is an option, Only fail when /* Try to parse the command as if it is an option, Only fail when
totally unsuccessful */ totally unsuccessful */
SIM_RC sim_args_command PARAMS ((SIM_DESC sd, char *cmd)); SIM_RC sim_args_command (SIM_DESC sd, char *cmd);
#endif /* SIM_OPTIONS_H */ #endif /* SIM_OPTIONS_H */

View File

@ -1300,7 +1300,7 @@ trace_one_insn (SIM_DESC sd, sim_cpu *cpu, address_word pc,
} }
void void
trace_printf VPARAMS ((SIM_DESC sd, sim_cpu *cpu, const char *fmt, ...)) trace_printf (SIM_DESC sd, sim_cpu *cpu, const char *fmt, ...)
{ {
#if !defined __STDC__ && !defined ALMOST_STDC #if !defined __STDC__ && !defined ALMOST_STDC
SIM_DESC sd; SIM_DESC sd;
@ -1322,7 +1322,7 @@ trace_printf VPARAMS ((SIM_DESC sd, sim_cpu *cpu, const char *fmt, ...))
} }
void void
debug_printf VPARAMS ((sim_cpu *cpu, const char *fmt, ...)) debug_printf (sim_cpu *cpu, const char *fmt, ...)
{ {
#if !defined __STDC__ && !defined ALMOST_STDC #if !defined __STDC__ && !defined ALMOST_STDC
sim_cpu *cpu; sim_cpu *cpu;

View File

@ -228,24 +228,24 @@ typedef struct _trace_data {
/* Prime the trace buffers ready for any trace output. /* Prime the trace buffers ready for any trace output.
Must be called prior to any other trace operation */ Must be called prior to any other trace operation */
extern void trace_prefix PARAMS ((SIM_DESC sd, extern void trace_prefix (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
sim_cia cia, sim_cia cia,
address_word pc, address_word pc,
int print_linenum_p, int print_linenum_p,
const char *file_name, const char *file_name,
int line_nr, int line_nr,
const char *fmt, const char *fmt,
...)) ...)
__attribute__((format (printf, 8, 9))); __attribute__((format (printf, 8, 9)));
/* Generic trace print, assumes trace_prefix() has been called */ /* Generic trace print, assumes trace_prefix() has been called */
extern void trace_generic PARAMS ((SIM_DESC sd, extern void trace_generic (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
const char *fmt, const char *fmt,
...)) ...)
__attribute__((format (printf, 4, 5))); __attribute__((format (printf, 4, 5)));
typedef enum { typedef enum {
@ -262,149 +262,149 @@ typedef enum {
/* Trace a varying number of word sized inputs/outputs. trace_result* /* Trace a varying number of word sized inputs/outputs. trace_result*
must be called to close the trace operation. */ must be called to close the trace operation. */
extern void save_data PARAMS ((SIM_DESC sd, extern void save_data (SIM_DESC sd,
TRACE_DATA *data, TRACE_DATA *data,
data_fmt fmt, data_fmt fmt,
long size, long size,
const void *buf)); const void *buf);
extern void trace_input0 PARAMS ((SIM_DESC sd, extern void trace_input0 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx)); int trace_idx);
extern void trace_input_word1 PARAMS ((SIM_DESC sd, extern void trace_input_word1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
unsigned_word d0)); unsigned_word d0);
extern void trace_input_word2 PARAMS ((SIM_DESC sd, extern void trace_input_word2 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
unsigned_word d0, unsigned_word d0,
unsigned_word d1)); unsigned_word d1);
extern void trace_input_word3 PARAMS ((SIM_DESC sd, extern void trace_input_word3 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
unsigned_word d0, unsigned_word d0,
unsigned_word d1, unsigned_word d1,
unsigned_word d2)); unsigned_word d2);
extern void trace_input_word4 PARAMS ((SIM_DESC sd, extern void trace_input_word4 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
unsigned_word d0, unsigned_word d0,
unsigned_word d1, unsigned_word d1,
unsigned_word d2, unsigned_word d2,
unsigned_word d3)); unsigned_word d3);
extern void trace_input_addr1 PARAMS ((SIM_DESC sd, extern void trace_input_addr1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
address_word d0)); address_word d0);
extern void trace_input_bool1 PARAMS ((SIM_DESC sd, extern void trace_input_bool1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
int d0)); int d0);
extern void trace_input_fp1 PARAMS ((SIM_DESC sd, extern void trace_input_fp1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
fp_word f0)); fp_word f0);
extern void trace_input_fp2 PARAMS ((SIM_DESC sd, extern void trace_input_fp2 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
fp_word f0, fp_word f0,
fp_word f1)); fp_word f1);
extern void trace_input_fp3 PARAMS ((SIM_DESC sd, extern void trace_input_fp3 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
fp_word f0, fp_word f0,
fp_word f1, fp_word f1,
fp_word f2)); fp_word f2);
extern void trace_input_fpu1 PARAMS ((SIM_DESC sd, extern void trace_input_fpu1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
struct _sim_fpu *f0)); struct _sim_fpu *f0);
extern void trace_input_fpu2 PARAMS ((SIM_DESC sd, extern void trace_input_fpu2 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
struct _sim_fpu *f0, struct _sim_fpu *f0,
struct _sim_fpu *f1)); struct _sim_fpu *f1);
extern void trace_input_fpu3 PARAMS ((SIM_DESC sd, extern void trace_input_fpu3 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
struct _sim_fpu *f0, struct _sim_fpu *f0,
struct _sim_fpu *f1, struct _sim_fpu *f1,
struct _sim_fpu *f2)); struct _sim_fpu *f2);
/* Other trace_input{_<fmt><nr-inputs>} functions can go here */ /* Other trace_input{_<fmt><nr-inputs>} functions can go here */
extern void trace_result0 PARAMS ((SIM_DESC sd, extern void trace_result0 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx)); int trace_idx);
extern void trace_result_word1 PARAMS ((SIM_DESC sd, extern void trace_result_word1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
unsigned_word r0)); unsigned_word r0);
extern void trace_result_word2 PARAMS ((SIM_DESC sd, extern void trace_result_word2 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
unsigned_word r0,
unsigned_word r1);
extern void trace_result_word4 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
unsigned_word r0,
unsigned_word r1,
unsigned_word r2,
unsigned_word r3);
extern void trace_result_bool1 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
int r0);
extern void trace_result_addr1 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
address_word r0);
extern void trace_result_fp1 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
fp_word f0);
extern void trace_result_fp2 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
fp_word f0,
fp_word f1);
extern void trace_result_fpu1 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
struct _sim_fpu *f0);
extern void trace_result_string1 (SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
char *str0);
extern void trace_result_word1_string1 (SIM_DESC sd,
sim_cpu *cpu, sim_cpu *cpu,
int trace_idx, int trace_idx,
unsigned_word r0, unsigned_word r0,
unsigned_word r1)); char *s0);
extern void trace_result_word4 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
unsigned_word r0,
unsigned_word r1,
unsigned_word r2,
unsigned_word r3));
extern void trace_result_bool1 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
int r0));
extern void trace_result_addr1 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
address_word r0));
extern void trace_result_fp1 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
fp_word f0));
extern void trace_result_fp2 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
fp_word f0,
fp_word f1));
extern void trace_result_fpu1 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
struct _sim_fpu *f0));
extern void trace_result_string1 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
char *str0));
extern void trace_result_word1_string1 PARAMS ((SIM_DESC sd,
sim_cpu *cpu,
int trace_idx,
unsigned_word r0,
char *s0));
/* Other trace_result{_<type><nr-results>} */ /* Other trace_result{_<type><nr-results>} */
@ -555,21 +555,21 @@ do { \
/* The function trace_one_insn has been replaced by the function pair /* The function trace_one_insn has been replaced by the function pair
trace_prefix() + trace_generic() */ trace_prefix() + trace_generic() */
extern void trace_one_insn PARAMS ((SIM_DESC sd, extern void trace_one_insn (SIM_DESC sd,
sim_cpu * cpu, sim_cpu * cpu,
address_word cia, address_word cia,
int print_linenum_p, int print_linenum_p,
const char *file_name, const char *file_name,
int line_nr, int line_nr,
const char *unit, const char *unit,
const char *fmt, const char *fmt,
...)) ...)
__attribute__((format (printf, 8, 9))); __attribute__((format (printf, 8, 9)));
extern void trace_printf PARAMS ((SIM_DESC, sim_cpu *, const char *, ...)) extern void trace_printf (SIM_DESC, sim_cpu *, const char *, ...)
__attribute__((format (printf, 3, 4))); __attribute__((format (printf, 3, 4)));
extern void trace_vprintf PARAMS ((SIM_DESC, sim_cpu *, const char *, va_list)); extern void trace_vprintf (SIM_DESC, sim_cpu *, const char *, va_list);
/* Debug support. /* Debug support.
This is included here because there isn't enough of it to justify This is included here because there isn't enough of it to justify
@ -583,7 +583,7 @@ extern void trace_vprintf PARAMS ((SIM_DESC, sim_cpu *, const char *, va_list));
/* Non-zero if "--debug-insn" specified. */ /* Non-zero if "--debug-insn" specified. */
#define DEBUG_INSN_P(cpu) DEBUG_P (cpu, DEBUG_INSN_IDX) #define DEBUG_INSN_P(cpu) DEBUG_P (cpu, DEBUG_INSN_IDX)
extern void debug_printf PARAMS ((sim_cpu *, const char *, ...)) extern void debug_printf (sim_cpu *, const char *, ...)
__attribute__((format (printf, 2, 3))); __attribute__((format (printf, 2, 3)));
#endif /* SIM_TRACE_H */ #endif /* SIM_TRACE_H */

View File

@ -60,8 +60,8 @@ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
write the program sections at LMA interpreted as a virtual address. write the program sections at LMA interpreted as a virtual address.
This is still accommodated for backward compatibility reasons. */ This is still accommodated for backward compatibility reasons. */
typedef int sim_write_fn PARAMS ((SIM_DESC sd, SIM_ADDR mem, typedef int sim_write_fn (SIM_DESC sd, SIM_ADDR mem,
const unsigned char *buf, int length)); const unsigned char *buf, int length);
struct bfd *sim_load_file (SIM_DESC sd, const char *myname, struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
host_callback *callback, char *prog, host_callback *callback, char *prog,
struct bfd *prog_bfd, int verbose_p, struct bfd *prog_bfd, int verbose_p,

View File

@ -421,8 +421,8 @@ enum
#define SEXT32(x) ((((x)&0xffffffff)^(~0x7fffffff))+0x80000000) #define SEXT32(x) ((((x)&0xffffffff)^(~0x7fffffff))+0x80000000)
extern uint8 *dmem_addr (uint32 offset); extern uint8 *dmem_addr (uint32 offset);
extern uint8 *imem_addr PARAMS ((uint32)); extern uint8 *imem_addr (uint32);
extern bfd_vma decode_pc PARAMS ((void)); extern bfd_vma decode_pc (void);
#define RB(x) (*(dmem_addr(x))) #define RB(x) (*(dmem_addr(x)))
#define SB(addr,data) ( RB(addr) = (data & 0xff)) #define SB(addr,data) ( RB(addr) = (data & 0xff))
@ -433,12 +433,12 @@ extern bfd_vma decode_pc PARAMS ((void));
#undef ENDIAN_INLINE #undef ENDIAN_INLINE
#else #else
extern uint32 get_longword PARAMS ((uint8 *)); extern uint32 get_longword (uint8 *);
extern uint16 get_word PARAMS ((uint8 *)); extern uint16 get_word (uint8 *);
extern int64 get_longlong PARAMS ((uint8 *)); extern int64 get_longlong (uint8 *);
extern void write_word PARAMS ((uint8 *addr, uint16 data)); extern void write_word (uint8 *addr, uint16 data);
extern void write_longword PARAMS ((uint8 *addr, uint32 data)); extern void write_longword (uint8 *addr, uint32 data);
extern void write_longlong PARAMS ((uint8 *addr, int64 data)); extern void write_longlong (uint8 *addr, int64 data);
#endif #endif
#define SW(addr,data) write_word(dmem_addr(addr),data) #define SW(addr,data) write_word(dmem_addr(addr),data)

View File

@ -25,9 +25,9 @@
#include "ansidecl.h" #include "ansidecl.h"
#include "opcode/cr16.h" #include "opcode/cr16.h"
static void write_header PARAMS ((void)); static void write_header (void);
static void write_opcodes PARAMS ((void)); static void write_opcodes (void);
static void write_template PARAMS ((void)); static void write_template (void);
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
@ -53,7 +53,7 @@ write_header ()
/* Loop over instruction table until a full match is found. */ /* Loop over instruction table until a full match is found. */
for ( ; i < NUMOPCODES; i++) for ( ; i < NUMOPCODES; i++)
{ {
printf("void OP_%X_%X PARAMS ((void));\t\t/* %s */\n",cr16_instruction[i].match, (32 - cr16_instruction[i].match_bits), cr16_instruction[i].mnemonic); printf("void OP_%X_%X (void);\t\t/* %s */\n",cr16_instruction[i].match, (32 - cr16_instruction[i].match_bits), cr16_instruction[i].mnemonic);
} }
} }

View File

@ -52,12 +52,12 @@ asection *text;
bfd_vma text_start; bfd_vma text_start;
bfd_vma text_end; bfd_vma text_end;
static struct hash_entry *lookup_hash PARAMS ((uint64 ins, int size)); static struct hash_entry *lookup_hash (uint64 ins, int size);
static void get_operands PARAMS ((operand_desc *s, uint64 mcode, int isize, int nops)); static void get_operands (operand_desc *s, uint64 mcode, int isize, int nops);
static int do_run PARAMS ((uint64 mc)); static int do_run (uint64 mc);
static char *add_commas PARAMS ((char *buf, int sizeof_buf, unsigned long value)); static char *add_commas (char *buf, int sizeof_buf, unsigned long value);
extern void sim_set_profile PARAMS ((int n)); extern void sim_set_profile (int n);
extern void sim_set_profile_size PARAMS ((int n)); extern void sim_set_profile_size (int n);
static INLINE uint8 *map_memory (unsigned phys_addr); static INLINE uint8 *map_memory (unsigned phys_addr);
#ifdef NEED_UI_LOOP_HOOK #ifdef NEED_UI_LOOP_HOOK
@ -68,7 +68,7 @@ static INLINE uint8 *map_memory (unsigned phys_addr);
static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL; static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
/* Actual hook to call to run through gdb's gui event loop */ /* Actual hook to call to run through gdb's gui event loop */
extern int (*deprecated_ui_loop_hook) PARAMS ((int signo)); extern int (*deprecated_ui_loop_hook) (int signo);
#endif /* NEED_UI_LOOP_HOOK */ #endif /* NEED_UI_LOOP_HOOK */
#ifndef INLINE #ifndef INLINE

View File

@ -189,10 +189,10 @@ move_to_cr (int cr, creg_t mask, creg_t val, int psw_hw_p)
} }
#ifdef DEBUG #ifdef DEBUG
static void trace_input_func PARAMS ((char *name, static void trace_input_func (char *name,
enum op_types in1, enum op_types in1,
enum op_types in2, enum op_types in2,
enum op_types in3)); enum op_types in3);
#define trace_input(name, in1, in2, in3) do { if (cr16_debug) trace_input_func (name, in1, in2, in3); } while (0) #define trace_input(name, in1, in2, in3) do { if (cr16_debug) trace_input_func (name, in1, in2, in3); } while (0)

View File

@ -442,8 +442,8 @@ do \
while (0) while (0)
extern uint8 *dmem_addr (uint16 offset); extern uint8 *dmem_addr (uint16 offset);
extern uint8 *imem_addr PARAMS ((uint32)); extern uint8 *imem_addr (uint32);
extern bfd_vma decode_pc PARAMS ((void)); extern bfd_vma decode_pc (void);
#define RB(x) (*(dmem_addr(x))) #define RB(x) (*(dmem_addr(x)))
#define SB(addr,data) ( RB(addr) = (data & 0xff)) #define SB(addr,data) ( RB(addr) = (data & 0xff))
@ -454,12 +454,12 @@ extern bfd_vma decode_pc PARAMS ((void));
#undef ENDIAN_INLINE #undef ENDIAN_INLINE
#else #else
extern uint32 get_longword PARAMS ((uint8 *)); extern uint32 get_longword (uint8 *);
extern uint16 get_word PARAMS ((uint8 *)); extern uint16 get_word (uint8 *);
extern int64 get_longlong PARAMS ((uint8 *)); extern int64 get_longlong (uint8 *);
extern void write_word PARAMS ((uint8 *addr, uint16 data)); extern void write_word (uint8 *addr, uint16 data);
extern void write_longword PARAMS ((uint8 *addr, uint32 data)); extern void write_longword (uint8 *addr, uint32 data);
extern void write_longlong PARAMS ((uint8 *addr, int64 data)); extern void write_longlong (uint8 *addr, int64 data);
#endif #endif
#define SW(addr,data) write_word(dmem_addr(addr),data) #define SW(addr,data) write_word(dmem_addr(addr),data)

View File

@ -5,9 +5,9 @@
#include "ansidecl.h" #include "ansidecl.h"
#include "opcode/d10v.h" #include "opcode/d10v.h"
static void write_header PARAMS ((void)); static void write_header (void);
static void write_opcodes PARAMS ((void)); static void write_opcodes (void);
static void write_template PARAMS ((void)); static void write_template (void);
int int
main (argc, argv) main (argc, argv)
@ -31,7 +31,7 @@ write_header ()
for (opcode = (struct d10v_opcode *)d10v_opcodes; opcode->name; opcode++) for (opcode = (struct d10v_opcode *)d10v_opcodes; opcode->name; opcode++)
if (opcode->format != OPCODE_FAKE) if (opcode->format != OPCODE_FAKE)
printf("void OP_%X PARAMS ((void));\t\t/* %s */\n",opcode->opcode, opcode->name); printf("void OP_%X (void);\t\t/* %s */\n",opcode->opcode, opcode->name);
} }

View File

@ -43,15 +43,15 @@ asection *text;
bfd_vma text_start; bfd_vma text_start;
bfd_vma text_end; bfd_vma text_end;
static long hash PARAMS ((long insn, int format)); static long hash (long insn, int format);
static struct hash_entry *lookup_hash PARAMS ((uint32 ins, int size)); static struct hash_entry *lookup_hash (uint32 ins, int size);
static void get_operands PARAMS ((struct simops *s, uint32 ins)); static void get_operands (struct simops *s, uint32 ins);
static void do_long PARAMS ((uint32 ins)); static void do_long (uint32 ins);
static void do_2_short PARAMS ((uint16 ins1, uint16 ins2, enum _leftright leftright)); static void do_2_short (uint16 ins1, uint16 ins2, enum _leftright leftright);
static void do_parallel PARAMS ((uint16 ins1, uint16 ins2)); static void do_parallel (uint16 ins1, uint16 ins2);
static char *add_commas PARAMS ((char *buf, int sizeof_buf, unsigned long value)); static char *add_commas (char *buf, int sizeof_buf, unsigned long value);
extern void sim_set_profile PARAMS ((int n)); extern void sim_set_profile (int n);
extern void sim_set_profile_size PARAMS ((int n)); extern void sim_set_profile_size (int n);
static INLINE uint8 *map_memory (unsigned phys_addr); static INLINE uint8 *map_memory (unsigned phys_addr);
#ifdef NEED_UI_LOOP_HOOK #ifdef NEED_UI_LOOP_HOOK
@ -62,7 +62,7 @@ static INLINE uint8 *map_memory (unsigned phys_addr);
static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL; static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
/* Actual hook to call to run through gdb's gui event loop */ /* Actual hook to call to run through gdb's gui event loop */
extern int (*deprecated_ui_loop_hook) PARAMS ((int signo)); extern int (*deprecated_ui_loop_hook) (int signo);
#endif /* NEED_UI_LOOP_HOOK */ #endif /* NEED_UI_LOOP_HOOK */
#ifndef INLINE #ifndef INLINE

View File

@ -122,10 +122,10 @@ move_to_cr (int cr, reg_t mask, reg_t val, int psw_hw_p)
} }
#ifdef DEBUG #ifdef DEBUG
static void trace_input_func PARAMS ((char *name, static void trace_input_func (char *name,
enum op_types in1, enum op_types in1,
enum op_types in2, enum op_types in2,
enum op_types in3)); enum op_types in3);
#define trace_input(name, in1, in2, in3) do { if (d10v_debug) trace_input_func (name, in1, in2, in3); } while (0) #define trace_input(name, in1, in2, in3) do { if (d10v_debug) trace_input_func (name, in1, in2, in3); } while (0)

View File

@ -256,52 +256,52 @@ int erareg;
/* Forward declarations */ /* Forward declarations */
static void decode_ersr PARAMS ((void)); static void decode_ersr (void);
#ifdef ERRINJ #ifdef ERRINJ
static void iucomperr PARAMS ((void)); static void iucomperr (void);
#endif #endif
static void mecparerror PARAMS ((void)); static void mecparerror (void);
static void decode_memcfg PARAMS ((void)); static void decode_memcfg (void);
static void decode_wcr PARAMS ((void)); static void decode_wcr (void);
static void decode_mcr PARAMS ((void)); static void decode_mcr (void);
static void close_port PARAMS ((void)); static void close_port (void);
static void mec_reset PARAMS ((void)); static void mec_reset (void);
static void mec_intack PARAMS ((int32 level)); static void mec_intack (int32 level);
static void chk_irq PARAMS ((void)); static void chk_irq (void);
static void mec_irq PARAMS ((int32 level)); static void mec_irq (int32 level);
static void set_sfsr PARAMS ((uint32 fault, uint32 addr, static void set_sfsr (uint32 fault, uint32 addr,
uint32 asi, uint32 read)); uint32 asi, uint32 read);
static int32 mec_read PARAMS ((uint32 addr, uint32 asi, uint32 *data)); static int32 mec_read (uint32 addr, uint32 asi, uint32 *data);
static int mec_write PARAMS ((uint32 addr, uint32 data)); static int mec_write (uint32 addr, uint32 data);
static void port_init PARAMS ((void)); static void port_init (void);
static uint32 read_uart PARAMS ((uint32 addr)); static uint32 read_uart (uint32 addr);
static void write_uart PARAMS ((uint32 addr, uint32 data)); static void write_uart (uint32 addr, uint32 data);
static void flush_uart PARAMS ((void)); static void flush_uart (void);
static void uarta_tx PARAMS ((void)); static void uarta_tx (void);
static void uartb_tx PARAMS ((void)); static void uartb_tx (void);
static void uart_rx PARAMS ((caddr_t arg)); static void uart_rx (caddr_t arg);
static void uart_intr PARAMS ((caddr_t arg)); static void uart_intr (caddr_t arg);
static void uart_irq_start PARAMS ((void)); static void uart_irq_start (void);
static void wdog_intr PARAMS ((caddr_t arg)); static void wdog_intr (caddr_t arg);
static void wdog_start PARAMS ((void)); static void wdog_start (void);
static void rtc_intr PARAMS ((caddr_t arg)); static void rtc_intr (caddr_t arg);
static void rtc_start PARAMS ((void)); static void rtc_start (void);
static uint32 rtc_counter_read PARAMS ((void)); static uint32 rtc_counter_read (void);
static void rtc_scaler_set PARAMS ((uint32 val)); static void rtc_scaler_set (uint32 val);
static void rtc_reload_set PARAMS ((uint32 val)); static void rtc_reload_set (uint32 val);
static void gpt_intr PARAMS ((caddr_t arg)); static void gpt_intr (caddr_t arg);
static void gpt_start PARAMS ((void)); static void gpt_start (void);
static uint32 gpt_counter_read PARAMS ((void)); static uint32 gpt_counter_read (void);
static void gpt_scaler_set PARAMS ((uint32 val)); static void gpt_scaler_set (uint32 val);
static void gpt_reload_set PARAMS ((uint32 val)); static void gpt_reload_set (uint32 val);
static void timer_ctrl PARAMS ((uint32 val)); static void timer_ctrl (uint32 val);
static unsigned char * static unsigned char *
get_mem_ptr PARAMS ((uint32 addr, uint32 size)); get_mem_ptr (uint32 addr, uint32 size);
static void fetch_bytes PARAMS ((int asi, unsigned char *mem, static void fetch_bytes (int asi, unsigned char *mem,
uint32 *data, int sz)); uint32 *data, int sz);
static void store_bytes PARAMS ((unsigned char *mem, uint32 *data, int sz)); static void store_bytes (unsigned char *mem, uint32 *data, int sz);
extern int ext_irl; extern int ext_irl;

View File

@ -220,14 +220,14 @@ int ext_irl = 0;
/* Forward declarations */ /* Forward declarations */
static uint32 sub_cc PARAMS ((uint32 psr, int32 operand1, int32 operand2, static uint32 sub_cc (uint32 psr, int32 operand1, int32 operand2,
int32 result)); int32 result);
static uint32 add_cc PARAMS ((uint32 psr, int32 operand1, int32 operand2, static uint32 add_cc (uint32 psr, int32 operand1, int32 operand2,
int32 result)); int32 result);
static void log_cc PARAMS ((int32 result, struct pstate *sregs)); static void log_cc (int32 result, struct pstate *sregs);
static int fpexec PARAMS ((uint32 op3, uint32 rd, uint32 rs1, uint32 rs2, static int fpexec (uint32 op3, uint32 rd, uint32 rs1, uint32 rs2,
struct pstate *sregs)); struct pstate *sregs);
static int chk_asi PARAMS ((struct pstate *sregs, uint32 *asi, uint32 op3)); static int chk_asi (struct pstate *sregs, uint32 *asi, uint32 op3);
extern struct estate ebase; extern struct estate ebase;

View File

@ -36,9 +36,9 @@
/* Forward declarations */ /* Forward declarations */
extern uint32 _get_sw PARAMS ((void)); extern uint32 _get_sw (void);
extern uint32 _get_cw PARAMS ((void)); extern uint32 _get_cw (void);
static void __setfpucw PARAMS ((unsigned short fpu_control)); static void __setfpucw (unsigned short fpu_control);
/* This host dependent routine should return the accrued exceptions */ /* This host dependent routine should return the accrued exceptions */
int int

View File

@ -63,16 +63,16 @@ uint32 errmec = 0;
/* Forward declarations */ /* Forward declarations */
static int batch PARAMS ((struct pstate *sregs, char *fname)); static int batch (struct pstate *sregs, char *fname);
static void set_rega PARAMS ((struct pstate *sregs, char *reg, uint32 rval)); static void set_rega (struct pstate *sregs, char *reg, uint32 rval);
static void disp_reg PARAMS ((struct pstate *sregs, char *reg)); static void disp_reg (struct pstate *sregs, char *reg);
static uint32 limcalc PARAMS ((float32 freq)); static uint32 limcalc (float32 freq);
static void int_handler PARAMS ((int32 sig)); static void int_handler (int32 sig);
static void init_event PARAMS ((void)); static void init_event (void);
static int disp_fpu PARAMS ((struct pstate *sregs)); static int disp_fpu (struct pstate *sregs);
static void disp_regs PARAMS ((struct pstate *sregs, int cwp)); static void disp_regs (struct pstate *sregs, int cwp);
static void disp_ctrl PARAMS ((struct pstate *sregs)); static void disp_ctrl (struct pstate *sregs);
static void disp_mem PARAMS ((uint32 addr, uint32 len)); static void disp_mem (uint32 addr, uint32 len);
static int static int
batch(sregs, fname) batch(sregs, fname)

View File

@ -41,10 +41,10 @@ typedef struct {
char *data; char *data;
} HIST_ENTRY; } HIST_ENTRY;
extern char * readline PARAMS ((char *prompt)); extern char * readline (char *prompt);
extern void using_history PARAMS ((void)); extern void using_history (void);
extern void add_history PARAMS ((char *string)); extern void add_history (char *string);
extern HIST_ENTRY *remove_history PARAMS ((int which)); extern HIST_ENTRY *remove_history (int which);

View File

@ -159,61 +159,61 @@ struct irqcell {
/* Prototypes */ /* Prototypes */
/* erc32.c */ /* erc32.c */
extern void init_sim PARAMS ((void)); extern void init_sim (void);
extern void reset PARAMS ((void)); extern void reset (void);
extern void error_mode PARAMS ((uint32 pc)); extern void error_mode (uint32 pc);
extern void sim_halt PARAMS ((void)); extern void sim_halt (void);
extern void exit_sim PARAMS ((void)); extern void exit_sim (void);
extern void init_stdio PARAMS ((void)); extern void init_stdio (void);
extern void restore_stdio PARAMS ((void)); extern void restore_stdio (void);
extern int memory_read PARAMS ((int32 asi, uint32 addr, uint32 *data, extern int memory_read (int32 asi, uint32 addr, uint32 *data,
int32 sz, int32 *ws)); int32 sz, int32 *ws);
extern int memory_write PARAMS ((int32 asi, uint32 addr, uint32 *data, extern int memory_write (int32 asi, uint32 addr, uint32 *data,
int32 sz, int32 *ws)); int32 sz, int32 *ws);
extern int sis_memory_write PARAMS ((uint32 addr, extern int sis_memory_write (uint32 addr,
const unsigned char *data, uint32 length)); const unsigned char *data, uint32 length);
extern int sis_memory_read PARAMS ((uint32 addr, char *data, extern int sis_memory_read (uint32 addr, char *data,
uint32 length)); uint32 length);
/* func.c */ /* func.c */
extern void set_regi PARAMS ((struct pstate *sregs, int32 reg, extern void set_regi (struct pstate *sregs, int32 reg,
uint32 rval)); uint32 rval);
extern void get_regi PARAMS ((struct pstate *sregs, int32 reg, char *buf)); extern void get_regi (struct pstate *sregs, int32 reg, char *buf);
extern int exec_cmd PARAMS ((struct pstate *sregs, char *cmd)); extern int exec_cmd (struct pstate *sregs, char *cmd);
extern void reset_stat PARAMS ((struct pstate *sregs)); extern void reset_stat (struct pstate *sregs);
extern void show_stat PARAMS ((struct pstate *sregs)); extern void show_stat (struct pstate *sregs);
extern void init_bpt PARAMS ((struct pstate *sregs)); extern void init_bpt (struct pstate *sregs);
extern void init_signals PARAMS ((void)); extern void init_signals (void);
struct disassemble_info; struct disassemble_info;
extern void dis_mem PARAMS ((uint32 addr, uint32 len, extern void dis_mem (uint32 addr, uint32 len,
struct disassemble_info *info)); struct disassemble_info *info);
extern void event PARAMS ((void (*cfunc) (), int32 arg, uint64 delta)); extern void event (void (*cfunc) (), int32 arg, uint64 delta);
extern void set_int PARAMS ((int32 level, void (*callback) (), int32 arg)); extern void set_int (int32 level, void (*callback) (), int32 arg);
extern void advance_time PARAMS ((struct pstate *sregs)); extern void advance_time (struct pstate *sregs);
extern uint32 now PARAMS ((void)); extern uint32 now (void);
extern int wait_for_irq PARAMS ((void)); extern int wait_for_irq (void);
extern int check_bpt PARAMS ((struct pstate *sregs)); extern int check_bpt (struct pstate *sregs);
extern void reset_all PARAMS ((void)); extern void reset_all (void);
extern void sys_reset PARAMS ((void)); extern void sys_reset (void);
extern void sys_halt PARAMS ((void)); extern void sys_halt (void);
extern int bfd_load PARAMS ((char *fname)); extern int bfd_load (char *fname);
/* exec.c */ /* exec.c */
extern int dispatch_instruction PARAMS ((struct pstate *sregs)); extern int dispatch_instruction (struct pstate *sregs);
extern int execute_trap PARAMS ((struct pstate *sregs)); extern int execute_trap (struct pstate *sregs);
extern int check_interrupts PARAMS ((struct pstate *sregs)); extern int check_interrupts (struct pstate *sregs);
extern void init_regs PARAMS ((struct pstate *sregs)); extern void init_regs (struct pstate *sregs);
/* interf.c */ /* interf.c */
extern int run_sim PARAMS ((struct pstate *sregs, extern int run_sim (struct pstate *sregs,
uint64 icount, int dis)); uint64 icount, int dis);
/* float.c */ /* float.c */
extern int get_accex PARAMS ((void)); extern int get_accex (void);
extern void clear_accex PARAMS ((void)); extern void clear_accex (void);
extern void set_fsr PARAMS ((uint32 fsr)); extern void set_fsr (uint32 fsr);
/* help.c */ /* help.c */
extern void usage PARAMS ((void)); extern void usage (void);
extern void gen_help PARAMS ((void)); extern void gen_help (void);

View File

@ -65,12 +65,8 @@ code on the hardware.
#include "gdb/callback.h" /* GDB simulator callback interface */ #include "gdb/callback.h" /* GDB simulator callback interface */
#include "gdb/remote-sim.h" /* GDB simulator interface */ #include "gdb/remote-sim.h" /* GDB simulator interface */
#ifndef PARAMS char* pr_addr (SIM_ADDR addr);
#define PARAMS(x) char* pr_uword64 (uword64 addr);
#endif
char* pr_addr PARAMS ((SIM_ADDR addr));
char* pr_uword64 PARAMS ((uword64 addr));
/* Within interp.c we refer to the sim_state and sim_cpu directly. */ /* Within interp.c we refer to the sim_state and sim_cpu directly. */
@ -98,7 +94,7 @@ char* pr_uword64 PARAMS ((uword64 addr));
/*-- GDB simulator interface ------------------------------------------------*/ /*-- GDB simulator interface ------------------------------------------------*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void ColdReset PARAMS((SIM_DESC sd)); static void ColdReset (SIM_DESC sd);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -164,7 +160,7 @@ static SIM_RC sim_firmware_command (SIM_DESC sd, char* arg);
#if defined(TRACE) #if defined(TRACE)
static char *tracefile = "trace.din"; /* default filename for trace log */ static char *tracefile = "trace.din"; /* default filename for trace log */
FILE *tracefh = NULL; FILE *tracefh = NULL;
static void open_trace PARAMS((SIM_DESC sd)); static void open_trace (SIM_DESC sd);
#endif /* TRACE */ #endif /* TRACE */
static const char * get_insn_name (sim_cpu *, int); static const char * get_insn_name (sim_cpu *, int);

View File

@ -475,7 +475,7 @@ struct _sim_cpu {
/* MIPS specific simulator watch config */ /* MIPS specific simulator watch config */
void watch_options_install PARAMS ((SIM_DESC sd)); void watch_options_install (SIM_DESC sd);
struct swatch { struct swatch {
sim_event *pc; sim_event *pc;
@ -693,10 +693,10 @@ void signal_exception (SIM_DESC sd, sim_cpu *cpu, address_word cia, int exceptio
/* XXX FIXME: For now, assume that FPU (cp1) is always usable. */ /* XXX FIXME: For now, assume that FPU (cp1) is always usable. */
#define COP_Usable(coproc_num) (coproc_num == 1) #define COP_Usable(coproc_num) (coproc_num == 1)
void cop_lw PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg, unsigned int memword)); void cop_lw (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg, unsigned int memword);
void cop_ld PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg, uword64 memword)); void cop_ld (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg, uword64 memword);
unsigned int cop_sw PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg)); unsigned int cop_sw (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg);
uword64 cop_sd PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg)); uword64 cop_sd (SIM_DESC sd, sim_cpu *cpu, address_word cia, int coproc_num, int coproc_reg);
#define COP_LW(coproc_num,coproc_reg,memword) \ #define COP_LW(coproc_num,coproc_reg,memword) \
cop_lw (SD, CPU, cia, coproc_num, coproc_reg, memword) cop_lw (SD, CPU, cia, coproc_num, coproc_reg, memword)
@ -708,7 +708,7 @@ cop_sw (SD, CPU, cia, coproc_num, coproc_reg)
cop_sd (SD, CPU, cia, coproc_num, coproc_reg) cop_sd (SD, CPU, cia, coproc_num, coproc_reg)
void decode_coproc PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int instruction)); void decode_coproc (SIM_DESC sd, sim_cpu *cpu, address_word cia, unsigned int instruction);
#define DecodeCoproc(instruction) \ #define DecodeCoproc(instruction) \
decode_coproc (SD, CPU, cia, (instruction)) decode_coproc (SD, CPU, cia, (instruction))
@ -940,27 +940,27 @@ unsigned64 mdmx_shuffle (SIM_STATE, int, unsigned64, unsigned64);
#define PSIZE (WITH_TARGET_ADDRESS_BITSIZE) #define PSIZE (WITH_TARGET_ADDRESS_BITSIZE)
INLINE_SIM_MAIN (int) address_translation PARAMS ((SIM_DESC sd, sim_cpu *, address_word cia, address_word vAddr, int IorD, int LorS, address_word *pAddr, int *CCA, int raw)); INLINE_SIM_MAIN (int) address_translation (SIM_DESC sd, sim_cpu *, address_word cia, address_word vAddr, int IorD, int LorS, address_word *pAddr, int *CCA, int raw);
#define AddressTranslation(vAddr,IorD,LorS,pAddr,CCA,host,raw) \ #define AddressTranslation(vAddr,IorD,LorS,pAddr,CCA,host,raw) \
address_translation (SD, CPU, cia, vAddr, IorD, LorS, pAddr, CCA, raw) address_translation (SD, CPU, cia, vAddr, IorD, LorS, pAddr, CCA, raw)
INLINE_SIM_MAIN (void) load_memory PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, uword64* memvalp, uword64* memval1p, int CCA, unsigned int AccessLength, address_word pAddr, address_word vAddr, int IorD)); INLINE_SIM_MAIN (void) load_memory (SIM_DESC sd, sim_cpu *cpu, address_word cia, uword64* memvalp, uword64* memval1p, int CCA, unsigned int AccessLength, address_word pAddr, address_word vAddr, int IorD);
#define LoadMemory(memvalp,memval1p,CCA,AccessLength,pAddr,vAddr,IorD,raw) \ #define LoadMemory(memvalp,memval1p,CCA,AccessLength,pAddr,vAddr,IorD,raw) \
load_memory (SD, CPU, cia, memvalp, memval1p, CCA, AccessLength, pAddr, vAddr, IorD) load_memory (SD, CPU, cia, memvalp, memval1p, CCA, AccessLength, pAddr, vAddr, IorD)
INLINE_SIM_MAIN (void) store_memory PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int CCA, unsigned int AccessLength, uword64 MemElem, uword64 MemElem1, address_word pAddr, address_word vAddr)); INLINE_SIM_MAIN (void) store_memory (SIM_DESC sd, sim_cpu *cpu, address_word cia, int CCA, unsigned int AccessLength, uword64 MemElem, uword64 MemElem1, address_word pAddr, address_word vAddr);
#define StoreMemory(CCA,AccessLength,MemElem,MemElem1,pAddr,vAddr,raw) \ #define StoreMemory(CCA,AccessLength,MemElem,MemElem1,pAddr,vAddr,raw) \
store_memory (SD, CPU, cia, CCA, AccessLength, MemElem, MemElem1, pAddr, vAddr) store_memory (SD, CPU, cia, CCA, AccessLength, MemElem, MemElem1, pAddr, vAddr)
INLINE_SIM_MAIN (void) cache_op PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int op, address_word pAddr, address_word vAddr, unsigned int instruction)); INLINE_SIM_MAIN (void) cache_op (SIM_DESC sd, sim_cpu *cpu, address_word cia, int op, address_word pAddr, address_word vAddr, unsigned int instruction);
#define CacheOp(op,pAddr,vAddr,instruction) \ #define CacheOp(op,pAddr,vAddr,instruction) \
cache_op (SD, CPU, cia, op, pAddr, vAddr, instruction) cache_op (SD, CPU, cia, op, pAddr, vAddr, instruction)
INLINE_SIM_MAIN (void) sync_operation PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int stype)); INLINE_SIM_MAIN (void) sync_operation (SIM_DESC sd, sim_cpu *cpu, address_word cia, int stype);
#define SyncOperation(stype) \ #define SyncOperation(stype) \
sync_operation (SD, CPU, cia, (stype)) sync_operation (SD, CPU, cia, (stype))
INLINE_SIM_MAIN (void) prefetch PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, int CCA, address_word pAddr, address_word vAddr, int DATA, int hint)); INLINE_SIM_MAIN (void) prefetch (SIM_DESC sd, sim_cpu *cpu, address_word cia, int CCA, address_word pAddr, address_word vAddr, int DATA, int hint);
#define Prefetch(CCA,pAddr,vAddr,DATA,hint) \ #define Prefetch(CCA,pAddr,vAddr,DATA,hint) \
prefetch (SD, CPU, cia, CCA, pAddr, vAddr, DATA, hint) prefetch (SD, CPU, cia, CCA, pAddr, vAddr, DATA, hint)
@ -969,23 +969,23 @@ void unpredictable_action (sim_cpu *cpu, address_word cia);
#define Unpredictable() unpredictable (SD_) #define Unpredictable() unpredictable (SD_)
#define UnpredictableResult() /* For now, do nothing. */ #define UnpredictableResult() /* For now, do nothing. */
INLINE_SIM_MAIN (unsigned32) ifetch32 PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, address_word vaddr)); INLINE_SIM_MAIN (unsigned32) ifetch32 (SIM_DESC sd, sim_cpu *cpu, address_word cia, address_word vaddr);
#define IMEM32(CIA) ifetch32 (SD, CPU, (CIA), (CIA)) #define IMEM32(CIA) ifetch32 (SD, CPU, (CIA), (CIA))
INLINE_SIM_MAIN (unsigned16) ifetch16 PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia, address_word vaddr)); INLINE_SIM_MAIN (unsigned16) ifetch16 (SIM_DESC sd, sim_cpu *cpu, address_word cia, address_word vaddr);
#define IMEM16(CIA) ifetch16 (SD, CPU, (CIA), ((CIA) & ~1)) #define IMEM16(CIA) ifetch16 (SD, CPU, (CIA), ((CIA) & ~1))
#define IMEM16_IMMED(CIA,NR) ifetch16 (SD, CPU, (CIA), ((CIA) & ~1) + 2 * (NR)) #define IMEM16_IMMED(CIA,NR) ifetch16 (SD, CPU, (CIA), ((CIA) & ~1) + 2 * (NR))
void dotrace PARAMS ((SIM_DESC sd, sim_cpu *cpu, FILE *tracefh, int type, SIM_ADDR address, int width, char *comment, ...)); void dotrace (SIM_DESC sd, sim_cpu *cpu, FILE *tracefh, int type, SIM_ADDR address, int width, char *comment, ...);
extern FILE *tracefh; extern FILE *tracefh;
extern int DSPLO_REGNUM[4]; extern int DSPLO_REGNUM[4];
extern int DSPHI_REGNUM[4]; extern int DSPHI_REGNUM[4];
INLINE_SIM_MAIN (void) pending_tick PARAMS ((SIM_DESC sd, sim_cpu *cpu, address_word cia)); INLINE_SIM_MAIN (void) pending_tick (SIM_DESC sd, sim_cpu *cpu, address_word cia);
extern SIM_CORE_SIGNAL_FN mips_core_signal; extern SIM_CORE_SIGNAL_FN mips_core_signal;
char* pr_addr PARAMS ((SIM_ADDR addr)); char* pr_addr (SIM_ADDR addr);
char* pr_uword64 PARAMS ((uword64 addr)); char* pr_uword64 (uword64 addr);
#define GPR_CLEAR(N) do { GPR_SET((N),0); } while (0) #define GPR_CLEAR(N) do { GPR_SET((N),0); } while (0)

View File

@ -473,22 +473,22 @@ int valid[16];
#define UNDEF(x) #define UNDEF(x)
#endif #endif
static void parse_and_set_memory_size PARAMS ((char *str)); static void parse_and_set_memory_size (char *str);
static int IOMEM PARAMS ((int addr, int write, int value)); static int IOMEM (int addr, int write, int value);
static struct loop_bounds get_loop_bounds PARAMS ((int, int, unsigned char *, static struct loop_bounds get_loop_bounds (int, int, unsigned char *,
unsigned char *, int, int)); unsigned char *, int, int);
static void process_wlat_addr PARAMS ((int, int)); static void process_wlat_addr (int, int);
static void process_wwat_addr PARAMS ((int, int)); static void process_wwat_addr (int, int);
static void process_wbat_addr PARAMS ((int, int)); static void process_wbat_addr (int, int);
static int process_rlat_addr PARAMS ((int)); static int process_rlat_addr (int);
static int process_rwat_addr PARAMS ((int)); static int process_rwat_addr (int);
static int process_rbat_addr PARAMS ((int)); static int process_rbat_addr (int);
static void INLINE wlat_fast PARAMS ((unsigned char *, int, int, int)); static void INLINE wlat_fast (unsigned char *, int, int, int);
static void INLINE wwat_fast PARAMS ((unsigned char *, int, int, int, int)); static void INLINE wwat_fast (unsigned char *, int, int, int, int);
static void INLINE wbat_fast PARAMS ((unsigned char *, int, int, int)); static void INLINE wbat_fast (unsigned char *, int, int, int);
static int INLINE rlat_fast PARAMS ((unsigned char *, int, int)); static int INLINE rlat_fast (unsigned char *, int, int);
static int INLINE rwat_fast PARAMS ((unsigned char *, int, int, int)); static int INLINE rwat_fast (unsigned char *, int, int, int);
static int INLINE rbat_fast PARAMS ((unsigned char *, int, int)); static int INLINE rbat_fast (unsigned char *, int, int);
static host_callback *callback; static host_callback *callback;

View File

@ -469,9 +469,9 @@ enum op_types
}; };
#ifdef DEBUG #ifdef DEBUG
void trace_input PARAMS ((char *name, enum op_types type, int size)); void trace_input (char *name, enum op_types type, int size);
void trace_output PARAMS ((enum op_types result)); void trace_output (enum op_types result);
void trace_result PARAMS ((int has_result, unsigned32 result)); void trace_result (int has_result, unsigned32 result);
extern int trace_num_values; extern int trace_num_values;
extern unsigned32 trace_values[]; extern unsigned32 trace_values[];

View File

@ -2,7 +2,7 @@ struct simops
{ {
unsigned long opcode; unsigned long opcode;
unsigned long mask; unsigned long mask;
int (* func) PARAMS ((void)); int (* func) (void);
int numops; int numops;
int operands[12]; int operands[12];
}; };