Fix reconnecting to a gdbserver already debugging multiple processes, II
[deliverable/binutils-gdb.git] / sim / ppc / device_table.h
index 3e2a158f9c904afbb9cd8494d93a7ef93b739650..654ecade4b01f0395b13fc55d5c33ca31b02dce1 100644 (file)
@@ -4,7 +4,7 @@
 
     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
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     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.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
  
     */
 
 #ifndef _DEVICE_TABLE_H_
 #define _DEVICE_TABLE_H_
 
-#include <stdarg.h>
-
 #include "basics.h"
 #include "device.h"
+#include "tree.h"
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -63,13 +61,12 @@ typedef struct _device_init_callbacks {
 
 typedef void (device_address_callback)
      (device *me,
-      const char *name,
       attach_type attach,
       int space,
       unsigned_word addr,
       unsigned nr_bytes,
       access_type access,
-      device *who); /*callback/default*/
+      device *client); /*callback/default*/
 
 typedef struct _device_address_callbacks {
   device_address_callback *attach;
@@ -149,7 +146,8 @@ typedef void (device_child_interrupt_event_callback)
 typedef struct _device_interrupt_port_descriptor {
   const char *name;
   int number; 
-  int bound;
+  int nr_ports;
+  port_direction direction;
 } device_interrupt_port_descriptor;
 
 typedef struct _device_interrupt_callbacks {
@@ -162,19 +160,34 @@ typedef struct _device_interrupt_callbacks {
 /* symbolic value decoding */
 
 typedef int (device_unit_decode_callback)
-     (device *me,
+     (device *bus,
       const char *unit,
       device_unit *address);
 
 typedef int (device_unit_encode_callback)
-     (device *me,
+     (device *bus,
       const device_unit *unit_address,
       char *buf,
       int sizeof_buf);
 
+typedef int (device_address_to_attach_address_callback)
+     (device *bus,
+      const device_unit *address,
+      int *attach_space,
+      unsigned_word *attach_address,
+      device *client);
+
+typedef int (device_size_to_attach_size_callback)
+     (device *bus,
+      const device_unit *size,
+      unsigned *nr_bytes,
+      device *client);
+
 typedef struct _device_convert_callbacks {
   device_unit_decode_callback *decode_unit;
   device_unit_encode_callback *encode_unit;
+  device_address_to_attach_address_callback *address_to_attach_address;
+  device_size_to_attach_size_callback *size_to_attach_size;
 } device_convert_callbacks;
 
 
@@ -198,29 +211,29 @@ typedef int (device_instance_seek_callback)
       unsigned_word pos_hi,
       unsigned_word pos_lo);
 
-typedef unsigned_word (device_instance_claim_callback)
+typedef int (device_instance_method)
      (device_instance *instance,
-      unsigned_word address,
-      unsigned_word length,
-      unsigned_word alignment);
+      int n_stack_args,
+      unsigned_cell stack_args[/*n_stack_args*/],
+      int n_stack_returns,
+      unsigned_cell stack_returns[/*n_stack_returns*/]);
 
-typedef void (device_instance_release_callback)
-     (device_instance *instance,
-      unsigned_word address,
-      unsigned_word length);
+typedef struct _device_instance_methods {
+  const char *name;
+  device_instance_method *method;
+} device_instance_methods;
 
 struct _device_instance_callbacks { /* NULL - error */
   device_instance_delete_callback *delete;
   device_instance_read_callback *read;
   device_instance_write_callback *write;
   device_instance_seek_callback *seek;
-  device_instance_claim_callback *claim;
-  device_instance_release_callback *release;
+  const device_instance_methods *methods;
 };
 
 typedef device_instance *(device_create_instance_callback)
      (device *me,
-      const char *path,
+      const char *full_path,
       const char *args);
 
 typedef device_instance *(package_create_instance_callback)
@@ -234,6 +247,7 @@ typedef int (device_ioctl_callback)
      (device *me,
       cpu *processor,
       unsigned_word cia,
+      device_ioctl_request request,
       va_list ap);
 
 typedef void (device_usage_callback)
@@ -299,6 +313,8 @@ extern device_unit_decode_callback ignore_device_unit_decode;
 extern device_init_callback generic_device_init_address;
 extern device_unit_decode_callback generic_device_unit_decode;
 extern device_unit_encode_callback generic_device_unit_encode;
+extern device_address_to_attach_address_callback generic_device_address_to_attach_address;
+extern device_size_to_attach_size_callback generic_device_size_to_attach_size;
 
 
 extern const device_callbacks passthrough_device_callbacks;
This page took 0.03114 seconds and 4 git commands to generate.