diff options
author | Andrew Cagney <cagney@redhat.com> | 1998-05-25 08:50:22 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1998-05-25 08:50:22 +0000 |
commit | c14db36dbbcef966978f8d8aee0b3670d3243bb0 (patch) | |
tree | 18befbba5eae86246d73d0a50788cf8eb75f5c10 /sim/common/hw-device.h | |
parent | 325a1ba87687ac0a8002b24a6a1215b933ae28bb (diff) | |
download | gdb-c14db36dbbcef966978f8d8aee0b3670d3243bb0.zip gdb-c14db36dbbcef966978f8d8aee0b3670d3243bb0.tar.gz gdb-c14db36dbbcef966978f8d8aee0b3670d3243bb0.tar.bz2 |
Add files hw-alloc.[hc] (mising from last CI)
Move set_* macro's from hw-base to hw-device.
Diffstat (limited to 'sim/common/hw-device.h')
-rw-r--r-- | sim/common/hw-device.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sim/common/hw-device.h b/sim/common/hw-device.h index a787089..44c0709 100644 --- a/sim/common/hw-device.h +++ b/sim/common/hw-device.h @@ -150,6 +150,9 @@ struct _sim_cpu *hw_system_cpu (struct hw *hw); #define hw_data(hw) ((hw)->data_of_hw) +#define set_hw_data(hw, value) \ +((hw)->data_of_hw = (value)) + /* Perform a soft reset of the device */ @@ -159,6 +162,9 @@ typedef unsigned (hw_reset_callback) #define hw_reset(hw) ((hw)->to_reset (hw)) +#define set_hw_reset(hw, method) \ +((hw)->to_reset = method) + /* Hardware operations: @@ -195,6 +201,8 @@ typedef void (hw_attach_address_callback) #define hw_attach_address(me, level, space, addr, nr_bytes, client) \ ((me)->to_attach_address (me, level, space, addr, nr_bytes, client)) +#define set_hw_attach_address(hw, method) \ +((hw)->to_attach_address = (method)) typedef void (hw_detach_address_callback) (struct hw *me, @@ -207,6 +215,9 @@ typedef void (hw_detach_address_callback) #define hw_detach_address(me, level, space, addr, nr_bytes, client) \ ((me)->to_detach_address (me, level, space, addr, nr_bytes, client)) +#define set_hw_detach_address(hw, method) \ +((hw)->to_detach_address = (method)) + /* An IO operation from a parent to a child via the conecting bus. @@ -223,6 +234,9 @@ typedef unsigned (hw_io_read_buffer_callback) #define hw_io_read_buffer(hw, dest, space, addr, nr_bytes) \ ((hw)->to_io_read_buffer (hw, dest, space, addr, nr_bytes)) +#define set_hw_io_read_buffer(hw, method) \ +((hw)->to_io_read_buffer = (method)) + typedef unsigned (hw_io_write_buffer_callback) (struct hw *me, const void *source, @@ -233,6 +247,8 @@ typedef unsigned (hw_io_write_buffer_callback) #define hw_io_write_buffer(hw, src, space, addr, nr_bytes) \ ((hw)->to_io_write_buffer (hw, src, space, addr, nr_bytes)) +#define set_hw_io_write_buffer(hw, method) \ +((hw)->to_io_write_buffer = (method)) /* Conversly, the device pci1000,1@1 may need to perform a dma transfer @@ -254,6 +270,9 @@ typedef unsigned (hw_dma_read_buffer_callback) #define hw_dma_read_buffer(bus, dest, space, addr, nr_bytes) \ ((bus)->to_dma_read_buffer (bus, dest, space, addr, nr_bytes)) +#define set_hw_dma_read_buffer(me, method) \ +((me)->to_dma_read_buffer = (method)) + typedef unsigned (hw_dma_write_buffer_callback) (struct hw *bus, const void *source, @@ -264,6 +283,9 @@ typedef unsigned (hw_dma_write_buffer_callback) #define hw_dma_write_buffer(bus, src, space, addr, nr_bytes, violate_ro) \ ((bus)->to_dma_write_buffer (bus, src, space, addr, nr_bytes, violate_ro)) + +#define set_hw_dma_write_buffer(me, method) \ +((me)->to_dma_write_buffer = (method)) /* Address/size specs for devices are encoded following a convention similar to that used by OpenFirmware. In particular, an @@ -310,6 +332,8 @@ typedef int (hw_unit_decode_callback) #define hw_unit_decode(bus, encoded, unit) \ ((bus)->to_unit_decode (bus, encoded, unit)) +#define set_hw_unit_decode(hw, method) \ +((hw)->to_unit_decode = (method)) typedef int (hw_unit_encode_callback) (struct hw *bus, @@ -320,6 +344,8 @@ typedef int (hw_unit_encode_callback) #define hw_unit_encode(bus, unit, encoded, sizeof_encoded) \ ((bus)->to_unit_encode (bus, unit, encoded, sizeof_encoded)) +#define set_hw_unit_encode(hw, method) \ +((hw)->to_unit_encode = (method)) /* As the bus that the device is attached too, to translate a devices @@ -339,6 +365,8 @@ typedef int (hw_unit_address_to_attach_address_callback) #define hw_unit_address_to_attach_address(bus, unit_addr, attach_space, attach_addr, client) \ ((bus)->to_unit_address_to_attach_address (bus, unit_addr, attach_space, attach_addr, client)) +#define set_hw_unit_address_to_attach_address(hw, method) \ +((hw)->to_unit_address_to_attach_address = (method)) typedef int (hw_unit_size_to_attach_size_callback) (struct hw *bus, @@ -349,6 +377,8 @@ typedef int (hw_unit_size_to_attach_size_callback) #define hw_unit_size_to_attach_size(bus, unit_size, attach_size, client) \ ((bus)->to_unit_size_to_attach_size (bus, unit_size, attach_size, client)) +#define set_hw_unit_size_to_attach_size(hw, method) \ +((hw)->to_unit_size_to_attach_size = (method)) extern char *hw_strdup (struct hw *me, const char *str); |