282 |
where f1 f2 are forms to be evaled. |
where f1 f2 are forms to be evaled. |
283 |
*/ |
*/ |
284 |
|
|
285 |
|
#ifdef CLEAR_CACHE |
286 |
|
static int |
287 |
|
sigh(int sig,long code,void *scp, char *addr) { |
288 |
|
|
289 |
|
fprintf(stderr,"Received SIGILL at %p\n",((siginfo_t *)code)->si_addr); |
290 |
|
exit(1); |
291 |
|
} |
292 |
|
#endif |
293 |
|
|
294 |
void |
void |
295 |
call_init(int init_address, object memory, object fasl_vec, FUNC fptr) |
call_init(int init_address, object memory, object fasl_vec, FUNC fptr) |
296 |
{object form; |
{object form; |
297 |
FUNC at; |
FUNC at; |
298 |
|
#ifdef CLEAR_CACHE |
299 |
|
static sigaction sa={{sigh},{{0}},SA_RESTART|SA_SIGINFO,NULL); |
300 |
|
static sigset_t ss; |
301 |
|
|
302 |
|
sigaction(SIGILL,&sa,NULL); |
303 |
|
sigemptyset(&ss); |
304 |
|
sigaddset(&ss,SIGILL); |
305 |
|
sigprocmask(SIG_BLOCK,&ss,NULL); |
306 |
|
#endif |
307 |
|
|
308 |
|
|
309 |
check_type(fasl_vec,t_vector); |
check_type(fasl_vec,t_vector); |
310 |
form=(fasl_vec->v.v_self[fasl_vec->v.v_fillp -1]); |
form=(fasl_vec->v.v_self[fasl_vec->v.v_fillp -1]); |
321 |
form->c.c_car == sSPinit) |
form->c.c_car == sSPinit) |
322 |
{bds_bind(sSPinit,fasl_vec); |
{bds_bind(sSPinit,fasl_vec); |
323 |
bds_bind(sSPmemory,memory); |
bds_bind(sSPmemory,memory); |
324 |
|
#ifdef CLEAR_CACHE |
325 |
|
sigprocmask(SIG_UNBLOCK,&ss,NULL); |
326 |
|
#endif |
327 |
(*at)(); |
(*at)(); |
328 |
|
#ifdef CLEAR_CACHE |
329 |
|
sigprocmask(SIG_BLOCK,&ss,NULL); |
330 |
|
#endif |
331 |
bds_unwind1; |
bds_unwind1; |
332 |
bds_unwind1; |
bds_unwind1; |
333 |
} |
} |
335 |
/* old style three arg init, with all init being done by C code. */ |
/* old style three arg init, with all init being done by C code. */ |
336 |
{memory->cfd.cfd_self = fasl_vec->v.v_self; |
{memory->cfd.cfd_self = fasl_vec->v.v_self; |
337 |
memory->cfd.cfd_fillp = fasl_vec->v.v_fillp; |
memory->cfd.cfd_fillp = fasl_vec->v.v_fillp; |
338 |
|
#ifdef CLEAR_CACHE |
339 |
|
sigprocmask(SIG_UNBLOCK,&ss,NULL); |
340 |
|
#endif |
341 |
(*at)(memory->cfd.cfd_start, memory->cfd.cfd_size, memory); |
(*at)(memory->cfd.cfd_start, memory->cfd.cfd_size, memory); |
342 |
|
#ifdef CLEAR_CACHE |
343 |
|
sigprocmask(SIG_BLOCK,&ss,NULL); |
344 |
|
#endif |
345 |
}} |
}} |
346 |
|
|
347 |
/* statVV is the address of some static storage, which is used by the |
/* statVV is the address of some static storage, which is used by the |
450 |
{printf("loading %s\n",file); fflush(stdout); load(file);} |
{printf("loading %s\n",file); fflush(stdout); load(file);} |
451 |
} |
} |
452 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|