Make hw-main.h the main header file for H/W devices. Like sim-main.h
Update dv-*.c Replace *_callback with more correct. *_method. Update dv-*.c
This commit is contained in:
parent
c14db36dbb
commit
48f83b1a2e
|
@ -65,6 +65,7 @@ hw-device.c
|
||||||
hw-device.h
|
hw-device.h
|
||||||
hw-events.c
|
hw-events.c
|
||||||
hw-events.h
|
hw-events.h
|
||||||
|
hw-main.h
|
||||||
hw-ports.c
|
hw-ports.c
|
||||||
hw-ports.h
|
hw-ports.h
|
||||||
hw-properties.c
|
hw-properties.c
|
||||||
|
@ -100,6 +101,8 @@ sim-fpu.c
|
||||||
sim-fpu.h
|
sim-fpu.h
|
||||||
sim-hload.c
|
sim-hload.c
|
||||||
sim-hrw.c
|
sim-hrw.c
|
||||||
|
sim-hw.c
|
||||||
|
sim-hw.h
|
||||||
sim-info.c
|
sim-info.c
|
||||||
sim-inline.c
|
sim-inline.c
|
||||||
sim-inline.h
|
sim-inline.h
|
||||||
|
|
|
@ -1,3 +1,31 @@
|
||||||
|
Mon May 25 18:55:35 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
|
* dv-core.c: Include hw-main.h and sim-main.h.
|
||||||
|
* dv-pal.c: Include hw-main.h and sim-io.h.
|
||||||
|
* dv-glue.c: Include hw-main.h.
|
||||||
|
|
||||||
|
* hw-main.h: New file. Move list of includes to here.
|
||||||
|
* hw-base.h: From here.
|
||||||
|
* Make-common.in (hw_base_headers): Rename to hw_main_headers.
|
||||||
|
(hw-*.o, dv-*.o): Update.
|
||||||
|
* hw-tree.c, hw-base.c, hw-properties.c, hw-ports.c, hw-device.c,
|
||||||
|
hw-events.c, hw-alloc.c, sim-hw.c: Include hw-main.h instead of
|
||||||
|
sim-main.h.
|
||||||
|
|
||||||
|
* hw-base.h (do_hw_attach_regs, do_hw_poll_read_method,
|
||||||
|
do_hw_poll_read): Move declarations from here.
|
||||||
|
* hw-main.h: To here.
|
||||||
|
|
||||||
|
* hw-base.h (struct hw_device_descriptor, hw_finish_callback):
|
||||||
|
Move from here.
|
||||||
|
* hw-main.h (struct hw_descriptor, hw_finish_method): To here,
|
||||||
|
rename.
|
||||||
|
* Make-common.in (hw-config.h): Update
|
||||||
|
* hw-base.c, dv-pal.c, dv-glue.c: Update
|
||||||
|
|
||||||
|
* dv-glue.c, hw-device.h, hw-base.h, hw-ports.c: Rename
|
||||||
|
`*_callback' to `*_method.
|
||||||
|
|
||||||
Mon May 25 18:41:18 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
Mon May 25 18:41:18 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
* hw-base.h (set_*): Move set method macros from here.
|
* hw-base.h (set_*): Move set method macros from here.
|
||||||
|
|
|
@ -325,7 +325,8 @@ hw-ports_h = $(srccom)/hw-ports.h
|
||||||
hw-properties_h = $(srccom)/hw-properties.h
|
hw-properties_h = $(srccom)/hw-properties.h
|
||||||
hw-tree_h = $(srccom)/hw-tree.h
|
hw-tree_h = $(srccom)/hw-tree.h
|
||||||
|
|
||||||
hw_base_headers = \
|
hw_main_headers = \
|
||||||
|
$(srccom)/hw-main.h \
|
||||||
$(hw-alloc_h) \
|
$(hw-alloc_h) \
|
||||||
$(hw-base_h) \
|
$(hw-base_h) \
|
||||||
$(hw-device_h) \
|
$(hw-device_h) \
|
||||||
|
@ -465,9 +466,9 @@ hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
|
||||||
rm -f tmp-hw.h
|
rm -f tmp-hw.h
|
||||||
echo "/* generated by Makefile */" > tmp-hw.h
|
echo "/* generated by Makefile */" > tmp-hw.h
|
||||||
for hw in $(SIM_HW) ; do \
|
for hw in $(SIM_HW) ; do \
|
||||||
echo "extern const struct hw_device_descriptor dv_$${hw}_descriptor[];" ; \
|
echo "extern const struct hw_descriptor dv_$${hw}_descriptor[];" ; \
|
||||||
done >> tmp-hw.h
|
done >> tmp-hw.h
|
||||||
echo "const struct hw_device_descriptor *hw_descriptors[] = {" >> tmp-hw.h
|
echo "const struct hw_descriptor *hw_descriptors[] = {" >> tmp-hw.h
|
||||||
for hw in $(SIM_HW) ; do \
|
for hw in $(SIM_HW) ; do \
|
||||||
echo " dv_$${hw}_descriptor," ; \
|
echo " dv_$${hw}_descriptor," ; \
|
||||||
done >> tmp-hw.h
|
done >> tmp-hw.h
|
||||||
|
@ -475,53 +476,41 @@ hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
|
||||||
echo "};" >> tmp-hw.h
|
echo "};" >> tmp-hw.h
|
||||||
mv tmp-hw.h hw-config.h
|
mv tmp-hw.h hw-config.h
|
||||||
|
|
||||||
hw-alloc.o: $(srccom)/hw-alloc.c $(sim_main_headers) \
|
hw-alloc.o: $(srccom)/hw-alloc.c $(hw_main_headers)
|
||||||
$(hw-alloc_h)
|
|
||||||
$(CC) -c $(srccom)/hw-alloc.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-alloc.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-base.o: $(srccom)/hw-base.c $(sim_main_headers) \
|
hw-base.o: $(srccom)/hw-base.c $(hw_main_headers) hw-config.h
|
||||||
$(hw_base_headers) hw-config.h
|
|
||||||
$(CC) -c $(srccom)/hw-base.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-base.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-device.o: $(srccom)/hw-device.c $(sim_main_headers) \
|
hw-device.o: $(srccom)/hw-device.c $(hw_main_headers)
|
||||||
$(hw-device_h)
|
|
||||||
$(CC) -c $(srccom)/hw-device.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-device.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-events.o: $(srccom)/hw-events.c $(sim_main_headers) \
|
hw-events.o: $(srccom)/hw-events.c $(hw_main_headers) $(sim_main_headers)
|
||||||
$(hw-events_h)
|
|
||||||
$(CC) -c $(srccom)/hw-events.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-events.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-instances.o: $(srccom)/hw-instances.c $(sim_main_headers) \
|
hw-instances.o: $(srccom)/hw-instances.c $(hw_main_headers)
|
||||||
$(hw_base_headers)
|
|
||||||
$(CC) -c $(srccom)/hw-instances.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-instances.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-handles.o: $(srccom)/hw-handles.c $(sim_main_headers) \
|
hw-handles.o: $(srccom)/hw-handles.c $(hw_main_headers)
|
||||||
$(hw_base_headers)
|
|
||||||
$(CC) -c $(srccom)/hw-handles.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-handles.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-ports.o: $(srccom)/hw-ports.c $(sim_main_headers) \
|
hw-ports.o: $(srccom)/hw-ports.c $(hw_main_headers)
|
||||||
$(hw-ports_h)
|
|
||||||
$(CC) -c $(srccom)/hw-ports.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-ports.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-properties.o: $(srccom)/hw-properties.c $(sim_main_headers) \
|
hw-properties.o: $(srccom)/hw-properties.c $(hw_main_headers)
|
||||||
$(hw-properties_h)
|
|
||||||
$(CC) -c $(srccom)/hw-properties.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-properties.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
hw-tree.o: $(srccom)/hw-tree.c $(sim_main_headers) \
|
hw-tree.o: $(srccom)/hw-tree.c $(hw_main_headers) $(hw-tree_h)
|
||||||
$(hw-tree_h) $(hw_base_headers)
|
|
||||||
$(CC) -c $(srccom)/hw-tree.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/hw-tree.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
dv-core.o: $(srccom)/dv-core.c $(sim_main_headers) \
|
dv-core.o: $(srccom)/dv-core.c $(hw_main_headers) $(sim_main_headers)
|
||||||
$(sim-main_h) $(hw_base_headers)
|
|
||||||
$(CC) -c $(srccom)/dv-core.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/dv-core.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
dv-glue.o: $(srccom)/dv-glue.c $(sim_main_headers) \
|
dv-glue.o: $(srccom)/dv-glue.c $(hw_main_headers) $(sim_main_headers)
|
||||||
$(sim-main_h) $(hw_base_headers)
|
|
||||||
$(CC) -c $(srccom)/dv-glue.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/dv-glue.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
dv-pal.o: $(srccom)/dv-pal.c $(sim_main_headers) \
|
dv-pal.o: $(srccom)/dv-pal.c $(hw_main_headers) $(sim_main_headers)
|
||||||
$(sim-main_h) $(hw_base_headers)
|
|
||||||
$(CC) -c $(srccom)/dv-pal.c $(ALL_CFLAGS)
|
$(CC) -c $(srccom)/dv-pal.c $(ALL_CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "sim-main.h"
|
#include "hw-main.h"
|
||||||
#include "hw-base.h"
|
#include "hw-base.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
struct hw_base_data {
|
struct hw_base_data {
|
||||||
int finished_p;
|
int finished_p;
|
||||||
const struct hw_device_descriptor *descriptor;
|
const struct hw_descriptor *descriptor;
|
||||||
hw_delete_callback *to_delete;
|
hw_delete_callback *to_delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -393,12 +393,12 @@ hw_create (struct sim_state *sd,
|
||||||
|
|
||||||
/* locate a descriptor */
|
/* locate a descriptor */
|
||||||
{
|
{
|
||||||
const struct hw_device_descriptor **table;
|
const struct hw_descriptor **table;
|
||||||
for (table = hw_descriptors;
|
for (table = hw_descriptors;
|
||||||
*table != NULL;
|
*table != NULL;
|
||||||
table++)
|
table++)
|
||||||
{
|
{
|
||||||
const struct hw_device_descriptor *entry;
|
const struct hw_descriptor *entry;
|
||||||
for (entry = *table;
|
for (entry = *table;
|
||||||
entry->family != NULL;
|
entry->family != NULL;
|
||||||
entry++)
|
entry++)
|
||||||
|
|
|
@ -19,27 +19,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef HW_ROOT
|
#ifndef HW_BASE
|
||||||
#define HW_ROOT
|
#define HW_BASE
|
||||||
|
|
||||||
/* A root device from which dv-* devices can be built */
|
|
||||||
|
|
||||||
#include "hw-device.h"
|
|
||||||
|
|
||||||
#include "hw-properties.h"
|
|
||||||
#include "hw-events.h"
|
|
||||||
#include "hw-alloc.h"
|
|
||||||
/* #include "hw-instances.h" */
|
|
||||||
/* #include "hw-handles.h" */
|
|
||||||
#include "hw-ports.h"
|
|
||||||
|
|
||||||
typedef void (hw_finish_callback)
|
|
||||||
(struct hw *me);
|
|
||||||
|
|
||||||
struct hw_device_descriptor {
|
|
||||||
const char *family;
|
|
||||||
hw_finish_callback *to_finish;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Create a primative device */
|
/* Create a primative device */
|
||||||
|
|
||||||
|
@ -77,32 +58,6 @@ typedef void (hw_delete_callback)
|
||||||
((hw)->base_of_hw->to_delete = (method))
|
((hw)->base_of_hw->to_delete = (method))
|
||||||
|
|
||||||
|
|
||||||
/* 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 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);
|
|
||||||
|
|
||||||
|
|
||||||
/* ALLOC */
|
/* ALLOC */
|
||||||
|
|
||||||
extern void create_hw_alloc_data
|
extern void create_hw_alloc_data
|
||||||
|
|
|
@ -157,7 +157,7 @@ struct _sim_cpu *hw_system_cpu (struct hw *hw);
|
||||||
|
|
||||||
/* Perform a soft reset of the device */
|
/* Perform a soft reset of the device */
|
||||||
|
|
||||||
typedef unsigned (hw_reset_callback)
|
typedef unsigned (hw_reset_method)
|
||||||
(struct hw *me);
|
(struct hw *me);
|
||||||
|
|
||||||
#define hw_reset(hw) ((hw)->to_reset (hw))
|
#define hw_reset(hw) ((hw)->to_reset (hw))
|
||||||
|
@ -190,7 +190,7 @@ typedef unsigned (hw_reset_callback)
|
||||||
The SPACE:ADDR pair specify an address on the common bus that
|
The SPACE:ADDR pair specify an address on the common bus that
|
||||||
connects the parent and child devices. */
|
connects the parent and child devices. */
|
||||||
|
|
||||||
typedef void (hw_attach_address_callback)
|
typedef void (hw_attach_address_method)
|
||||||
(struct hw *me,
|
(struct hw *me,
|
||||||
int level,
|
int level,
|
||||||
int space,
|
int space,
|
||||||
|
@ -204,7 +204,7 @@ typedef void (hw_attach_address_callback)
|
||||||
#define set_hw_attach_address(hw, method) \
|
#define set_hw_attach_address(hw, method) \
|
||||||
((hw)->to_attach_address = (method))
|
((hw)->to_attach_address = (method))
|
||||||
|
|
||||||
typedef void (hw_detach_address_callback)
|
typedef void (hw_detach_address_method)
|
||||||
(struct hw *me,
|
(struct hw *me,
|
||||||
int level,
|
int level,
|
||||||
int space,
|
int space,
|
||||||
|
@ -224,7 +224,7 @@ typedef void (hw_detach_address_callback)
|
||||||
The SPACE:ADDR pair specify an address on the bus shared between
|
The SPACE:ADDR pair specify an address on the bus shared between
|
||||||
the parent and child devices. */
|
the parent and child devices. */
|
||||||
|
|
||||||
typedef unsigned (hw_io_read_buffer_callback)
|
typedef unsigned (hw_io_read_buffer_method)
|
||||||
(struct hw *me,
|
(struct hw *me,
|
||||||
void *dest,
|
void *dest,
|
||||||
int space,
|
int space,
|
||||||
|
@ -237,7 +237,7 @@ typedef unsigned (hw_io_read_buffer_callback)
|
||||||
#define set_hw_io_read_buffer(hw, method) \
|
#define set_hw_io_read_buffer(hw, method) \
|
||||||
((hw)->to_io_read_buffer = (method))
|
((hw)->to_io_read_buffer = (method))
|
||||||
|
|
||||||
typedef unsigned (hw_io_write_buffer_callback)
|
typedef unsigned (hw_io_write_buffer_method)
|
||||||
(struct hw *me,
|
(struct hw *me,
|
||||||
const void *source,
|
const void *source,
|
||||||
int space,
|
int space,
|
||||||
|
@ -260,7 +260,7 @@ typedef unsigned (hw_io_write_buffer_callback)
|
||||||
The SPACE:ADDR pair specify an address on the common bus connecting
|
The SPACE:ADDR pair specify an address on the common bus connecting
|
||||||
the parent and child devices. */
|
the parent and child devices. */
|
||||||
|
|
||||||
typedef unsigned (hw_dma_read_buffer_callback)
|
typedef unsigned (hw_dma_read_buffer_method)
|
||||||
(struct hw *bus,
|
(struct hw *bus,
|
||||||
void *dest,
|
void *dest,
|
||||||
int space,
|
int space,
|
||||||
|
@ -273,7 +273,7 @@ typedef unsigned (hw_dma_read_buffer_callback)
|
||||||
#define set_hw_dma_read_buffer(me, method) \
|
#define set_hw_dma_read_buffer(me, method) \
|
||||||
((me)->to_dma_read_buffer = (method))
|
((me)->to_dma_read_buffer = (method))
|
||||||
|
|
||||||
typedef unsigned (hw_dma_write_buffer_callback)
|
typedef unsigned (hw_dma_write_buffer_method)
|
||||||
(struct hw *bus,
|
(struct hw *bus,
|
||||||
const void *source,
|
const void *source,
|
||||||
int space,
|
int space,
|
||||||
|
@ -324,7 +324,7 @@ const hw_unit *hw_unit_address
|
||||||
textual representation. This is because the textual address of a
|
textual representation. This is because the textual address of a
|
||||||
device is specified using the parent busses notation. */
|
device is specified using the parent busses notation. */
|
||||||
|
|
||||||
typedef int (hw_unit_decode_callback)
|
typedef int (hw_unit_decode_method)
|
||||||
(struct hw *bus,
|
(struct hw *bus,
|
||||||
const char *encoded,
|
const char *encoded,
|
||||||
hw_unit *unit);
|
hw_unit *unit);
|
||||||
|
@ -335,7 +335,7 @@ typedef int (hw_unit_decode_callback)
|
||||||
#define set_hw_unit_decode(hw, method) \
|
#define set_hw_unit_decode(hw, method) \
|
||||||
((hw)->to_unit_decode = (method))
|
((hw)->to_unit_decode = (method))
|
||||||
|
|
||||||
typedef int (hw_unit_encode_callback)
|
typedef int (hw_unit_encode_method)
|
||||||
(struct hw *bus,
|
(struct hw *bus,
|
||||||
const hw_unit *unit,
|
const hw_unit *unit,
|
||||||
char *encoded,
|
char *encoded,
|
||||||
|
@ -355,7 +355,7 @@ typedef int (hw_unit_encode_callback)
|
||||||
Return a zero result if the address should be ignored when looking
|
Return a zero result if the address should be ignored when looking
|
||||||
for attach addresses. */
|
for attach addresses. */
|
||||||
|
|
||||||
typedef int (hw_unit_address_to_attach_address_callback)
|
typedef int (hw_unit_address_to_attach_address_method)
|
||||||
(struct hw *bus,
|
(struct hw *bus,
|
||||||
const hw_unit *unit_addr,
|
const hw_unit *unit_addr,
|
||||||
int *attach_space,
|
int *attach_space,
|
||||||
|
@ -368,7 +368,7 @@ typedef int (hw_unit_address_to_attach_address_callback)
|
||||||
#define set_hw_unit_address_to_attach_address(hw, method) \
|
#define set_hw_unit_address_to_attach_address(hw, method) \
|
||||||
((hw)->to_unit_address_to_attach_address = (method))
|
((hw)->to_unit_address_to_attach_address = (method))
|
||||||
|
|
||||||
typedef int (hw_unit_size_to_attach_size_callback)
|
typedef int (hw_unit_size_to_attach_size_method)
|
||||||
(struct hw *bus,
|
(struct hw *bus,
|
||||||
const hw_unit *unit_size,
|
const hw_unit *unit_size,
|
||||||
unsigned *attach_size,
|
unsigned *attach_size,
|
||||||
|
@ -406,7 +406,7 @@ typedef enum {
|
||||||
nr_hw_ioctl_requests,
|
nr_hw_ioctl_requests,
|
||||||
} hw_ioctl_request;
|
} hw_ioctl_request;
|
||||||
|
|
||||||
typedef int (hw_ioctl_callback)
|
typedef int (hw_ioctl_method)
|
||||||
(struct hw *me,
|
(struct hw *me,
|
||||||
hw_ioctl_request request,
|
hw_ioctl_request request,
|
||||||
va_list ap);
|
va_list ap);
|
||||||
|
@ -498,25 +498,25 @@ struct hw {
|
||||||
int nr_size_cells_of_hw_unit;
|
int nr_size_cells_of_hw_unit;
|
||||||
|
|
||||||
/* Soft reset */
|
/* Soft reset */
|
||||||
hw_reset_callback *to_reset;
|
hw_reset_method *to_reset;
|
||||||
|
|
||||||
/* Basic callbacks */
|
/* Basic callbacks */
|
||||||
hw_io_read_buffer_callback *to_io_read_buffer;
|
hw_io_read_buffer_method *to_io_read_buffer;
|
||||||
hw_io_write_buffer_callback *to_io_write_buffer;
|
hw_io_write_buffer_method *to_io_write_buffer;
|
||||||
hw_dma_read_buffer_callback *to_dma_read_buffer;
|
hw_dma_read_buffer_method *to_dma_read_buffer;
|
||||||
hw_dma_write_buffer_callback *to_dma_write_buffer;
|
hw_dma_write_buffer_method *to_dma_write_buffer;
|
||||||
hw_attach_address_callback *to_attach_address;
|
hw_attach_address_method *to_attach_address;
|
||||||
hw_detach_address_callback *to_detach_address;
|
hw_detach_address_method *to_detach_address;
|
||||||
|
|
||||||
/* More complicated callbacks */
|
/* More complicated callbacks */
|
||||||
hw_ioctl_callback *to_ioctl;
|
hw_ioctl_method *to_ioctl;
|
||||||
int trace_of_hw_p;
|
int trace_of_hw_p;
|
||||||
|
|
||||||
/* address callbacks */
|
/* address callbacks */
|
||||||
hw_unit_decode_callback *to_unit_decode;
|
hw_unit_decode_method *to_unit_decode;
|
||||||
hw_unit_encode_callback *to_unit_encode;
|
hw_unit_encode_method *to_unit_encode;
|
||||||
hw_unit_address_to_attach_address_callback *to_unit_address_to_attach_address;
|
hw_unit_address_to_attach_address_method *to_unit_address_to_attach_address;
|
||||||
hw_unit_size_to_attach_size_callback *to_unit_size_to_attach_size;
|
hw_unit_size_to_attach_size_method *to_unit_size_to_attach_size;
|
||||||
|
|
||||||
/* related data */
|
/* related data */
|
||||||
struct hw_property_data *properties_of_hw;
|
struct hw_property_data *properties_of_hw;
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
/* Common hardware header file.
|
||||||
|
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||||
|
Contributed by Andrew Cagney and Cygnus Support.
|
||||||
|
|
||||||
|
This file is part of GDB, the GNU debugger.
|
||||||
|
|
||||||
|
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, 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 HW_MAIN
|
||||||
|
#define HW_MAIN
|
||||||
|
|
||||||
|
/* establish a type system */
|
||||||
|
#include "sim-basics.h"
|
||||||
|
|
||||||
|
/* construct a hw device */
|
||||||
|
#include "hw-device.h"
|
||||||
|
#include "hw-properties.h"
|
||||||
|
#include "hw-events.h"
|
||||||
|
#include "hw-alloc.h"
|
||||||
|
/* #include "hw-instances.h" */
|
||||||
|
/* #include "hw-handles.h" */
|
||||||
|
#include "hw-ports.h"
|
||||||
|
|
||||||
|
/* Description of a hardware device */
|
||||||
|
|
||||||
|
typedef void (hw_finish_method)
|
||||||
|
(struct hw *me);
|
||||||
|
|
||||||
|
struct hw_descriptor {
|
||||||
|
const char *family;
|
||||||
|
hw_finish_method *to_finish;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 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 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);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue