00001
00002
00003
00004
00005
00006
00007 static char *rcsid="@(#)$Id$";
00008
00009 #include "../c/eus.h"
00010
00011
00012
00013
00014
00015 pointer fcallx(ctx,n,argv,fslot,sym)
00016 register context *ctx;
00017 int n;
00018 pointer *argv,sym;
00019 pointer (**fslot)();
00020 { eusinteger_t x;
00021 pointer fn;
00022 pointer (*subr)();
00023
00024 fn=getfunc(ctx,sym);
00025
00026 if (ispointer(fn) && (fn->cix==codecp.cix)) {
00027 #if (WORD_SIZE == 64)
00028 x= (eusinteger_t)(fn->c.code.entry); x &= ~3L;
00029 #else
00030 x= (eusinteger_t)(fn->c.code.entry); x &= ~3;
00031 #endif
00032 #if ARM
00033 if (fn->c.code.entry2 != NIL) {
00034 x = x | (intval(fn->c.code.entry2)&0x0000ffff);
00035 }
00036 #endif
00037 subr=(pointer (*)())(x);
00038 *fslot= subr;
00039 return((*subr)(ctx,n,argv));
00040 }
00041 else return(ufuncall(ctx,sym,sym,(pointer)argv,0,n));}
00042
00043
00044
00045
00046
00047 #if sun3 || news || sanyo
00048 pointer fcall(n,argv,sym)
00049 int n;
00050 pointer argv[];
00051 pointer sym;
00052 { register int *r= &n;
00053 int x;
00054 pointer fn,result;
00055 pointer (*subr)();
00056
00057 fn=getfunc(sym);
00058
00059 if (ispointer(fn) && (fn->cix==codecp.cix)) {
00060 subr=(pointer (*)())
00061 ((int)(fn->c.code.codevec)+(intval(fn->c.code.entry)));
00062 x=r[-1];
00063 r=(int *)(x-4);
00064 if ((r[-1] & 0x0000ff00) == 0x6100) *r = (int)subr-x+4;
00065 else *r = (int)subr;
00066
00067 #if sun3
00068 asm(" cmpl #0x12345678,d0\n");
00069 asm(" cmpl #0x12345678,d0\n");
00070 asm(" cmpl #0x12345678,d0\n");
00071 asm(" cmpl #0x12345678,d0\n");
00072 asm(" cmpl #0x12345678,d0\n");
00073 asm(" cmpl #0x12345678,d0\n");
00074 asm(" cmpl #0x12345678,d0\n");
00075 asm(" cmpl #0x12345678,d0\n");
00076 asm(" cmpl #0x12345678,d0\n");
00077 asm(" cmpl #0x12345678,d0\n");
00078 asm(" cmpl #0x12345678,d0\n");
00079 asm(" cmpl #0x12345678,d0\n");
00080 asm(" cmpl #0x12345678,d0\n");
00081 asm(" cmpl #0x12345678,d0\n");
00082 asm(" cmpl #0x12345678,d0\n");
00083 asm(" cmpl #0x12345678,d0\n");
00084 asm(" cmpl #0x12345678,d0\n");
00085 asm(" cmpl #0x12345678,d0\n");
00086 asm(" cmpl #0x12345678,d0\n");
00087 asm(" cmpl #0x12345678,d0\n");
00088 asm(" cmpl #0x12345678,d0\n");
00089 asm(" cmpl #0x12345678,d0\n");
00090 asm(" cmpl #0x12345678,d0\n");
00091 asm(" cmpl #0x12345678,d0\n");
00092 asm(" cmpl #0x12345678,d0\n");
00093 asm(" cmpl #0x12345678,d0\n");
00094 asm(" cmpl #0x12345678,d0\n");
00095 asm(" cmpl #0x12345678,d0\n");
00096 asm(" cmpl #0x12345678,d0\n");
00097 asm(" cmpl #0x12345678,d0\n");
00098 asm(" cmpl #0x12345678,d0\n");
00099 asm(" cmpl #0x12345678,d0\n");
00100 asm(" cmpl #0x12345678,d0\n");
00101 #endif
00102 #if news
00103 asm(" cmp.l #0x12345678,d0");
00104 asm(" cmp.l #0x12345678,d0");
00105 asm(" cmp.l #0x12345678,d0");
00106 asm(" cmp.l #0x12345678,d0");
00107 asm(" cmp.l #0x12345678,d0");
00108 asm(" cmp.l #0x12345678,d0");
00109 asm(" cmp.l #0x12345678,d0");
00110 asm(" cmp.l #0x12345678,d0");
00111 asm(" cmp.l #0x12345678,d0");
00112 asm(" cmp.l #0x12345678,d0");
00113 asm(" cmp.l #0x12345678,d0");
00114 asm(" cmp.l #0x12345678,d0");
00115 asm(" cmp.l #0x12345678,d0");
00116 asm(" cmp.l #0x12345678,d0");
00117 asm(" cmp.l #0x12345678,d0");
00118 asm(" cmp.l #0x12345678,d0");
00119 asm(" cmp.l #0x12345678,d0");
00120 asm(" cmp.l #0x12345678,d0");
00121 asm(" cmp.l #0x12345678,d0");
00122 asm(" cmp.l #0x12345678,d0");
00123 asm(" cmp.l #0x12345678,d0");
00124 asm(" cmp.l #0x12345678,d0");
00125 asm(" cmp.l #0x12345678,d0");
00126 asm(" cmp.l #0x12345678,d0");
00127 asm(" cmp.l #0x12345678,d0");
00128 asm(" cmp.l #0x12345678,d0");
00129 asm(" cmp.l #0x12345678,d0");
00130 asm(" cmp.l #0x12345678,d0");
00131 asm(" cmp.l #0x12345678,d0");
00132 asm(" cmp.l #0x12345678,d0");
00133 asm(" cmp.l #0x12345678,d0");
00134 asm(" cmp.l #0x12345678,d0");
00135 #endif
00136 #if sanyo
00137 asm(" cmp.l %d0,&0x12345678");
00138 asm(" cmp.l %d0,&0x12345678");
00139 asm(" cmp.l %d0,&0x12345678");
00140 asm(" cmp.l %d0,&0x12345678");
00141 asm(" cmp.l %d0,&0x12345678");
00142 asm(" cmp.l %d0,&0x12345678");
00143 asm(" cmp.l %d0,&0x12345678");
00144 asm(" cmp.l %d0,&0x12345678");
00145 asm(" cmp.l %d0,&0x12345678");
00146 asm(" cmp.l %d0,&0x12345678");
00147 asm(" cmp.l %d0,&0x12345678");
00148 asm(" cmp.l %d0,&0x12345678");
00149 asm(" cmp.l %d0,&0x12345678");
00150 asm(" cmp.l %d0,&0x12345678");
00151 asm(" cmp.l %d0,&0x12345678");
00152 asm(" cmp.l %d0,&0x12345678");
00153 asm(" cmp.l %d0,&0x12345678");
00154 asm(" cmp.l %d0,&0x12345678");
00155 asm(" cmp.l %d0,&0x12345678");
00156 asm(" cmp.l %d0,&0x12345678");
00157 asm(" cmp.l %d0,&0x12345678");
00158 asm(" cmp.l %d0,&0x12345678");
00159 asm(" cmp.l %d0,&0x12345678");
00160 asm(" cmp.l %d0,&0x12345678");
00161 asm(" cmp.l %d0,&0x12345678");
00162 asm(" cmp.l %d0,&0x12345678");
00163 asm(" cmp.l %d0,&0x12345678");
00164 asm(" cmp.l %d0,&0x12345678");
00165 asm(" cmp.l %d0,&0x12345678");
00166 asm(" cmp.l %d0,&0x12345678");
00167 asm(" cmp.l %d0,&0x12345678");
00168 asm(" cmp.l %d0,&0x12345678");
00169 #endif
00170 return((*subr)(n,argv)); }
00171 else return(ufuncall(sym,sym,argv,0,n));}
00172
00173 #endif
00174
00175
00176
00177
00178
00179 #if vax
00180 pointer fcall(n,argv,sym)
00181 int n;
00182 pointer argv[];
00183 pointer sym;
00184 { pointer fn;
00185 pointer (*subr)();
00186 int *stackframe;
00187 int *returnaddress;
00188
00189 fn=getfunc(sym);
00190
00191 if (ispointer(fn) && (fn->cix==codecp.cix)) {
00192
00193 subr=(pointer (*)())
00194 ((int)(fn->c.code.codevec)
00195 +((int)(fn->c.code.entry)>>2));
00196
00197 stackframe= &n;
00198 returnaddress=(int *)stackframe[-2];
00199 returnaddress[-1]=(int)subr-(int)returnaddress;
00200 fn=(*subr)(n,argv);
00201 return(fn); }
00202 else return(ufuncall(sym,sym,argv,0,n));}
00203
00204 #endif
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229