OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [ppc/] [sim_callbacks.h] - Blame information for rev 311

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
/*  This file is part of the program psim.
2
 
3
    Copyright (C) 1994-1995,1998, Andrew Cagney <cagney@highland.com.au>
4
 
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.
9
 
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.
14
 
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.
18
 
19
    */
20
 
21
 
22
#ifndef _SIM_CALLBACKS_H_
23
#define _SIM_CALLBACKS_H_
24
 
25
/* Simulator output:
26
 
27
   Functions to report diagnostic information to the user. */
28
 
29
#define printf_filtered sim_io_printf_filtered
30
void sim_io_printf_filtered
31
(const char *msg, ...) __attribute__ ((format (printf, 1, 2)));
32
 
33
void NORETURN error
34
(const char *msg, ...);
35
 
36
 
37
/* External environment:
38
 
39
   Some HOST OS's require regular polling so that external events such
40
   as GUI io can be handled. */
41
 
42
void sim_io_poll_quit
43
(void);
44
 
45
 
46
 
47
/* Model I/O:
48
 
49
   These functions provide the interface between the modeled targets
50
   standard input and output streams and the hosts external
51
   environment.
52
 
53
   The underlying model is responsible for co-ordinating I/O
54
   interactions such as:
55
 
56
        main()
57
        {
58
          const char mess[] = "Hello World\r\n";
59
          int out;
60
          out = dup(1);
61
          close(1);
62
          write(out, mess, sizeof(mess))
63
        }
64
 
65
   That is to say, the underlying model would, in implementing dup()
66
   recorded the fact that any output directed at fid-OUT should be
67
   displayed using sim_io_write_stdout().  While for the code stub:
68
 
69
        main()
70
        {
71
          const char mess[] = "Hello World\r\n";
72
          int out;
73
          close(1);
74
          out = open("output", 0x0001|0x0200, 0); // write+create
75
          out = dup(1);
76
          write(out, mess, sizeof(mess))
77
        }
78
 
79
   would result in output to fid-1 being directed towards the file
80
   "output". */
81
 
82
 
83
int
84
sim_io_write_stdout
85
(const char *buf,
86
 int sizeof_buf);
87
 
88
int
89
sim_io_write_stderr
90
(const char *buf,
91
 int sizeof_buf);
92
 
93
/* read results */
94
enum { sim_io_eof = -1, sim_io_not_ready = -2, }; /* See: IEEE 1275 */
95
 
96
int
97
sim_io_read_stdin
98
(char *buf,
99
 int sizeof_buf);
100
 
101
#define flush_stdoutput sim_io_flush_stdoutput
102
void sim_io_flush_stdoutput
103
(void);
104
 
105
 
106
/* Simulator instance.  */
107
extern psim *simulator;
108
 
109
 
110
/* Memory management with an allocator that clears memory before use. */
111
 
112
void *zalloc
113
(long size);
114
 
115
#define ZALLOC(TYPE) (TYPE*)zalloc(sizeof (TYPE))
116
 
117
void zfree(void*);
118
 
119
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.