diff options
author | Camm Maguire <camm@debian.org> | 2014-04-14 14:35:14 +0000 |
---|---|---|
committer | Camm Maguire <camm@debian.org> | 2014-04-21 14:56:35 +0000 |
commit | 09778cc3d06c0f03eee408afb44efd4d0c570a7f (patch) | |
tree | fa50d5f9d0433eee1b3987ebd910e7095b1964c0 | |
parent | 7c25aa1fca3308efda59e70fb8cabb1011725000 (diff) | |
download | gcl-09778cc3d06c0f03eee408afb44efd4d0c570a7f.tar.gz |
main cleanup 1
-rwxr-xr-x | gcl/h/att_ext.h | 6 | ||||
-rwxr-xr-x | gcl/h/include.h | 1 | ||||
-rw-r--r-- | gcl/h/linux.h | 2 | ||||
-rwxr-xr-x | gcl/h/mingw.h | 2 | ||||
-rwxr-xr-x | gcl/h/stacks.h | 8 | ||||
-rw-r--r-- | gcl/o/alloc.c | 121 | ||||
-rwxr-xr-x | gcl/o/fasldlsym.c | 21 | ||||
-rwxr-xr-x | gcl/o/main.c | 431 | ||||
-rwxr-xr-x | gcl/o/usig2_aux.c | 4 |
9 files changed, 204 insertions, 392 deletions
diff --git a/gcl/h/att_ext.h b/gcl/h/att_ext.h index 3f527d52..cc9d86d3 100755 --- a/gcl/h/att_ext.h +++ b/gcl/h/att_ext.h @@ -669,12 +669,6 @@ EXTER object TSor_pathname_string_symbol_stream; EXTER int interrupt_flag; /* console interupt flag */ EXTER int interrupt_enable; /* console interupt enable */ -/* CMPtemp */ -EXTER object CMPtemp; -EXTER object CMPtemp1; -EXTER object CMPtemp2; -EXTER object CMPtemp3; - EXTER object sLAlink_arrayA; /* nfunlink.c */ diff --git a/gcl/h/include.h b/gcl/h/include.h index a5c3e463..47a79dac 100755 --- a/gcl/h/include.h +++ b/gcl/h/include.h @@ -106,7 +106,6 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. #include "../h/vs.h" #include "../h/bds.h" #include "../h/frame.h" -#include "../h/stacks.h" #include "../h/lex.h" #include "../h/eval.h" diff --git a/gcl/h/linux.h b/gcl/h/linux.h index 3db6cb81..022d0bc1 100644 --- a/gcl/h/linux.h +++ b/gcl/h/linux.h @@ -145,8 +145,6 @@ do { int c = 0; \ setbuf(stdin,0); \ setbuf(stdout,0); -#define INIT_CORE_END terminal_io->sm.sm_object0->sm.sm_fp = stdin;terminal_io->sm.sm_object1->sm.sm_fp = stdout; - #include <limits.h> #include <sys/stat.h> #define GET_FULL_PATH_SELF(a_) do {\ diff --git a/gcl/h/mingw.h b/gcl/h/mingw.h index bf7bb387..73219b69 100755 --- a/gcl/h/mingw.h +++ b/gcl/h/mingw.h @@ -8,9 +8,11 @@ # define SEPARATE_SFASL_FILE "sfaslbfd.c" #else # define SEPARATE_SFASL_FILE "sfaslcoff.c" +/* # define SPECIAL_RSYM "rsym_nt.c" # define RSYM_COMMAND(command,system_directory,kcl_self,tmpfile1) \ sprintf(command,"rsym %s %s",kcl_self,tmpfile1); +*/ #endif /* Stratified garbage collection - need mprotect() (at least) */ diff --git a/gcl/h/stacks.h b/gcl/h/stacks.h index 5c493c99..a362d385 100755 --- a/gcl/h/stacks.h +++ b/gcl/h/stacks.h @@ -3,25 +3,25 @@ #endif #define VSGETA 128 -EXTER object value_stack[VSSIZE + (STACK_OVER +1) *VSGETA]; +object value_stack[VSSIZE + (STACK_OVER +1) *VSGETA],*vs_org=value_stack,*vs_limit=value_stack+VSSIZE; #ifndef BDSSIZE #define BDSSIZE 2*1024 #endif #define BDSGETA 64 -EXTER struct bds_bd bind_stack[BDSSIZE + (STACK_OVER +1)* BDSGETA]; +struct bds_bd bind_stack[BDSSIZE + (STACK_OVER +1)* BDSGETA],*bds_org=bind_stack,*bds_limit=bind_stack+BDSSIZE; #ifndef IHSSIZE #define IHSSIZE 8*1024 #endif #define IHSGETA 96 -EXTER struct invocation_history ihs_stack[IHSSIZE + (STACK_OVER +1) * IHSGETA]; +struct invocation_history ihs_stack[IHSSIZE + (STACK_OVER +1) * IHSGETA],*ihs_org=ihs_stack,*ihs_limit=ihs_stack+IHSSIZE; #ifndef FRSSIZE #define FRSSIZE 4*1024 #endif #define FRSGETA 96 -EXTER struct frame frame_stack[FRSSIZE + (STACK_OVER +1) * FRSGETA]; +struct frame frame_stack[FRSSIZE + (STACK_OVER +1) * FRSGETA],*frs_org=frame_stack,*frs_limit=frame_stack+FRSSIZE; diff --git a/gcl/o/alloc.c b/gcl/o/alloc.c index db09df85..357d1546 100644 --- a/gcl/o/alloc.c +++ b/gcl/o/alloc.c @@ -968,6 +968,7 @@ set_maxpage(void) { if (gcl_alloc_initialized) { extern long maxpage; maxpage=page(heap_end); + memprotect_test_reset(); memory_protect(sgc_enabled ? 1 : 0); } #endif @@ -1044,8 +1045,7 @@ gcl_init_alloc(void) { course changeable by allocate-sgc. CM 20030827 */ init_tm(t_cons, ".CONS", sizeof(struct cons), 65536 ,50,0 ); - init_tm(t_fixnum, "NFIXNUM", - sizeof(struct fixnum_struct), 8192,20,0); + init_tm(t_fixnum, "NFIXNUM",sizeof(struct fixnum_struct), 8192,20,0); init_tm(t_structure, "SSTRUCTURE", sizeof(struct structure), 5461,1,0 ); /* init_tm(t_ifun, "iIFUN", sizeof(struct ifun), 4096,1,0 ); */ /* init_tm(t_cfun, "fCFUN", sizeof(struct cfun), 4096,1,0 ); */ @@ -1054,10 +1054,8 @@ gcl_init_alloc(void) { init_tm(t_symbol, "|SYMBOL", sizeof(struct symbol), 3640,1,0 ); init_tm(t_bignum, "BBIGNUM", sizeof(struct bignum), 2730,1,0 ); init_tm(t_ratio, "RRATIONAL", sizeof(struct ratio), 170,1,0 ); - init_tm(t_shortfloat, "FSHORT-FLOAT", - sizeof(struct shortfloat_struct), 256 ,1,0); - init_tm(t_longfloat, "LLONG-FLOAT", - sizeof(struct longfloat_struct), 170 ,1,0); + init_tm(t_shortfloat, "FSHORT-FLOAT",sizeof(struct shortfloat_struct), 256 ,1,0); + init_tm(t_longfloat, "LLONG-FLOAT",sizeof(struct longfloat_struct), 170 ,1,0); init_tm(t_complex, "CCOMPLEX", sizeof(struct ocomplex), 170 ,1,0); init_tm(t_character,"#CHARACTER",sizeof(struct character), 256 ,1,0); init_tm(t_package, ":PACKAGE", sizeof(struct package), 2*PAGESIZE / sizeof(struct package),1,0); @@ -1086,22 +1084,6 @@ gcl_init_alloc(void) { set_tm_maxpage(tm_table+t_relocatable,1); nrbpage=0; -#ifdef __linux__ - /* Some versions of the Linux startup code are broken. - For these, the first call to sbrk() fails, but - subsequent calls are o.k. - */ - if ( (long)sbrk(0) == -1 ) - { - if ( (long)sbrk(0) == -1 ) - { - fputs("FATAL Linux sbrk() error\n", stderr); - exit(1); - } - fputs("WARNING: Non-fatal Linux sbrk() error\n", stderr); - } -#endif - alloc_page(-(holepage + nrbpage)); rb_start = rb_pointer = heap_end + PAGESIZE*holepage; @@ -1111,14 +1093,11 @@ gcl_init_alloc(void) { tm_table[(int)t_relocatable].tm_sgc = 50; #endif -#ifndef DONT_NEED_MALLOC - { extern object malloc_list; malloc_list = Cnil; enter_mark_origin(&malloc_list); } -#endif gcl_alloc_initialized=1; @@ -1533,31 +1512,25 @@ static char *baby_malloc(n) void * malloc(size_t size) { - static int in_malloc; + static bool notfirst,in_malloc; if (in_malloc) return NULL; in_malloc=1; - if (!GBC_enable) { - -#ifdef BABY_MALLOC_SIZE - in_malloc=0; - return baby_malloc(size); -#else - + if (!notfirst) { + notfirst=1; if (raw_image) gcl_init_alloc(); #ifdef RECREATE_HEAP - else RECREATE_HEAP + else + RECREATE_HEAP; #endif + } -#endif - - } - + CHECK_INTERRUPT; - + malloc_list = make_cons(Cnil, malloc_list); malloc_list->c.c_car = alloc_simple_string(size); @@ -1579,60 +1552,50 @@ malloc(size_t size) { in_malloc=0; return(malloc_list->c.c_car->st.st_self); - + } void -free(void *ptr) -#ifndef NO_VOID_STAR - -#else - -#endif - -{ +free(void *ptr) { + object *p,pp; - if (ptr == 0) - return; -#ifdef BABY_MALLOC_SIZE - if ((void *)ptr < (void *) &baby_malloc_data[sizeof(baby_malloc_data)]) - return; -#endif - for (p = &malloc_list,pp=*p; pp && !endp(pp); p = &((pp)->c.c_cdr),pp=Scdr(pp)) - if ((pp)->c.c_car->st.st_self == ptr) { -/* SGC contblock pages: Its possible this is on an old page CM 20030827 */ + + if (ptr == 0) + return; + + for (p = &malloc_list,pp=*p; pp && !endp(pp); p = &((pp)->c.c_cdr),pp=Scdr(pp)) + if ((pp)->c.c_car->st.st_self == ptr) { + /* SGC contblock pages: Its possible this is on an old page CM 20030827 */ #ifdef SGC - insert_maybe_sgc_contblock((pp)->c.c_car->st.st_self, - (pp)->c.c_car->st.st_dim); + insert_maybe_sgc_contblock((pp)->c.c_car->st.st_self,(pp)->c.c_car->st.st_dim); #else - insert_contblock((pp)->c.c_car->st.st_self, - (pp)->c.c_car->st.st_dim); + insert_contblock((pp)->c.c_car->st.st_self,(pp)->c.c_car->st.st_dim); #endif - (pp)->c.c_car->st.st_self = NULL; - *p = Scdr(pp); + (pp)->c.c_car->st.st_self = NULL; + *p = Scdr(pp); #ifdef GCL_GPROF - if (initial_monstartup_pointer==ptr) { - initial_monstartup_pointer=NULL; - if (core_end-heap_end>=sizeof(ptr)) - *(void **)heap_end=ptr; - } + if (initial_monstartup_pointer==ptr) { + initial_monstartup_pointer=NULL; + if (core_end-heap_end>=sizeof(ptr)) + *(void **)heap_end=ptr; + } #endif - return ; - } + return; + } #ifdef NOFREE_ERR - return ; + return; #else - if (!saving_system || core_end-heap_end<sizeof(ptr) || ptr!=*(void **)heap_end) { - static void *old_ptr; - if (old_ptr==ptr) return; - old_ptr=ptr; - FEerror("free(3) error.",0); - } - return; + if (!saving_system || core_end-heap_end<sizeof(ptr) || ptr!=*(void **)heap_end) { + static void *old_ptr; + if (old_ptr==ptr) return; + old_ptr=ptr; + FEerror("free(3) error.",0); + } + return; #endif } - + void * realloc(void *ptr, size_t size) { diff --git a/gcl/o/fasldlsym.c b/gcl/o/fasldlsym.c index 55e11594..9f9131d9 100755 --- a/gcl/o/fasldlsym.c +++ b/gcl/o/fasldlsym.c @@ -42,6 +42,16 @@ struct name_list { }; static struct name_list *loaded_files; +static void +unlink_loaded_files(void) { + + while(loaded_files) { + unlink(loaded_files->name); + loaded_files= loaded_files->next; + } + +} + int fasload(object faslfile) { @@ -66,6 +76,7 @@ fasload(object faslfile) { massert(mkstemp(buf)>=0); massert((nl=(void *) malloc(strlen(buf)+1+sizeof(nl)))); + massert(loaded_files || !atexit(unlink_loaded_files)); nl->next = loaded_files; loaded_files = nl; strcpy(nl->name,buf); @@ -111,14 +122,4 @@ fasload(object faslfile) { } -void -unlink_loaded_files(void) { - - while(loaded_files) { - unlink(loaded_files->name); - loaded_files= loaded_files->next; - } - -} - #include "sfasli.c" diff --git a/gcl/o/main.c b/gcl/o/main.c index fc0a99b9..a5b67d61 100755 --- a/gcl/o/main.c +++ b/gcl/o/main.c @@ -43,9 +43,7 @@ void initialize_process(); #endif #include "include.h" -#ifdef UNIX #include <signal.h> -#endif #include "page.h" bool saving_system ; @@ -73,8 +71,11 @@ char system_directory[PATH_MAX]; char stdin_buf[BUFSIZ + EXTRA_BUFSIZE]; char stdout_buf[BUFSIZ + EXTRA_BUFSIZE]; +#include "stacks.h" + int debug; /* debug switch */ -int raw_image = TRUE; /* raw or saved image */ +int raw_image = TRUE; /* raw or saved image -- CYGWIN will only place this in .data and not in .bss if initialized to non-zero */ +bool GBC_enable=FALSE; long real_maxpage; object sSAlisp_maxpagesA; @@ -291,324 +292,191 @@ DEFUN("SET-LOG-MAXPAGE-BOUND",fixnum,fSset_log_maxpage_bound,SI,1,1,NONE,II,OO,O } -int pre_gcl=0; - int main(int argc, char **argv, char **envp) { -#if defined ( BSD ) && defined ( RLIMIT_STACK ) - struct rlimit rl; -#endif - -#ifdef GET_FULL_PATH_SELF - GET_FULL_PATH_SELF(kcl_self); -#else - kcl_self = argv[0]; +#ifdef RECREATE_HEAP + if (!raw_image) RECREATE_HEAP #endif - -#ifdef FIX_FILENAME - { - int n = strlen ( kcl_self ); - FIX_FILENAME ( Cnil, kcl_self ); - if ( strlen ( kcl_self ) > n ) { - error ( "name grew" ); - } - } -#endif - - *argv=kcl_self; - + #ifdef CAN_UNRANDOMIZE_SBRK #include <stdio.h> #include <stdlib.h> #include "unrandomize.h" #endif - + #ifdef LD_BIND_NOW #include <stdio.h> #include <stdlib.h> #include "ld_bind_now.h" #endif - - + + #if defined(DARWIN) - { - extern void init_darwin_zone_compat (); - init_darwin_zone_compat (); - } -#endif - -#ifdef GCL_GPROF - { - extern void *old_monstartup_pointer; - old_monstartup_pointer=NULL; - } -#endif - - install_segmentation_catcher(); - set_maxpage(); - -#ifdef RECREATE_HEAP - if (!raw_image) RECREATE_HEAP + { + extern void init_darwin_zone_compat (); + init_darwin_zone_compat (); + } #endif - - setbuf(stdin, stdin_buf); - setbuf(stdout, stdout_buf); - + + setbuf(stdin, stdin_buf); + setbuf(stdout, stdout_buf); #ifdef _WIN32 - - _fmode = _O_BINARY; - _setmode ( _fileno ( stdin ), _O_BINARY ); - _setmode ( _fileno ( stdout ), _O_BINARY ); - _setmode ( _fileno ( stderr ), _O_BINARY ); - - /* Don't initialise shared memory until after the Heap is recreated.*/ - init_shared_memory(); - -#endif - - ARGC = argc; - ARGV = argv; -#ifdef UNIX - ENVP = envp; - - if (raw_image) { - /* An uninitialised system eg raw_gcl */ - - bzero(system_directory,sizeof(system_directory)); - - if (argc<2) - strncpy(system_directory,"./",sizeof(system_directory)); - - else { - - int lastchar=strlen(argv[1])-1; - -/* strncpy(system_directory,argv[1],sizeof(system_directory)); */ -/* if (system_directory[0]!='/') { */ -/* strncpy(system_directory,"./",sizeof(system_directory)); */ -/* } else { */ -/* int j; */ -/* for (j=strlen(system_directory);system_directory[j-1]!='/';--j); */ -/* system_directory[j]='\0'; */ -/* } */ - - if (argv[1][lastchar]!='/') { - error ( "Can't get the system directory." ); - } - strncpy (system_directory,argv[1],sizeof(system_directory)); - - } - } -#else /* UNIX */ - if (raw_image && argc > 1) { - error("can't get the system directory"); - strncpy(system_directory, argv[1] ,sizeof(system_directory)); - } -#endif /* UNIX */ - - /* if stack_space not zero we have grown the stack space */ - if ( stack_space == 0 ) { - vs_org = value_stack; - vs_limit = &vs_org[VSSIZE]; - frs_org = frame_stack; - frs_limit = &frs_org[FRSSIZE]; - bds_org = bind_stack; - bds_limit = &bds_org[BDSSIZE]; -#ifdef KCLOVM - bds_save_org = save_bind_stack; - bds_save_top = bds_save_org - 1; - bds_save_limit = &bds_save_org[BDSSIZE]; + _fmode = _O_BINARY; + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); + _setmode( _fileno( stderr ), _O_BINARY ); +#endif + ARGC = argc; + ARGV = argv; + ENVP = envp; + +#ifdef GET_FULL_PATH_SELF + GET_FULL_PATH_SELF(kcl_self); +#else + kcl_self = argv[0]; #endif - ihs_org = ihs_stack; - ihs_limit = &ihs_org[IHSSIZE]; - } +#ifdef __MINGW32__ + { + char *s=kcl_self; + for (;*s;s++) if (*s=='\\') *s='/'; + } +#endif + *argv=kcl_self; + + if (raw_image && argc > 1) { + massert(argv[1][strlen(argv[1])-1]=='/'); + system_directory= (char *) malloc(strlen(argv[1])+3); + strcpy(system_directory, argv[1]); + } + + vs_top = vs_base = vs_org; + ihs_top = ihs_org-1; + bds_top = bds_org-1; + frs_top = frs_org-1; - vs_top = vs_base = vs_org; - clear_stack ( vs_top, vs_limit ); - ihs_top = ihs_org-1; - bds_top = bds_org-1; - frs_top = frs_org-1; - cs_org = cs_base = &argc; + cs_org = cs_base = &argc; #ifdef __ia64__ - { - extern void * __libc_ia64_register_backing_store_base; - cs_org2=cs_base2=__libc_ia64_register_backing_store_base; - } + { + extern void * __libc_ia64_register_backing_store_base; + cs_org2=cs_base2=__libc_ia64_register_backing_store_base; + } +#endif + cssize = (1L<<23); + install_segmentation_catcher(); + set_maxpage(); + +#if defined(BSD) && defined(RLIMIT_STACK) + { + struct rlimit rl; + unsigned long mss=(real_maxpage/64)<<PAGEWIDTH; + + massert(!getrlimit(RLIMIT_STACK, &rl)); + if (rl.rlim_max != RLIM_INFINITY && rl.rlim_max < mss) + mss=rl.rlim_max; + if (rl.rlim_cur == RLIM_INFINITY || rl.rlim_cur != mss) { + rl.rlim_cur=mss; +#ifdef __MIPS__ + if (setrlimit(RLIMIT_STACK,&rl)) + fprintf(stderr,"Cannot set stack rlimit\n");/*FIXME work around make bug on mips*/ +#else + massert(!setrlimit(RLIMIT_STACK,&rl)); #endif - /* CSSIZE in bytes, cssize for pointer arithmetic. */ - cssize = CSSIZE; - -#ifdef BSD -# ifdef RLIMIT_STACK - { - /* unsigned long mss; */ -/* mss=16*sizeof(short)*MAXPAGE; */ /* i.e. short foo[MAXPAGE] on stack in sgc_start */ - if (getrlimit(RLIMIT_STACK, &rl)) - error("Cannot get stack rlimit\n"); - if (rl.rlim_max != RLIM_INFINITY && rl.rlim_max < cssize) - cssize=rl.rlim_max; - if (rl.rlim_cur == RLIM_INFINITY || - rl.rlim_cur != cssize) { - rl.rlim_cur=cssize; - if (setrlimit(RLIMIT_STACK,&rl)) - error("Cannot set stack rlimit\n"); - } - cssize = rl.rlim_cur; } - - /* Maybe the soft limit for data segment size is lower than the - * hard limit. In that case, we want as much as possible. - */ - if (getrlimit(RLIMIT_DATA, &rl)) - error("Cannot get data rlimit\n"); - if (rl.rlim_cur != RLIM_INFINITY && - (rl.rlim_max == RLIM_INFINITY || - rl.rlim_max > rl.rlim_cur)) { + cssize = rl.rlim_cur/sizeof(*cs_org) - sizeof(*cs_org)*CSGETA; + + /* Maybe the soft limit for data segment size is lower than the + * hard limit. In that case, we want as much as possible. + */ + massert(!getrlimit(RLIMIT_DATA, &rl)); + if (rl.rlim_cur != RLIM_INFINITY && (rl.rlim_max == RLIM_INFINITY || rl.rlim_max > rl.rlim_cur)) { rl.rlim_cur = rl.rlim_max; - if (setrlimit(RLIMIT_DATA, &rl)) - error("Cannot set data rlimit\n"); + massert(!setrlimit(RLIMIT_DATA, &rl)); } - -#endif -#endif /* BSD */ - -#ifdef AV - - cs_limit = (void *)CSTACK_ADDRESS + cstack_dir * cssize + 1; + } #endif - - cstack_dir=get_cstack_dir(0); - - + + cs_limit = cs_org - cssize; + #ifdef SETUP_SIG_STACK - SETUP_SIG_STACK + SETUP_SIG_STACK #else - -# if defined(HAVE_SIGACTION) || defined(HAVE_SIGVEC) +#if defined(HAVE_SIGACTION) || defined(HAVE_SIGVEC) { + /* make sure the stack is 8 byte aligned */ static double estack_buf[32*SIGSTKSZ]; static struct sigaltstack estack; - + bzero(estack_buf,sizeof(estack_buf)); estack.ss_sp = estack_buf; estack.ss_flags = 0; estack.ss_size = sizeof(estack_buf); - if (sigaltstack(&estack, 0) < 0) - error("sigaltstack"); - + massert(sigaltstack(&estack, 0)>=0); + } -# endif /* defined(HAVE_SIGACTION) || defined(HAVE_SIGVEC) */ - -#endif /* SETUP_SIG_STACK */ - -#ifdef SGC - memprotect_test_reset(); -#endif +#endif +#endif + #ifdef GCL_GPROF - if (atexit(gprof_cleanup)) - error("Cannot setup gprof_cleanup on exit"); + if (atexit(gprof_cleanup)) + error("Cannot setup gprof_cleanup on exit"); #endif + + if (raw_image) { - if (!raw_image) { + printf("GCL (GNU Common Lisp) %s %ld pages\n",LISP_IMPLEMENTATION_VERSION,real_maxpage); + fflush(stdout); + + initlisp(); + lex_new(); + + GBC_enable = TRUE; + + gcl_init_init(); + + sLApackageA->s.s_dbind = user_package; + + def_env1[0]=(object)1;/*FIXME better place*/ + def_env1[1]=Cnil; + def_env=def_env1+1; + + src_env1[0]=(object)1;/*FIXME better place*/ + src_env1[1]=Cnil; + src_env=src_env1+1; + + } #ifdef _WIN32 - detect_wine(); -#endif - -#ifdef LD_BIND_NOW /*FIXME currently mips only, verify that these two - requirements are the same*/ - reinit_gmp(); + detect_wine(); #endif - if (saving_system) { - - saving_system = FALSE; - terminal_io->sm.sm_object0->sm.sm_fp = stdin; - terminal_io->sm.sm_object1->sm.sm_fp = stdout; - gcl_init_big1(); - -#ifdef INIT_CORE_END - INIT_CORE_END; -#endif - alloc_page(-(holepage + nrbpage)); - } - - GBC_enable = TRUE; - vs_base = vs_top; - ihs_push(Cnil); - lex_new(); - vs_base = vs_top; - - if (pre_gcl) init_boot(); - - interrupt_enable = TRUE; - install_default_signals(); - - sSAlisp_maxpagesA->s.s_dbind = make_fixnum(real_maxpage); -#ifdef KCLOVM - ovm_user_context_change = change_contexts; - ovm_user_context_initialize = initialize_process; - - v_init_processes(); - ovm_process_created = 1; + + if (saving_system) { + + saving_system = FALSE; + terminal_io->sm.sm_object0->sm.sm_fp = stdin; + terminal_io->sm.sm_object1->sm.sm_fp = stdout; +#ifdef LD_BIND_NOW /*FIXME currently mips only, verify that these two requirements are the same*/ + reinit_gmp(); #endif + gcl_init_big1(); + } + + ihs_push(Cnil); + lex_new(); + vs_base = vs_top; + + interrupt_enable = TRUE; + install_default_signals(); + + sSAlisp_maxpagesA->s.s_dbind = make_fixnum(real_maxpage); #ifdef HAVE_READLINE - gcl_init_readline_function(); -#endif - again: - super_funcall(sStop_level); - if (type_of(sSAmultiply_stacksA->s.s_dbind)==t_fixnum) { - multiply_stacks(fix(sSAmultiply_stacksA->s.s_dbind)); - goto again; - } - -#ifdef USE_DLOPEN - unlink_loaded_files(); -#endif - exit(0); - } - - printf("GCL (GNU Common Lisp) %s %ld pages\n", - LISP_IMPLEMENTATION_VERSION, - real_maxpage); - fflush(stdout); - - def_env1[0]=(object)1;/*FIXME better place*/ - def_env1[1]=Cnil; - def_env=def_env1+1; - - src_env1[0]=(object)1;/*FIXME better place*/ - src_env1[1]=Cnil; - src_env=src_env1+1; - - initlisp(); -#ifdef _WIN32 - detect_wine(); + gcl_init_readline_function(); #endif - - vs_base = vs_top; - ihs_push(Cnil); - lex_new(); - - GBC_enable = TRUE; - - CMPtemp = CMPtemp1 = CMPtemp2 = CMPtemp3 = OBJNULL; - -#ifdef HAVE_LIBBFD - parse_plt(); -#endif - gcl_init_init(); - - sLApackageA->s.s_dbind = user_package; - - lex_new(); - vs_base = vs_top; - - interrupt_enable = TRUE; - - super_funcall(sStop_level); - - return 0; + do + super_funcall(sStop_level); + while (type_of(sSAmultiply_stacksA->s.s_dbind)==t_fixnum && multiply_stacks(fix(sSAmultiply_stacksA->s.s_dbind))); + + return 0; } @@ -757,13 +625,9 @@ initlisp(void) { gcl_init_print(); gcl_init_GBC(); -#if defined ( UNIX ) || defined ( __MINGW32__ ) -#ifndef DGUX gcl_init_unixfasl(); gcl_init_unixsys(); gcl_init_unixsave(); -# endif -#endif /* defined ( UNIX ) || defined ( __MINGW32__ ) */ gcl_init_alloc_function(); gcl_init_array_function(); @@ -786,10 +650,8 @@ initlisp(void) { gcl_init_hash(); gcl_init_cfun(); -#ifdef UNIX gcl_init_unixfsys(); gcl_init_unixtime(); -#endif gcl_init_eval(); gcl_init_lex(); gcl_init_prog(); @@ -914,7 +776,6 @@ FFN(siLargv)(void) { vs_base[0] = make_simple_string(ARGV[i]); } -#ifdef UNIX static void FFN(siLgetenv)(void) { @@ -1142,9 +1003,7 @@ init_main(void) { make_si_function("ARGC", siLargc); make_si_function("ARGV", siLargv); -#ifdef UNIX make_si_function("GETENV", siLgetenv); -#endif make_si_function("MARK-VS", siLmark_vs); make_si_function("CHECK-VS", siLcheck_vs); diff --git a/gcl/o/usig2_aux.c b/gcl/o/usig2_aux.c index 075dd007..3b119ab1 100755 --- a/gcl/o/usig2_aux.c +++ b/gcl/o/usig2_aux.c @@ -7,10 +7,6 @@ XSI(in_signal_handler); XSI(nlj_active); XS(nlj_fr); XS(nlj_tag); -XS(CMPtemp); -XS(CMPtemp1); -XS(CMPtemp2); -XS(CMPtemp3); XSI(PRINTarray); XSI(PRINTbase); XS(PRINTcase); |