ee787dd76e635c433f814cb4c1252805e785e082
1 /* This file is part of the program psim.
3 Copyright (C) 1994-1998, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 /* A root device from which dv-* devices can be built */
27 #include "hw-device.h"
29 #include "hw-properties.h"
30 /* #include "hw-instances.h" */
31 /* #include "hw-handles.h" */
34 typedef void (hw_finish_callback
)
37 struct hw_device_descriptor
{
39 hw_finish_callback
*to_finish
;
42 /* Create a primative device */
53 /* Complete the creation of that device (finish overrides methods
54 using the set_hw_* operations below) */
63 /* Delete the entire device */
69 /* Override device methods */
71 #define set_hw_data(hw, value) \
72 ((hw)->data_of_hw = (value))
74 #define set_hw_reset(hw, method) \
75 ((hw)->to_reset = method)
77 #define set_hw_io_read_buffer(hw, method) \
78 ((hw)->to_io_read_buffer = (method))
79 #define set_hw_io_write_buffer(hw, method) \
80 ((hw)->to_io_write_buffer = (method))
82 #define set_hw_dma_read_buffer(me, method) \
83 ((me)->to_dma_read_buffer = (method))
84 #define set_hw_dma_write_buffer(me, method) \
85 ((me)->to_dma_write_buffer = (method))
87 #define set_hw_attach_address(hw, method) \
88 ((hw)->to_attach_address = (method))
89 #define set_hw_detach_address(hw, method) \
90 ((hw)->to_detach_address = (method))
92 #define set_hw_unit_decode(hw, method) \
93 ((hw)->to_unit_decode = (method))
94 #define set_hw_unit_encode(hw, method) \
95 ((hw)->to_unit_encode = (method))
97 #define set_hw_unit_address_to_attach_address(hw, method) \
98 ((hw)->to_unit_address_to_attach_address = (method))
99 #define set_hw_unit_size_to_attach_size(hw, method) \
100 ((hw)->to_unit_size_to_attach_size = (method))
102 typedef void (hw_delete_callback
)
105 #define set_hw_delete(hw, method) \
106 ((hw)->base_of_hw->to_delete = (method))
109 struct hw_port_descriptor
{
113 port_direction direction
;
116 typedef void (hw_port_event_callback
)
125 extern void set_hw_ports (struct hw
*hw
, const struct hw_port_descriptor ports
[]);
126 extern void set_hw_port_event (struct hw
*hw
, hw_port_event_callback
*to_port_event
);
This page took 0.15489 seconds and 4 git commands to generate.