]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/common/hw-main.h
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / sim / common / hw-main.h
CommitLineData
c906108c 1/* Common hardware header file.
6aba47ca 2 Copyright (C) 1998, 2007 Free Software Foundation, Inc.
c906108c
SS
3 Contributed by Andrew Cagney and Cygnus Support.
4
5This file is part of GDB, the GNU debugger.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License along
18with this program; if not, write to the Free Software Foundation, Inc.,
1959 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21
22#ifndef HW_MAIN
23#define HW_MAIN
24
25/* establish a type system */
26#include "sim-basics.h"
27
28/* construct a hw device */
29#include "hw-device.h"
30#include "hw-properties.h"
31#include "hw-events.h"
32#include "hw-alloc.h"
33#include "hw-instances.h"
34#include "hw-handles.h"
35#include "hw-ports.h"
36
37/* Description of a hardware device */
38
39typedef void (hw_finish_method)
40 (struct hw *me);
41
42struct hw_descriptor {
43 const char *family;
44 hw_finish_method *to_finish;
45};
46
47/* Helper functions to make the implementation of a device easier */
48
49/* Go through the devices reg properties and look for those specifying
50 an address to attach various registers to */
51
52void do_hw_attach_regs (struct hw *me);
53
54/* Perform a polling read on FD returning either the number of bytes
55 or a hw_io status code that indicates the reason for the read
56 failure */
57
58enum {
59 HW_IO_EOF = -1, HW_IO_NOT_READY = -2, /* See: IEEE 1275 */
60};
61
62typedef int (do_hw_poll_read_method)
63 (SIM_DESC sd, int, char *, int);
64
65int do_hw_poll_read
66(struct hw *me,
67 do_hw_poll_read_method *read,
68 int sim_io_fd,
69 void *buf,
70 unsigned size_of_buf);
71
72
73#endif