]>
Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* This file is part of the program psim. |
2 | ||
3 | Copyright (C) 1994-1997, 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 | |
3fd725ef | 7 | the Free Software Foundation; either version 3 of the License, or |
c906108c SS |
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 | |
51b318de | 16 | along with this program; if not, see <http://www.gnu.org/licenses/>. |
c906108c SS |
17 | |
18 | */ | |
19 | ||
20 | ||
21 | #ifndef _BASICS_H_ | |
22 | #define _BASICS_H_ | |
23 | ||
6df01ab8 MF |
24 | /* This must come before any other includes. */ |
25 | #include "defs.h" | |
c906108c SS |
26 | |
27 | /* from Michael Meissner, macro's to handle concating symbols better */ | |
28 | ||
29 | #if defined(__STDC__) || defined(ALMOST_STDC) | |
30 | #define CONCAT2(a,b) a##b | |
31 | #define CONCAT3(a,b,c) a##b##c | |
32 | #define CONCAT4(a,b,c,d) a##b##c##d | |
33 | #else | |
34 | #define CONCAT2(a,b) a/**/b | |
35 | #define CONCAT3(a,b,c) a/**/b/**/c | |
36 | #define CONCAT4(a,b,c,d) a/**/b/**/c/**/d | |
37 | #endif | |
38 | ||
39 | #define XCONCAT2(a,b) CONCAT2(a,b) | |
40 | #define XCONCAT3(a,b,c) CONCAT3(a,b,c) | |
41 | #define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d) | |
42 | ||
43 | ||
44 | /* many things pass around the cpu and psim object with out knowing | |
45 | what it is */ | |
46 | ||
47 | typedef struct _cpu cpu; | |
48 | typedef struct _psim psim; | |
49 | typedef struct _device device; | |
50 | typedef struct _device_instance device_instance; | |
51 | typedef struct _event_queue event_queue; | |
52 | typedef struct _event_entry_tag *event_entry_tag; | |
53 | ||
54 | ||
55 | /* many things are moving data between the host and target */ | |
56 | ||
57 | typedef enum { | |
58 | cooked_transfer, | |
59 | raw_transfer, | |
60 | } transfer_mode; | |
61 | ||
62 | ||
63 | /* possible exit statuses */ | |
64 | ||
65 | typedef enum { | |
66 | was_continuing, was_trap, was_exited, was_signalled | |
67 | } stop_reason; | |
68 | ||
69 | ||
70 | /* disposition of an object when things are next restarted */ | |
71 | ||
72 | typedef enum { | |
73 | permenant_object, | |
74 | tempoary_object, | |
75 | } object_disposition; | |
76 | ||
77 | ||
78 | /* directions */ | |
79 | ||
80 | typedef enum { | |
81 | bidirect_port, | |
82 | input_port, | |
83 | output_port, | |
84 | } port_direction; | |
85 | ||
86 | ||
87 | ||
88 | /* Basic configuration */ | |
89 | ||
c906108c SS |
90 | #include "ppc-config.h" |
91 | #include "inline.h" | |
92 | ||
93 | ||
94 | /* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will | |
95 | bring potential conflicts out in the open */ | |
96 | ||
97 | #include <stdarg.h> | |
98 | #include <stdio.h> | |
ceac4ecf | 99 | #include <stdlib.h> |
c906108c SS |
100 | |
101 | ||
102 | #ifndef NORETURN | |
103 | #define NORETURN | |
104 | #endif | |
105 | ||
106 | #ifndef NULL | |
107 | #define NULL 0 | |
108 | #endif | |
109 | ||
110 | #if !defined (__attribute__) | |
111 | #if (!defined(__GNUC__) \ | |
112 | || (__GNUC__ < 2) \ | |
113 | || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)) | |
114 | #define __attribute__(arg) | |
115 | #endif | |
116 | #endif | |
117 | ||
118 | #if !defined (UNUSED) | |
119 | #if (!defined(__GNUC__) \ | |
120 | || (__GNUC__ < 2) \ | |
121 | || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)) | |
122 | #define UNUSED | |
123 | #else | |
124 | #define UNUSED __attribute__((__unused__)) | |
125 | #endif | |
126 | #endif | |
127 | ||
128 | ||
129 | /* Basic definitions - ordered so that nothing calls what comes after | |
130 | it */ | |
131 | ||
132 | #include "sim_callbacks.h" | |
133 | ||
134 | #include "debug.h" | |
135 | ||
136 | #include "words.h" | |
137 | #include "bits.h" | |
138 | #include "sim-endian.h" | |
139 | ||
140 | #endif /* _BASICS_H_ */ |