#ifndef SIM_SIM_H
#define SIM_SIM_H 1
+#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
/* Print whatever statistics the simulator has collected.
- VERBOSE is currently unused and must always be zero. */
+ When VERBOSE is enabled, extra details will be shown. */
-void sim_info (SIM_DESC sd, int verbose);
+void sim_info (SIM_DESC sd, bool verbose);
/* Return a memory map in XML format.
/* Print cache access statics for CPU. */
void
-scache_print_profile (SIM_CPU *cpu, int verbose)
+scache_print_profile (SIM_CPU *cpu, bool verbose)
{
SIM_DESC sd = CPU_STATE (cpu);
unsigned long hits = CPU_SCACHE_HITS (cpu);
/* Scache profiling support. */
/* Print summary scache usage information. */
-extern void scache_print_profile (SIM_CPU *cpu, int verbose);
+extern void scache_print_profile (SIM_CPU *cpu, bool verbose);
#if WITH_PROFILE_SCACHE_P
sim-module. */
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
sim_module_info (sd, verbose || STATE_VERBOSE_P (sd));
/* Called when ever simulator info is needed */
void
-sim_module_info (SIM_DESC sd, int verbose)
+sim_module_info (SIM_DESC sd, bool verbose)
{
struct module_list *modules = STATE_MODULES (sd);
MODULE_INFO_LIST *modp;
typedef SIM_RC (MODULE_RESUME_FN) (SIM_DESC);
typedef SIM_RC (MODULE_SUSPEND_FN) (SIM_DESC);
typedef void (MODULE_UNINSTALL_FN) (SIM_DESC);
-typedef void (MODULE_INFO_FN) (SIM_DESC, int);
+typedef void (MODULE_INFO_FN) (SIM_DESC, bool);
/* Lists of installed handlers. */
SIM_RC sim_module_resume (SIM_DESC sd);
/* Report general information on module */
-void sim_module_info (SIM_DESC sd, int verbose);
+void sim_module_info (SIM_DESC sd, bool verbose);
/* Module private data */
}
static void
-profile_print_pc (sim_cpu *cpu, int verbose)
+profile_print_pc (sim_cpu *cpu, bool verbose)
{
SIM_DESC sd = CPU_STATE (cpu);
PROFILE_DATA *profile = CPU_PROFILE_DATA (cpu);
}
static void
-profile_print_insn (sim_cpu *cpu, int verbose)
+profile_print_insn (sim_cpu *cpu, bool verbose)
{
unsigned int i, n, total, max_val, max_name_len;
SIM_DESC sd = CPU_STATE (cpu);
#if WITH_PROFILE_MEMORY_P
static void
-profile_print_memory (sim_cpu *cpu, int verbose)
+profile_print_memory (sim_cpu *cpu, bool verbose)
{
unsigned int i, n;
unsigned int total_read, total_write;
#if WITH_PROFILE_CORE_P
static void
-profile_print_core (sim_cpu *cpu, int verbose)
+profile_print_core (sim_cpu *cpu, bool verbose)
{
unsigned int total;
unsigned int max_val;
#if WITH_PROFILE_MODEL_P
static void
-profile_print_model (sim_cpu *cpu, int verbose)
+profile_print_model (sim_cpu *cpu, bool verbose)
{
SIM_DESC sd = CPU_STATE (cpu);
PROFILE_DATA *data = CPU_PROFILE_DATA (cpu);
section titles. */
static void
-profile_info (SIM_DESC sd, int verbose)
+profile_info (SIM_DESC sd, bool verbose)
{
int i,c;
int print_title_p = 0;
typedef void (PROFILE_INFO_CALLBACK_FN) (SIM_DESC, int);
struct _sim_cpu; /* forward reference */
-typedef void (PROFILE_INFO_CPU_CALLBACK_FN) (struct _sim_cpu *cpu, int verbose);
+typedef void (PROFILE_INFO_CPU_CALLBACK_FN) (struct _sim_cpu *cpu, bool verbose);
\f
/* Struct containing most profiling data.
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
char buf1[40];
char buf2[40];
}
void
-sim_info(SIM_DESC sd, int verbose)
+sim_info(SIM_DESC sd, bool verbose)
{
show_stat(&sregs);
}
};
static void
-print_parallel (SIM_CPU *cpu, int verbose)
+print_parallel (SIM_CPU *cpu, bool verbose)
{
SIM_DESC sd = CPU_STATE (cpu);
PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
}
void
-frv_profile_info (SIM_CPU *cpu, int verbose)
+frv_profile_info (SIM_CPU *cpu, bool verbose)
{
/* FIXME: Need to add smp support. */
PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
sim_cpu *cpu = STATE_CPU (sd, 0);
const struct h8300_sim_state *state = H8300_SIM_STATE (sd);
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
printf ("The m32c minisim doesn't collect any statistics.\n");
}
#define M32R_DEFAULT_MEM_SIZE 0x2000000 /* 32M */
static void free_state (SIM_DESC);
-static void print_m32r_misc_cpu (SIM_CPU *cpu, int verbose);
+static void print_m32r_misc_cpu (SIM_CPU *cpu, bool verbose);
\f
/* Cover function of sim_state_free to free the cpu buffers as well. */
/* PROFILE_CPU_CALLBACK */
static void
-print_m32r_misc_cpu (SIM_CPU *cpu, int verbose)
+print_m32r_misc_cpu (SIM_CPU *cpu, bool verbose)
{
SIM_DESC sd = CPU_STATE (cpu);
char buf[20];
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
const char *cpu_type;
const struct bfd_arch_info *arch;
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
struct mcore_sim_cpu *mcore_cpu = MCORE_SIM_CPU (cpu);
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
host_callback *callback = STATE_CALLBACK (sd);
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
TRACE(trace_gdb, ("sim_info(verbose=%d) called\n", verbose));
psim_print_info (simulator, verbose);
/* Print out message associated with "info target". */
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
check_desc (sd);
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
check_desc (sd);
}
void
-sim_info (SIM_DESC sd, int verbose)
+sim_info (SIM_DESC sd, bool verbose)
{
double timetaken =
(double) saved_state.asregs.ticks / (double) now_persec ();