2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
/*
|
|
|
30 |
VERSION INFORMATION
|
|
|
31 |
===================
|
|
|
32 |
|
|
|
33 |
--------------------------------------------------------------------------
|
|
|
34 |
$Header: /u/g/release/CVSROOT/Source/src/installers/680x0/common/special_exps.c,v 1.1.1.1 1998/01/17 15:55:50 release Exp $
|
|
|
35 |
--------------------------------------------------------------------------
|
|
|
36 |
$Log: special_exps.c,v $
|
|
|
37 |
* Revision 1.1.1.1 1998/01/17 15:55:50 release
|
|
|
38 |
* First version to be checked into rolling release.
|
|
|
39 |
*
|
|
|
40 |
Revision 1.2 1997/10/29 10:22:29 ma
|
|
|
41 |
Replaced use_alloca with has_alloca.
|
|
|
42 |
|
|
|
43 |
Revision 1.1.1.1 1997/10/13 12:42:58 ma
|
|
|
44 |
First version.
|
|
|
45 |
|
|
|
46 |
Revision 1.1 1997/09/24 08:25:43 ma
|
|
|
47 |
First version
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
--------------------------------------------------------------------------
|
|
|
51 |
*/
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
#include "config.h"
|
|
|
55 |
#include "common_types.h"
|
|
|
56 |
#include "exp.h"
|
|
|
57 |
#include "expmacs.h"
|
|
|
58 |
#include "exptypes.h"
|
|
|
59 |
#include "shapemacs.h"
|
|
|
60 |
#include "tags.h"
|
|
|
61 |
#include "install_fns.h"
|
|
|
62 |
#include "instrs.h"
|
|
|
63 |
#include "special_exps.h"
|
|
|
64 |
#include "utility.h"
|
|
|
65 |
|
|
|
66 |
/************************************************************************
|
|
|
67 |
Make an exp representing the contents of an external tag with
|
|
|
68 |
name n of shape s and variable if v.
|
|
|
69 |
************************************************************************/
|
|
|
70 |
|
|
|
71 |
exp make_extn
|
|
|
72 |
PROTO_N ( ( n, s, v ) )
|
|
|
73 |
PROTO_T ( char* n X shape s X int v )
|
|
|
74 |
{
|
|
|
75 |
dec * g = alloc_nof ( dec, 1 ) ;
|
|
|
76 |
exp id = getexp (s, 0, 1, 0, 0, 0, 0, ident_tag);
|
|
|
77 |
exp nme = getexp (s, 0, 1, id, 0, 0, 0, name_tag);
|
|
|
78 |
setglob (id);
|
|
|
79 |
if (v) {
|
|
|
80 |
setvar(id);
|
|
|
81 |
}
|
|
|
82 |
brog(id) = g;
|
|
|
83 |
g -> dec_u.dec_val.dec_exp = id;
|
|
|
84 |
g -> dec_u.dec_val.dec_id = n;
|
|
|
85 |
g -> dec_u.dec_val.extnamed = 1;
|
|
|
86 |
return (nme);
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
/************************************************************************
|
|
|
90 |
Make an exp representing a dummy double destination used to force a
|
|
|
91 |
floating point overflow (if any) for expression with zero destination.
|
|
|
92 |
************************************************************************/
|
|
|
93 |
exp get_dummy_double_dest
|
|
|
94 |
PROTO_Z ()
|
|
|
95 |
{
|
|
|
96 |
return (make_extn("___m68k_dummy_double", doublesh, 1));
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
/************************************************************************
|
|
|
101 |
Make an exp representing the stack limit
|
|
|
102 |
************************************************************************/
|
|
|
103 |
exp get_stack_limit
|
|
|
104 |
PROTO_Z ()
|
|
|
105 |
{
|
|
|
106 |
return make_extn ("___m68k_stack_limit", ulongsh, 1);
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
/************************************************************************
|
|
|
110 |
Make an exp representing the error handler
|
|
|
111 |
************************************************************************/
|
|
|
112 |
exp get_error_handler
|
|
|
113 |
PROTO_Z ()
|
|
|
114 |
{
|
|
|
115 |
return make_extn ("___m68k_errhandler", ulongsh, 1);
|
|
|
116 |
}
|
|
|
117 |
/************************************************************************
|
|
|
118 |
Make an exp representing env_size
|
|
|
119 |
************************************************************************/
|
|
|
120 |
exp get_env_size
|
|
|
121 |
PROTO_N ( ( decl ) )
|
|
|
122 |
PROTO_T ( dec *decl )
|
|
|
123 |
{
|
|
|
124 |
/* allocate space for 10 digits 2 prefix characters and a null */
|
|
|
125 |
char* lab_name = alloc_nof ( char, 13 ) ;
|
|
|
126 |
sprintf(lab_name, "#%c%lu", LPREFIX, (unsigned long) decl);
|
|
|
127 |
return make_extn (lab_name, ulongsh, 1);
|
|
|
128 |
}
|
|
|
129 |
|