aboutsummaryrefslogtreecommitdiff
path: root/sim/common/hw-base.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-05-25 07:08:48 +0000
committerAndrew Cagney <cagney@redhat.com>1998-05-25 07:08:48 +0000
commit2f06c437e28ea3bfab27cc9b9b11dd235397a938 (patch)
treeb930b8f8afb52ab1b9d775a084a67cb50d10bc71 /sim/common/hw-base.h
parentf67574471894a2e1ebfc9ba7a5b154b9735da2e9 (diff)
downloadgdb-2f06c437e28ea3bfab27cc9b9b11dd235397a938.zip
gdb-2f06c437e28ea3bfab27cc9b9b11dd235397a938.tar.gz
gdb-2f06c437e28ea3bfab27cc9b9b11dd235397a938.tar.bz2
Clean up create/delete of hw-ports
Diffstat (limited to 'sim/common/hw-base.h')
-rw-r--r--sim/common/hw-base.h49
1 files changed, 32 insertions, 17 deletions
diff --git a/sim/common/hw-base.h b/sim/common/hw-base.h
index ee787dd..27702c8 100644
--- a/sim/common/hw-base.h
+++ b/sim/common/hw-base.h
@@ -42,7 +42,7 @@ struct hw_device_descriptor {
/* Create a primative device */
struct hw *hw_create
-(SIM_DESC sd,
+(struct sim_state *sd,
struct hw *parent,
const char *family,
const char *name,
@@ -106,23 +106,38 @@ typedef void (hw_delete_callback)
((hw)->base_of_hw->to_delete = (method))
-struct hw_port_descriptor {
- const char *name;
- int number;
- int nr_ports;
- port_direction direction;
+/* Helper functions to make the implementation of a device easier */
+
+/* Go through the devices reg properties and look for those specifying
+ an address to attach various registers to */
+
+void do_hw_attach_regs (struct hw *me);
+
+/* Perform a polling read on FD returning either the number of bytes
+ or a hw_io status code that indicates the reason for the read
+ failure */
+
+enum {
+ HW_IO_EOF = -1, HW_IO_NOT_READY = -2, /* See: IEEE 1275 */
};
-typedef void (hw_port_event_callback)
- (struct hw *me,
- int my_port,
- struct hw *source,
- int source_port,
- int level,
- sim_cpu *processor,
- sim_cia cia);
-
-extern void set_hw_ports (struct hw *hw, const struct hw_port_descriptor ports[]);
-extern void set_hw_port_event (struct hw *hw, hw_port_event_callback *to_port_event);
+typedef int (do_hw_poll_read_method)
+ (SIM_DESC sd, int, char *, int);
+
+int do_hw_poll_read
+(struct hw *me,
+ do_hw_poll_read_method *read,
+ int sim_io_fd,
+ void *buf,
+ unsigned size_of_buf);
+
+
+/* PORTS */
+
+extern void create_hw_port_data
+(struct hw *hw);
+extern void delete_hw_port_data
+(struct hw *hw);
+
#endif