~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to h/hp800.h

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-03-04 14:29:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020304142959-dey14w08kr7lldu3
Tags: upstream-2.5.0.cvs20020219
ImportĀ upstreamĀ versionĀ 2.5.0.cvs20020219

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define HPUX
 
2
#define HPUX_SOM
 
3
#define HP
 
4
  
 
5
#include "bsd.h"
 
6
#undef RUN_PROCESS
 
7
#undef WANT_VALLOC
 
8
/* uses sigvector instead of sigvec.   Could alternately
 
9
     link with -lbsd */
 
10
#define sigvec sigvector  
 
11
 
 
12
/* does not have getpagesize() */
 
13
 
 
14
/*
 
15
#define SBRK(n) \
 
16
  (printf("sbrk(%x)=%x",n,FIXtemp=sbrk(n)),fflush(stdout),FIXtemp)
 
17
 
 
18
#define BRK(n) \
 
19
  (printf("brk(%x)=%x",n,FIXtemp=brk(n)),fflush(stdout),FIXtemp)
 
20
*/
 
21
  
 
22
#undef SFASL
 
23
#define UNIXFASL "faslhp800.c"
 
24
 
 
25
 
 
26
#define ADDITIONAL_FEATURES \
 
27
                     ADD_FEATURE("HP9000-800"); \
 
28
                      ADD_FEATURE("MC68020"); \
 
29
    ADD_FEATURE("HP-UX");
 
30
 
 
31
 
 
32
/*
 
33
#define USE_C_EXTENDED_MUL
 
34
#define USE_C_EXTENDED_DIV
 
35
*/
 
36
 
 
37
#define DATA_BEGIN (char *)N_DATADDR(header)
 
38
 
 
39
#define RELOC_FILE "rel_hp300.c"
 
40
 
 
41
#define IEEEFLOAT
 
42
 
 
43
#define reloc r_info
 
44
 
 
45
#define N_RELOFF(hdr) RTEXT_OFFSET(hdr)
 
46
#define N_SYMOFF(hdr) LESYM_OFFSET(hdr)
 
47
#define N_TXTOFF(hdr) TEXT_OFFSET(hdr)
 
48
 
 
49
/* #undef cs_check */
 
50
 
 
51
#undef SET_REAL_MAXPAGE
 
52
#define SET_REAL_MAXPAGE real_maxpage = MAXPAGE
 
53
 
 
54
 
 
55
/*
 
56
#undef INIT_ALLOC
 
57
#define INIT_ALLOC      if (BRK(pagetochar(MAXPAGE)) < 0) \
 
58
                error("Can't allocate.  Good-bye!.");
 
59
*/
 
60
 
 
61
#define HAVE_AOUT <a.out.h>
 
62
#define exec header
 
63
#define SEEK_TO_END_OFILE(fp) \
 
64
  do{struct header hdr; \
 
65
     fseek(fp,0,0); \
 
66
     fread(&hdr, sizeof(hdr), 1, fp); \
 
67
     fseek(fp,hdr.som_length,0); \
 
68
     }while(0)
 
69
 
 
70
/* have the getcwd command */
 
71
 
 
72
#define GETCWD
 
73
 
 
74
/* note gabor used the att ldirectory... maybe bsd is ok?? */
 
75
 
 
76
#undef LD_COMMAND
 
77
 
 
78
#define OBSOLETE_LD_COMMAND(command,main,start,input,ldarg,output) \
 
79
   { char buf[50];  int i; \
 
80
     char *b = &buf[sizeof(buf)]; \
 
81
     char *pp=input; \
 
82
     *--b = 0; \
 
83
     for(i=strlen(pp)-3; i >= 0 ; i--) \
 
84
       if (pp[i]!='/') { *(--b) = pp[i];} \
 
85
          else break; \
 
86
  sprintf(command,\
 
87
     " if ld -d -a archive -s -e init_code -A %s -R %x -D0x%x %s %s -o %s /lib/dyncall.o ; then true; \
 
88
      else ld -d -a archive -s -e init_%s -A %s -R %x -D0x%x %s %s -o %s /lib/dyncall.o ;fi", \
 
89
       main,start,start + data_off, input,ldarg,output, \
 
90
       b, \
 
91
       main,start,start + data_off, input,ldarg,output);}
 
