summaryrefslogtreecommitdiff
path: root/gdb/rdi-share/angel.h
blob: 415e342a6b2ddae41577225615737e675e3fdc70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/* 
 * Copyright (C) 1995 Advanced RISC Machines Limited. All rights reserved.
 * 
 * This software may be freely used, copied, modified, and distributed
 * provided that the above copyright notice is preserved in all copies of the
 * software.
 */

/*> angel.h <*/
/*---------------------------------------------------------------------------*/
/* This header file is the main holder for the declarations and
 * prototypes for the core Angel system. Some Angel concepts are
 * described at the start of this file to ensure that a complete view
 * of the Angel world can be derived purely from the source.
 *
 * $Revision: 1.2 $
 *     $Date: 1998/01/08 11:11:26 $
 *
 *
 * NOTE: Currently the Angel source is designed to be simple,
 * understandable and easy to port to new hardware platforms. However,
 * this does not always yield the highest performing system. The
 * current layered approach introduces an overhead to the performance
 * of the system. In a true commercial target, this code should be
 * re-designed to build a system where the Angel logical message
 * system, device driver and hardware accesses are merged to provide
 * the best performance.
 */
/*---------------------------------------------------------------------------*/
/* Angel overview:

... some comments describing Angel ...

 * Angel is designed as a kit-of-parts that can be used to provide
 * run-time support for the development of ARM applications. The main
 * core of Angel is in providing support for the "debug" message
 * communication with a host system. These messages do not just cover
 * debugging ARM processes, but also the process of downloading ARM
 * programs or attaching to executing processes on the target.
 *
 * A stand-alone ROM based Angel world is the basic starting point for
 * a system, since it will allow programs to be downloaded to the
 * target. The ROM version of Angel will provide the generic debug
 * support, but no system specific routines. The preferred method of
 * using Angel is as a link library. This ensures that applications
 * carry with them the Angel routines necessary to support debugging
 * (and also ensure that the Angel version is up-to-date, independant
 * of the version in the target ROM). Eventually, once a program has
 * been fully debugged, a ROMmed version of the program can be
 * generated with the Angel code being provided in the application.

.. more comments ..

 * The standard Angel routines do *NOT* perform any dynamic memory
 * allocation. To simplify the source, and aid the porting to a non C
 * library world, memory is either pre-allocated (as build-time
 * globals) or actually given to the particular Angel routine by the
 * active run-time. This ensures that the interaction between Angel
 * and the target O/S is minimised.
 *
 * Notes: We sub-include more header files to keep the source
 * modular. Since Angel is a kit-of-parts alternative systems may need
 * to change the prototypes of particular functions, whilst
 * maintaining a fixed external interface. e.g. using the standard
 * DEBUG messages, but with a different communications world.
 */
/*---------------------------------------------------------------------------*/

#ifndef __angel_h
#define __angel_h

/*---------------------------------------------------------------------------*/
/*-- Global Angel definitions and manifests ---------------------------------*/
/*---------------------------------------------------------------------------*/
/* When building Angel we may not include the standard library
 * headers. However, it is useful coding using standard macro names
 * since it makes the code easier to understand.
 */

typedef unsigned int  word ;
typedef unsigned char byte ;

/* The following typedefs can be used to access I/O registers: */
typedef volatile unsigned int  vuword ;
typedef volatile unsigned char vubyte ;

/*
 * The following typedefs are used when defining objects that may also
 * be created on a host system, where the word size is not
 * 32bits. This ensures that the same data values are manipulated.
 */
#ifdef TARGET
typedef unsigned int unsigned32;
typedef signed int   signed32;
typedef        int   int32;

typedef unsigned short int unsigned16;
typedef signed   short int signed16;

/*
 * yet another solution for the bool/boolean problem, this one is
 * copied from Scott's modifications to clx/host.h
 */
# ifdef IMPLEMENT_BOOL_AS_ENUM
   enum _bool { _false, _true };
#  define _bool enum _bool
# elif defined(IMPLEMENT_BOOL_AS_INT) || !defined(__cplusplus)
#  define _bool int
#  define _false 0
#  define _true 1
# endif

# ifdef _bool
#  define bool _bool
# endif

# ifndef true
#  define true _true
#  define false _false
# endif

# ifndef YES
#  define YES   true
#  define NO    false
# endif

# undef TRUE             /* some OSF headers define as 1 */
# define TRUE  true

# undef FALSE            /* some OSF headers define as 1 */
# define FALSE false

# ifndef NULL
#  define NULL 0
# endif

#else

# include "host.h"

#endif

#ifndef IGNORE
# define IGNORE(x) ((x)=(x))
#endif

/* The following typedef allows us to cast between integral and
 * function pointers. This isn't allowed by direct casting when
 * conforming to the ANSI spec.
 */
typedef union ansibodge
{
 word  w ;
 word *wp ;
 void *vp ;
 byte *bp ;
 void (*vfn)(void) ;
 word (*wfn)(void) ;
 int  (*ifn)(void) ;
 byte (*bfn)(void) ;
} ansibodge ;

/*---------------------------------------------------------------------------*/

/* The amount setup aside by the run-time system for stack overflow
 * handlers to execute in. This must be at least 256bytes, since that
 * value is assumed by the current ARM Ltd compiler.
 * This space is _only_ kept for the USR stack, not any of the privileged
 * mode stacks, as stack overflow on these is always fatal - there is
 * no point attemptingto recover.  In addition is is important that
 * Angel should keep privileged stack space requirements to a minimum.
 */
#define APCS_STACKGUARD 256

#endif /* __angel_h */

/* EOF angel.h */