#ifndef SIM_CALLBACK_H
#define SIM_CALLBACK_H
-#include <ansidecl.h>
#include <stdarg.h>
#include <stdint.h>
+
+#include <ansidecl.h>
/* Needed for enum bfd_endian. */
-#include "bfd.h"
+#include <bfd.h>
\f
/* Mapping of host/target values. */
/* ??? For debugging purposes, one might want to add a string of the
/* This must come before any other includes. */
#include "defs.h"
-#include "ansidecl.h"
+#include <errno.h>
+#include <fcntl.h>
+/* For PIPE_BUF. */
+#include <limits.h>
+#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-/* For PIPE_BUF. */
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <time.h>
-#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include <sys/stat.h>
-#include "sim/callback.h"
+#include <sys/types.h>
+
+#include "ansidecl.h"
/* For xmalloc. */
#include "libiberty.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "sim/callback.h"
#ifndef PIPE_BUF
#define PIPE_BUF 512
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
#include <stdlib.h>
+
+#include "sim-main.h"
#include "cgen-mem.h"
#include "cgen-par.h"
#define SCACHE_DEFINE_INLINE
-#include "sim-main.h"
#include <stdlib.h>
+
#include "libiberty.h"
+
+#include "sim-main.h"
#include "sim-options.h"
#include "sim-io.h"
#include <errno.h>
#include <stdlib.h>
+
+#include "bfd.h"
#include "diagnostics.h"
#include "dis-asm.h"
-#include "bfd.h"
+
#include "sim-main.h"
#include "sim-fpu.h"
#include "sim/callback.h"
#include "defs.h"
#include "bfd.h"
+#include "dis-asm.h"
+
#include "sim-main.h"
#include "sim-signal.h"
-#include "dis-asm.h"
#define MEMOPS_DEFINE_INLINE
#include "cgen-mem.h"
/* This must come before any other includes. */
#include "defs.h"
-#include <math.h>
#include <errno.h>
#include <fcntl.h>
+#include <math.h>
#include <stdbool.h>
#include <unistd.h>
#ifdef HAVE_SYS_MMAN_H
/* This must come before any other includes. */
#include "defs.h"
-#include "hw-main.h"
-
#include <string.h>
+#include "hw-main.h"
+
/* DEVICE
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include "sim-main.h"
#include "hw-main.h"
#include "sim-io.h"
its immediate domain */
#include "hw-tree.h"
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdlib.h>
-
/* DEVICE
/* This must come before any other includes. */
#include "defs.h"
-#include <string.h>
-#include <signal.h>
-#include <stdlib.h>
+#include <errno.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#include <netdb.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <netinet/in.h>
#include <arpa/inet.h>
-#include <netdb.h>
+#include <netinet/in.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/types.h>
#include "sim-main.h"
#include "sim-assert.h"
#define WANT_CPU @cpu@
#define WANT_CPU_@CPU@
-#include "sim-main.h"
#include "bfd.h"
+
+#include "sim-main.h"
#include "cgen-mem.h"
#include "cgen-ops.h"
#include "sim-assert.h"
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
#include "hw-main.h"
#include "hw-base.h"
-#include <stdlib.h>
-
struct hw_alloc_data
{
void *alloc;
/* This must come before any other includes. */
#include "defs.h"
-#include "hw-main.h"
-#include "hw-base.h"
-
-#include <string.h>
-#include <stdlib.h>
#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include "hw-main.h"
+#include "hw-base.h"
#include "hw-config.h"
struct hw_base_data
/* This must come before any other includes. */
#include "defs.h"
-#include "hw-main.h"
-#include "hw-base.h"
-
#include <stdlib.h>
#include <string.h>
+#include "hw-main.h"
+#include "hw-base.h"
+
/* Address methods */
const hw_unit *
/* This must come before any other includes. */
#include "defs.h"
+#include <string.h>
+
#include "hw-main.h"
#include "hw-base.h"
#include "sim-events.h"
-#include <string.h>
-
/* The hw-events object is implemented using sim-events */
struct hw_event
Build with `make test-hw-events' in sim/<cpu> directory*/
#if defined (MAIN)
-#include "sim-main.h"
-#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+
+#include "sim-main.h"
static void
test_handler (struct hw *me,
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
#include "hw-main.h"
#include "hw-base.h"
-#include <stdlib.h>
-
struct hw_handle_mapping
{
cell_word external;
/* This must come before any other includes. */
#include "defs.h"
-#include "hw-main.h"
-#include "hw-base.h"
-
+#include <ctype.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include "hw-main.h"
+#include "hw-base.h"
struct hw_port_edge
{
/* This must come before any other includes. */
#include "defs.h"
+#include <string.h>
+
#include "hw-main.h"
#include "hw-base.h"
#include "sim-io.h"
#include "sim-assert.h"
-#include <string.h>
-
/* property entries */
struct hw_property_data
/* This must come before any other includes. */
#include "defs.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "hw-main.h"
#include "hw-base.h"
#include "hw-tree.h"
#include "sim-io.h"
#include "sim-assert.h"
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
/* manipulate/lookup device names */
typedef struct _name_specifier
#include <stdlib.h>
/* For strsignal. */
#include <string.h>
+#ifdef HAVE_UNISTD_H
+/* For chdir. */
+#include <unistd.h>
+#endif
+
+#include "bfd.h"
+#include "environ.h"
#include "sim-main.h"
#include "sim-signal.h"
#include "sim/callback.h"
-#include "bfd.h"
-#include "environ.h"
-
#ifndef HAVE_STRSIGNAL
/* While libiberty provides a fallback, it doesn't provide a prototype. */
extern const char *strsignal (int);
#endif
-#ifdef HAVE_UNISTD_H
-/* For chdir. */
-#include <unistd.h>
-#endif
-
static void usage (void);
extern host_callback default_callback;
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+#include <string.h>
+
#include "libiberty.h"
+
#include "sim-basics.h"
#include "sim-arange.h"
-#include <stdlib.h>
-#include <string.h>
-
/* Insert a range. */
static void
#ifndef SIM_ASSERT_H
#define SIM_ASSERT_H
+#include "libiberty.h"
+
/* The subtle difference between SIM_ASSERT and ASSERT is that
SIM_ASSERT passes `sd' to sim_io_error for the SIM_DESC,
ASSERT passes NULL. */
#if !defined (SIM_ASSERT)
#if defined (WITH_ASSERT)
#include "sim-io.h"
-#include "libiberty.h"
#define SIM_ASSERT(EXPRESSION) \
do \
{ \
#if !defined (ASSERT)
#if defined (WITH_ASSERT)
#include "sim-io.h"
-#include "libiberty.h"
#define ASSERT(EXPRESSION) \
do \
{ \
/* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
bring potential conflicts out in the open */
+#include <setjmp.h>
#include <stdarg.h>
#include <stdio.h>
-#include <setjmp.h>
#ifndef min
/* This must come before any other includes. */
#include "defs.h"
+#include "bfd.h"
+
#include "sim-main.h"
#include "sim-assert.h"
-#include "bfd.h"
enum bfd_endian current_target_byte_order = BFD_ENDIAN_UNKNOWN;
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
+#include "libiberty.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-signal.h"
-#include "libiberty.h"
#if (WITH_HW)
#include "sim-hw.h"
#endif
-#include <stdlib.h>
-
/* "core" module install handler.
This is called via sim_module_install to install the "core"
#include <stdlib.h>
-#include "sim-main.h"
#include "bfd.h"
+#include "sim-main.h"
+
/* Allocate space for all cpus in the simulator.
Space for the cpu must currently exist prior to parsing ARGV. */
/* ??? wip. better solution must wait. */
/* This must come before any other includes. */
#include "defs.h"
+#include <stdio.h>
+#include <stdlib.h>
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-signal.h"
-#include <stdio.h>
-#include <stdlib.h>
-
/* Get the run state.
REASON/SIGRC are the values returned by sim_stop_reason.
??? Should each cpu have its own copy? */
/* This must come before any other includes. */
#include "defs.h"
+#include <signal.h> /* For SIGPROCMASK et al. */
+#include <stdlib.h>
+#include <string.h>
+
+#include "libiberty.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-cpu.h"
-#include "libiberty.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <signal.h> /* For SIGPROCMASK et al. */
typedef enum {
watch_invalid,
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
#include "sim-basics.h"
#include "sim-fpu.h"
#include "sim-io.h"
#include "sim-assert.h"
-#include <stdlib.h>
-
/* Debugging support.
If digits is -1, then print all digits. */
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
#include "bfd.h"
+
+#include "sim-main.h"
#include "sim-utils.h"
#include "sim-assert.h"
/* This must come before any other includes. */
#include "defs.h"
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-options.h"
#include "hw-main.h"
#include "hw-base.h"
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-
-
struct sim_hw {
struct hw *tree;
int trace_p;
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
-#include "sim-io.h"
-#include "sim/callback.h"
-
#include <errno.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
-
+#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdlib.h>
+#include "sim-main.h"
+#include "sim-io.h"
+#include "sim/callback.h"
#undef open
#ifndef SIM_IO_H
#define SIM_IO_H
+#include <sys/stat.h>
+#include <sys/types.h>
+
/* See the file include/callbacks.h for a description */
int sim_io_init (SIM_DESC sd);
/* Returns -1 and sets (host) EAGAIN if not ready. */
int sim_io_poll_read (SIM_DESC sd, int, char *, int);
-#include <sys/types.h>
-#include <sys/stat.h>
-
int sim_io_stat (SIM_DESC sd, const char *path, struct stat *buf);
int sim_io_fstat (SIM_DESC sd, int fd, struct stat *buf);
/* This must come before any other includes. */
#include "defs.h"
-#include "ansidecl.h"
-#include <stdio.h> /* for NULL */
#include <stdarg.h>
+#include <stdio.h> /* for NULL */
#include <stdlib.h>
#include <time.h>
+#include "ansidecl.h"
#include "bfd.h"
#include "sim/callback.h"
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
-#include "sim-assert.h"
-#include "sim-options.h"
-
-#include <string.h>
-#include <stdlib.h>
#include <errno.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+
+#include "sim-main.h"
+#include "sim-assert.h"
+#include "sim-options.h"
/* Memory fill byte. */
static unsigned8 fill_byte_value;
/* This must come before any other includes. */
#include "defs.h"
+#include "bfd.h"
+#include "libiberty.h"
+
#include "sim-main.h"
#include "sim-model.h"
-#include "libiberty.h"
#include "sim-options.h"
#include "sim-io.h"
#include "sim-assert.h"
-#include "bfd.h"
static void model_set (sim_cpu *, const SIM_MODEL *);
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
+#include "libiberty.h"
+
#include "sim-main.h"
#include "sim-io.h"
#include "sim-options.h"
#include "sim-assert.h"
-#include "libiberty.h"
-
-#include <stdlib.h>
-
/* List of all early/core modules.
TODO: Should trim this list by converting to sim_install_* framework. */
static MODULE_INSTALL_FN * const early_modules[] = {
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
-#include <string.h>
-#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
+
+#include "bfd.h"
+#include "environ.h"
+#include "hashtab.h"
#include "libiberty.h"
+
+#include "sim-main.h"
#include "sim-options.h"
#include "sim-io.h"
#include "sim-assert.h"
-#include "environ.h"
#include "version.h"
-#include "hashtab.h"
-
-#include "bfd.h"
/* Add a set of options to the simulator.
TABLE is an array of OPTIONS terminated by a NULL `opt.name' entry.
/* This must come before any other includes. */
#include "defs.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "sim-main.h"
#include "sim-io.h"
#include "sim-options.h"
#include "sim-assert.h"
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
#if !WITH_PROFILE_PC_P
static unsigned int _profile_stub;
# define PROFILE_PC_FREQ(p) _profile_stub
/* This must come before any other includes. */
#include "defs.h"
+#include <stdlib.h>
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-signal.h"
-#include <stdlib.h>
-
/* Generic implementation of sim_stop_reason */
void
#include "defs.h"
#include <signal.h>
+
#include "sim-main.h"
#include "sim-signal.h"
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
-#include "sim-io.h"
-#include "sim-options.h"
-#include "sim-fpu.h"
-#include "sim/callback.h"
+#include <stdlib.h>
+#include <string.h>
#include "bfd.h"
-#include "libiberty.h"
-
#include "dis-asm.h"
+#include "libiberty.h"
+#include "sim-main.h"
#include "sim-assert.h"
-
-#include <string.h>
-#include <stdlib.h>
+#include "sim-io.h"
+#include "sim-options.h"
+#include "sim-fpu.h"
+#include "sim/callback.h"
#ifndef SIZE_PHASE
#define SIZE_PHASE 8
#include "defs.h"
#include <stdlib.h>
+#include <string.h>
#include <time.h>
-#include <sys/time.h> /* needed by sys/resource.h */
-
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
-#include <string.h>
+#include <sys/time.h> /* needed by sys/resource.h */
-#include "libiberty.h"
#include "bfd.h"
+#include "libiberty.h"
+
#include "sim-main.h"
#include "sim-assert.h"
#include "sim-utils.h"
/* This must come before any other includes. */
#include "defs.h"
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libiberty.h"
+
#include "sim-main.h"
#include "sim-options.h"
#include "sim-signal.h"
-#include "libiberty.h"
-
#include "sim-assert.h"
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
enum {
OPTION_WATCH_DELETE = OPTION_START,
/* This must come before any other includes. */
#include "defs.h"
-#include "ansidecl.h"
-#include "libiberty.h"
+#include <errno.h>
+#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <errno.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "ansidecl.h"
+#include "libiberty.h"
+
#include "sim/callback.h"
#ifndef ENOSYS