mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
sim: reorder header includes
We're including system headers after local headers in a bunch of places, but this leads to conflicts when our local headers happen to define symbols that show up in the system headers. Use the more standard order of: * config.h (via defs.h) * system headers * local library headers (e.g. bfd & libiberty) * sim specific headers
This commit is contained in:
@ -45,11 +45,12 @@
|
|||||||
#ifndef SIM_CALLBACK_H
|
#ifndef SIM_CALLBACK_H
|
||||||
#define SIM_CALLBACK_H
|
#define SIM_CALLBACK_H
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <ansidecl.h>
|
||||||
/* Needed for enum bfd_endian. */
|
/* Needed for enum bfd_endian. */
|
||||||
#include "bfd.h"
|
#include <bfd.h>
|
||||||
|
|
||||||
/* Mapping of host/target values. */
|
/* Mapping of host/target values. */
|
||||||
/* ??? For debugging purposes, one might want to add a string of the
|
/* ??? For debugging purposes, one might want to add a string of the
|
||||||
|
@ -23,26 +23,27 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#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 <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
/* For PIPE_BUF. */
|
|
||||||
#include <limits.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include "sim/callback.h"
|
|
||||||
/* For xmalloc. */
|
|
||||||
#include "libiberty.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "ansidecl.h"
|
||||||
|
/* For xmalloc. */
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
|
#include "sim/callback.h"
|
||||||
|
|
||||||
#ifndef PIPE_BUF
|
#ifndef PIPE_BUF
|
||||||
#define PIPE_BUF 512
|
#define PIPE_BUF 512
|
||||||
|
@ -20,8 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
#include "cgen-mem.h"
|
#include "cgen-mem.h"
|
||||||
#include "cgen-par.h"
|
#include "cgen-par.h"
|
||||||
|
|
||||||
|
@ -22,9 +22,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
|
|
||||||
#define SCACHE_DEFINE_INLINE
|
#define SCACHE_DEFINE_INLINE
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "libiberty.h"
|
#include "libiberty.h"
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
|
|
||||||
|
@ -22,9 +22,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "bfd.h"
|
||||||
#include "diagnostics.h"
|
#include "diagnostics.h"
|
||||||
#include "dis-asm.h"
|
#include "dis-asm.h"
|
||||||
#include "bfd.h"
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-fpu.h"
|
#include "sim-fpu.h"
|
||||||
#include "sim/callback.h"
|
#include "sim/callback.h"
|
||||||
|
@ -21,9 +21,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
#include "dis-asm.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
#include "dis-asm.h"
|
|
||||||
|
|
||||||
#define MEMOPS_DEFINE_INLINE
|
#define MEMOPS_DEFINE_INLINE
|
||||||
#include "cgen-mem.h"
|
#include "cgen-mem.h"
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <math.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "hw-main.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "hw-main.h"
|
||||||
|
|
||||||
/* DEVICE
|
/* DEVICE
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,12 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
@ -30,12 +36,6 @@
|
|||||||
its immediate domain */
|
its immediate domain */
|
||||||
#include "hw-tree.h"
|
#include "hw-tree.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* DEVICE
|
/* DEVICE
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,24 +21,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
@ -312,8 +312,9 @@ cat << EOF
|
|||||||
#define WANT_CPU @cpu@
|
#define WANT_CPU @cpu@
|
||||||
#define WANT_CPU_@CPU@
|
#define WANT_CPU_@CPU@
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
#include "cgen-mem.h"
|
#include "cgen-mem.h"
|
||||||
#include "cgen-ops.h"
|
#include "cgen-ops.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
struct hw_alloc_data
|
struct hw_alloc_data
|
||||||
{
|
{
|
||||||
void *alloc;
|
void *alloc;
|
||||||
|
@ -22,13 +22,12 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "hw-config.h"
|
#include "hw-config.h"
|
||||||
|
|
||||||
struct hw_base_data
|
struct hw_base_data
|
||||||
|
@ -22,12 +22,12 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "hw-main.h"
|
|
||||||
#include "hw-base.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "hw-main.h"
|
||||||
|
#include "hw-base.h"
|
||||||
|
|
||||||
/* Address methods */
|
/* Address methods */
|
||||||
|
|
||||||
const hw_unit *
|
const hw_unit *
|
||||||
|
@ -20,13 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
#include "sim-events.h"
|
#include "sim-events.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/* The hw-events object is implemented using sim-events */
|
/* The hw-events object is implemented using sim-events */
|
||||||
|
|
||||||
struct hw_event
|
struct hw_event
|
||||||
@ -179,10 +179,11 @@ hw_event_remain_time (struct hw *me, struct hw_event *event)
|
|||||||
Build with `make test-hw-events' in sim/<cpu> directory*/
|
Build with `make test-hw-events' in sim/<cpu> directory*/
|
||||||
|
|
||||||
#if defined (MAIN)
|
#if defined (MAIN)
|
||||||
#include "sim-main.h"
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_handler (struct hw *me,
|
test_handler (struct hw *me,
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
struct hw_handle_mapping
|
struct hw_handle_mapping
|
||||||
{
|
{
|
||||||
cell_word external;
|
cell_word external;
|
||||||
|
@ -20,13 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include <ctype.h>
|
||||||
#include "hw-base.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
|
#include "hw-main.h"
|
||||||
|
#include "hw-base.h"
|
||||||
|
|
||||||
struct hw_port_edge
|
struct hw_port_edge
|
||||||
{
|
{
|
||||||
|
@ -22,14 +22,14 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/* property entries */
|
/* property entries */
|
||||||
|
|
||||||
struct hw_property_data
|
struct hw_property_data
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
#include "hw-tree.h"
|
#include "hw-tree.h"
|
||||||
@ -29,10 +33,6 @@
|
|||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
/* manipulate/lookup device names */
|
/* manipulate/lookup device names */
|
||||||
|
|
||||||
typedef struct _name_specifier
|
typedef struct _name_specifier
|
||||||
|
@ -21,24 +21,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
/* For strsignal. */
|
/* For strsignal. */
|
||||||
#include <string.h>
|
#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-main.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
#include "sim/callback.h"
|
#include "sim/callback.h"
|
||||||
|
|
||||||
#include "bfd.h"
|
|
||||||
#include "environ.h"
|
|
||||||
|
|
||||||
#ifndef HAVE_STRSIGNAL
|
#ifndef HAVE_STRSIGNAL
|
||||||
/* While libiberty provides a fallback, it doesn't provide a prototype. */
|
/* While libiberty provides a fallback, it doesn't provide a prototype. */
|
||||||
extern const char *strsignal (int);
|
extern const char *strsignal (int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
/* For chdir. */
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void usage (void);
|
static void usage (void);
|
||||||
|
|
||||||
extern host_callback default_callback;
|
extern host_callback default_callback;
|
||||||
|
@ -23,13 +23,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "libiberty.h"
|
|
||||||
#include "sim-basics.h"
|
|
||||||
#include "sim-arange.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
|
#include "sim-basics.h"
|
||||||
|
#include "sim-arange.h"
|
||||||
|
|
||||||
/* Insert a range. */
|
/* Insert a range. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#ifndef SIM_ASSERT_H
|
#ifndef SIM_ASSERT_H
|
||||||
#define SIM_ASSERT_H
|
#define SIM_ASSERT_H
|
||||||
|
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
/* The subtle difference between SIM_ASSERT and ASSERT is that
|
/* The subtle difference between SIM_ASSERT and ASSERT is that
|
||||||
SIM_ASSERT passes `sd' to sim_io_error for the SIM_DESC,
|
SIM_ASSERT passes `sd' to sim_io_error for the SIM_DESC,
|
||||||
ASSERT passes NULL. */
|
ASSERT passes NULL. */
|
||||||
@ -28,7 +30,6 @@
|
|||||||
#if !defined (SIM_ASSERT)
|
#if !defined (SIM_ASSERT)
|
||||||
#if defined (WITH_ASSERT)
|
#if defined (WITH_ASSERT)
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "libiberty.h"
|
|
||||||
#define SIM_ASSERT(EXPRESSION) \
|
#define SIM_ASSERT(EXPRESSION) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
@ -51,7 +52,6 @@ while (0)
|
|||||||
#if !defined (ASSERT)
|
#if !defined (ASSERT)
|
||||||
#if defined (WITH_ASSERT)
|
#if defined (WITH_ASSERT)
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "libiberty.h"
|
|
||||||
#define ASSERT(EXPRESSION) \
|
#define ASSERT(EXPRESSION) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
/* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
|
/* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
|
||||||
bring potential conflicts out in the open */
|
bring potential conflicts out in the open */
|
||||||
|
|
||||||
|
#include <setjmp.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <setjmp.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
|
@ -22,9 +22,10 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include "bfd.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "bfd.h"
|
|
||||||
|
|
||||||
|
|
||||||
enum bfd_endian current_target_byte_order = BFD_ENDIAN_UNKNOWN;
|
enum bfd_endian current_target_byte_order = BFD_ENDIAN_UNKNOWN;
|
||||||
|
@ -26,17 +26,18 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
#include "libiberty.h"
|
|
||||||
|
|
||||||
#if (WITH_HW)
|
#if (WITH_HW)
|
||||||
#include "sim-hw.h"
|
#include "sim-hw.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* "core" module install handler.
|
/* "core" module install handler.
|
||||||
|
|
||||||
This is called via sim_module_install to install the "core"
|
This is called via sim_module_install to install the "core"
|
||||||
|
@ -22,9 +22,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
|
|
||||||
/* Allocate space for all cpus in the simulator.
|
/* Allocate space for all cpus in the simulator.
|
||||||
Space for the cpu must currently exist prior to parsing ARGV. */
|
Space for the cpu must currently exist prior to parsing ARGV. */
|
||||||
/* ??? wip. better solution must wait. */
|
/* ??? wip. better solution must wait. */
|
||||||
|
@ -20,13 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* Get the run state.
|
/* Get the run state.
|
||||||
REASON/SIGRC are the values returned by sim_stop_reason.
|
REASON/SIGRC are the values returned by sim_stop_reason.
|
||||||
??? Should each cpu have its own copy? */
|
??? Should each cpu have its own copy? */
|
||||||
|
@ -26,14 +26,15 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#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-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "sim-cpu.h"
|
#include "sim-cpu.h"
|
||||||
#include "libiberty.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <signal.h> /* For SIGPROCMASK et al. */
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
watch_invalid,
|
watch_invalid,
|
||||||
|
@ -38,14 +38,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "sim-basics.h"
|
#include "sim-basics.h"
|
||||||
#include "sim-fpu.h"
|
#include "sim-fpu.h"
|
||||||
|
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* Debugging support.
|
/* Debugging support.
|
||||||
If digits is -1, then print all digits. */
|
If digits is -1, then print all digits. */
|
||||||
|
|
||||||
|
@ -20,8 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
#include "sim-utils.h"
|
#include "sim-utils.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
@ -32,12 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "hw-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
|
|
||||||
struct sim_hw {
|
struct sim_hw {
|
||||||
struct hw *tree;
|
struct hw *tree;
|
||||||
int trace_p;
|
int trace_p;
|
||||||
|
@ -22,20 +22,18 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include "sim-io.h"
|
|
||||||
#include "sim/callback.h"
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#if HAVE_FCNTL_H
|
#if HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <stdlib.h>
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include "sim-main.h"
|
||||||
|
#include "sim-io.h"
|
||||||
|
#include "sim/callback.h"
|
||||||
|
|
||||||
#undef open
|
#undef open
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#ifndef SIM_IO_H
|
#ifndef SIM_IO_H
|
||||||
#define SIM_IO_H
|
#define SIM_IO_H
|
||||||
|
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* See the file include/callbacks.h for a description */
|
/* See the file include/callbacks.h for a description */
|
||||||
|
|
||||||
int sim_io_init (SIM_DESC sd);
|
int sim_io_init (SIM_DESC sd);
|
||||||
@ -86,9 +89,6 @@ void sim_io_poll_quit (SIM_DESC sd);
|
|||||||
/* Returns -1 and sets (host) EAGAIN if not ready. */
|
/* Returns -1 and sets (host) EAGAIN if not ready. */
|
||||||
int sim_io_poll_read (SIM_DESC sd, int, char *, int);
|
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_stat (SIM_DESC sd, const char *path, struct stat *buf);
|
||||||
|
|
||||||
int sim_io_fstat (SIM_DESC sd, int fd, struct stat *buf);
|
int sim_io_fstat (SIM_DESC sd, int fd, struct stat *buf);
|
||||||
|
@ -21,12 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "ansidecl.h"
|
|
||||||
#include <stdio.h> /* for NULL */
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h> /* for NULL */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "ansidecl.h"
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
|
||||||
#include "sim/callback.h"
|
#include "sim/callback.h"
|
||||||
|
@ -20,25 +20,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include "sim-assert.h"
|
|
||||||
#include "sim-options.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_STAT_H
|
#ifdef HAVE_SYS_STAT_H
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
#include "sim-main.h"
|
||||||
#endif
|
#include "sim-assert.h"
|
||||||
|
#include "sim-options.h"
|
||||||
|
|
||||||
/* Memory fill byte. */
|
/* Memory fill byte. */
|
||||||
static unsigned8 fill_byte_value;
|
static unsigned8 fill_byte_value;
|
||||||
|
@ -20,13 +20,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include "bfd.h"
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-model.h"
|
#include "sim-model.h"
|
||||||
#include "libiberty.h"
|
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "bfd.h"
|
|
||||||
|
|
||||||
static void model_set (sim_cpu *, const SIM_MODEL *);
|
static void model_set (sim_cpu *, const SIM_MODEL *);
|
||||||
|
|
||||||
|
@ -22,15 +22,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
#include "libiberty.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* List of all early/core modules.
|
/* List of all early/core modules.
|
||||||
TODO: Should trim this list by converting to sim_install_* framework. */
|
TODO: Should trim this list by converting to sim_install_* framework. */
|
||||||
static MODULE_INSTALL_FN * const early_modules[] = {
|
static MODULE_INSTALL_FN * const early_modules[] = {
|
||||||
|
@ -20,21 +20,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "bfd.h"
|
||||||
|
#include "environ.h"
|
||||||
|
#include "hashtab.h"
|
||||||
#include "libiberty.h"
|
#include "libiberty.h"
|
||||||
|
|
||||||
|
#include "sim-main.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "environ.h"
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "hashtab.h"
|
|
||||||
|
|
||||||
#include "bfd.h"
|
|
||||||
|
|
||||||
/* Add a set of options to the simulator.
|
/* Add a set of options to the simulator.
|
||||||
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.
|
||||||
|
@ -20,15 +20,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#if !WITH_PROFILE_PC_P
|
#if !WITH_PROFILE_PC_P
|
||||||
static unsigned int _profile_stub;
|
static unsigned int _profile_stub;
|
||||||
# define PROFILE_PC_FREQ(p) _profile_stub
|
# define PROFILE_PC_FREQ(p) _profile_stub
|
||||||
|
@ -20,12 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* Generic implementation of sim_stop_reason */
|
/* Generic implementation of sim_stop_reason */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
|
|
||||||
|
@ -20,22 +20,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "bfd.h"
|
||||||
|
#include "dis-asm.h"
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
|
#include "sim-assert.h"
|
||||||
#include "sim-io.h"
|
#include "sim-io.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-fpu.h"
|
#include "sim-fpu.h"
|
||||||
#include "sim/callback.h"
|
#include "sim/callback.h"
|
||||||
|
|
||||||
#include "bfd.h"
|
|
||||||
#include "libiberty.h"
|
|
||||||
|
|
||||||
#include "dis-asm.h"
|
|
||||||
|
|
||||||
#include "sim-assert.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifndef SIZE_PHASE
|
#ifndef SIZE_PHASE
|
||||||
#define SIZE_PHASE 8
|
#define SIZE_PHASE 8
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,16 +21,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h> /* needed by sys/resource.h */
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_RESOURCE_H
|
#ifdef HAVE_SYS_RESOURCE_H
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <sys/time.h> /* needed by sys/resource.h */
|
||||||
|
|
||||||
#include "libiberty.h"
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
#include "sim-utils.h"
|
#include "sim-utils.h"
|
||||||
|
@ -20,18 +20,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "sim-main.h"
|
||||||
#include "sim-options.h"
|
#include "sim-options.h"
|
||||||
#include "sim-signal.h"
|
#include "sim-signal.h"
|
||||||
#include "libiberty.h"
|
|
||||||
|
|
||||||
#include "sim-assert.h"
|
#include "sim-assert.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
OPTION_WATCH_DELETE = OPTION_START,
|
OPTION_WATCH_DELETE = OPTION_START,
|
||||||
|
|
||||||
|
@ -26,20 +26,22 @@
|
|||||||
/* This must come before any other includes. */
|
/* This must come before any other includes. */
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
#include "ansidecl.h"
|
#include <errno.h>
|
||||||
#include "libiberty.h"
|
#include <fcntl.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "ansidecl.h"
|
||||||
|
#include "libiberty.h"
|
||||||
|
|
||||||
#include "sim/callback.h"
|
#include "sim/callback.h"
|
||||||
|
|
||||||
#ifndef ENOSYS
|
#ifndef ENOSYS
|
||||||
|
Reference in New Issue
Block a user