92
 
 
93
 
 
94
#define LD_COMMAND(command,main,start,input,ldarg,output) \
 
95
{ char buf[50];  int i; \
 
96
     char *b = &buf[sizeof(buf)]; \
 
97
     char *pp=input; \
 
98
     *--b = 0; \
 
99
     for(i=strlen(pp)-3; i >= 0 ; i--) \
 
100
       if (pp[i]!='/') { *(--b) = pp[i];} \
 
101
          else break; \
 
102
  sprintf(command,\
 
103
     " if nm %s | fgrep init_code > /dev/null ; then ld -d -a archive -s -e init_code -A %s -R %x -D0x%x %s %s -o %s /lib/dyncall.o 2>/dev/null ; exit 0  ; fi; \
 
104
       if nm %s | fgrep init_%s > /dev/null ; then ld -d -a archive -s -e init_%s -A %s -R %x -D0x%x %s %s -o %s /lib/dyncall.o 2> /dev/null ; exit 0 ;fi ;  exit 1 ; ", \
 
105
          input, \
 
106
       main,start,start + data_off, input,ldarg,output, \
 
107
       input,b,b, \
 
108
       main,start,start + data_off, input,ldarg,output);}
 
109
 
 
110
/*  This is ok but does not do the init_filename case 
 
111
#define LD_COMMAND(command,main,start,input,ldarg,output) \
 
112
  sprintf(command,\
 
113
          "ld -d -a archive -s -e init_code -A %s -R %x -D0x%x %s %s -o %s", \
 
114
       main,start,start + data_off, input,ldarg,output)
 
115
*/
 
116
 
 
117
 
 
118
 
 
119
/*
 
120
#define SIGNED_CHAR  
 
121
#define REGISTER_VAR
 
122
#define BYTE_ADDRESS
 
123
#define CORE_STARTS_NEAR_0
 
124
#undef  DOWN_STACK
 
125
#undef  REVERSE_PARAMETER_ORDER
 
126
#undef  CC_OPTIMIZES_TEST  
 
127
#define UNIX
 
128
#undef  BSD
 
129
#define HPUX
 
130
#undef  ATT
 
131
#define ALLOCATE_INCREMENTALLY
 
132
#define ALLOW_FORK
 
133
 
 
134
*/
 
135
 
 
136
 
 
137
/* use #include <fcntl.h> */
 
138
 
 
139
#define HAVE_FCNTL
 
140
 
 
141
#define RSYM_AUX "../c/rel_hp300.c"
 
142
 
 
143
 
 
144
#define FIX_BSS     sym->n_type = N_BSS; \
 
145
               val = (val + 3) & ~3;
 
146
 
 
147
 
 
148
/* the following 2 cause duplicate defs so we redefine them.. */
 
149
 
 
150
#define calloc xxcalloc
 
151
#define cfree xxcfree
 
152
 
 
153
 
 
154
 
 
155
/* Begin for cmpinclude */
 
156
 
 
157
 
 
158
/* End for cmpinclude */
 
159
 
 
160
 
 
161
 
 
162
/* For listen LISTEN_FOR_INPUT in stdio.h */
 
163
#define _file __fileL
 
164
#define _cnt __cnt
 
165
 
 
166
/* #define DBEGIN 0x40000000   */
 
167
 
 
168
 
 
169
#define NULL_OR_ON_C_STACK(x) (x == 0 ||   ((unsigned int) x) >=0x70000000)
 
170
 
 
171
#define UNIXSAVE "unexhp9k800.c"
 
172