2002-11-22 Andrew Cagney <ac131313@redhat.com>
[deliverable/binutils-gdb.git] / sim / common / sim-core.h
index 8600965cd90b3591e0272af61cfc00e3939b69d3..14725fb0ab980a7113993acbb1ec16a980260bb6 100644 (file)
@@ -1,22 +1,25 @@
-/*  This file is part of the program psim.
+/* The common simulator framework for GDB, the GNU Debugger.
 
-    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
+   Copyright 2002 Free Software Foundation, Inc.
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+   Contributed by Andrew Cagney and Red Hat.
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    */
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 
 #ifndef SIM_CORE_H
@@ -98,8 +101,7 @@ typedef struct _sim_cpu_core {
 
 /* Install the "core" module.  */
 
-EXTERN_SIM_CORE\
-(SIM_RC) sim_core_install (SIM_DESC sd);
+extern SIM_RC sim_core_install (SIM_DESC sd);
 
 
 
@@ -136,8 +138,7 @@ EXTERN_SIM_CORE\
    hook that allows clients to do nasty things that the interface doesn't
    accomodate. */
 
-EXTERN_SIM_CORE\
-(void) sim_core_attach
+extern void sim_core_attach
 (SIM_DESC sd,
  sim_cpu *cpu,
  int level,
@@ -158,8 +159,7 @@ EXTERN_SIM_CORE\
 
  */
 
-EXTERN_SIM_CORE\
-(void) sim_core_detach
+extern void sim_core_detach
 (SIM_DESC sd,
  sim_cpu *cpu,
  int level,
@@ -170,7 +170,7 @@ EXTERN_SIM_CORE\
 /* Variable sized read/write
 
    Transfer a variable sized block of raw data between the host and
-   target.  Should any problems occure, the number of bytes
+   target.  Should any problems occur, the number of bytes
    successfully transfered is returned.
 
    No host/target byte endian conversion is performed.  No xor-endian
@@ -180,8 +180,7 @@ EXTERN_SIM_CORE\
    address map that is to be used in the transfer. */
 
 
-EXTERN_SIM_CORE\
-(unsigned) sim_core_read_buffer
+extern unsigned sim_core_read_buffer
 (SIM_DESC sd,
  sim_cpu *cpu,
  unsigned map,
@@ -189,8 +188,7 @@ EXTERN_SIM_CORE\
  address_word addr,
  unsigned nr_bytes);
 
-EXTERN_SIM_CORE\
-(unsigned) sim_core_write_buffer
+extern unsigned sim_core_write_buffer
 (SIM_DESC sd,
  sim_cpu *cpu,
  unsigned map,
@@ -209,8 +207,7 @@ EXTERN_SIM_CORE\
    The CPU argument, when non NULL, specifes the single processor that
    the xor-endian configuration is to be applied to. */
 
-EXTERN_SIM_CORE\
-(void) sim_core_set_xor\
+extern void sim_core_set_xor
 (SIM_DESC sd,
  sim_cpu *cpu,
  int is_xor);
@@ -219,7 +216,7 @@ EXTERN_SIM_CORE\
 /* XOR version of variable sized read/write.
 
    Transfer a variable sized block of raw data between the host and
-   target.  Should any problems occure, the number of bytes
+   target.  Should any problems occur, the number of bytes
    successfully transfered is returned.
 
    No host/target byte endian conversion is performed.  If applicable
@@ -229,8 +226,7 @@ EXTERN_SIM_CORE\
    If CPU argument, when non NULL, specifies the processor specific
    address map that is to be used in the transfer. */
 
-EXTERN_SIM_CORE\
-(unsigned) sim_core_xor_read_buffer
+extern unsigned sim_core_xor_read_buffer
 (SIM_DESC sd,
  sim_cpu *cpu,
  unsigned map,
@@ -238,8 +234,7 @@ EXTERN_SIM_CORE\
  address_word addr,
  unsigned nr_bytes);
 
-EXTERN_SIM_CORE\
-(unsigned) sim_core_xor_write_buffer
+extern unsigned sim_core_xor_write_buffer
 (SIM_DESC sd,
  sim_cpu *cpu,
  unsigned map,
@@ -348,4 +343,13 @@ DECLARE_SIM_CORE_READ_N(misaligned,7,8)
 #undef DECLARE_SIM_CORE_READ_N
 
 
+#if (WITH_DEVICES)
+/* TODO: create sim/common/device.h */
+/* These are defined with each particular cpu.  */
+void device_error (device *me, char* message, ...);
+int device_io_read_buffer(device *me, void *dest, int space, address_word addr, unsigned nr_bytes, SIM_DESC sd, sim_cpu *processor, sim_cia cia);
+int device_io_write_buffer(device *me, const void *source, int space, address_word addr, unsigned nr_bytes, SIM_DESC sd, sim_cpu *processor, sim_cia cia);
+#endif
+
+
 #endif
This page took 0.025446 seconds and 4 git commands to generate.