diff -c -r sim/sim/kernel/makefile.SH new-sim/sim/kernel/makefile.SH *** sim/sim/kernel/makefile.SH Thu Oct 28 05:54:45 1993 --- new-sim/sim/kernel/makefile.SH Mon May 19 17:33:53 1997 *************** *** 45,57 **** functionobj = channels.o monitor.o reliablenest.o symtab.o fuzzy.o node_queue.o routing.o table.o hash.o plotting.o sim.o tree.o init.o switches.o ! final: $(functionobj) $(headers) symtab.o: symtab.c makefile ! $(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) symtab.c sim.o: sim.c ! $(CC) $(CFLAGS) -I$(INC) $(LIBS) $(LDFLAGS) $d_cckr sim.c !GROK!THIS! cat >>makefile <<'!NO!SUBS!' --- 45,57 ---- functionobj = channels.o monitor.o reliablenest.o symtab.o fuzzy.o node_queue.o routing.o table.o hash.o plotting.o sim.o tree.o init.o switches.o ! final: \$(functionobj) \$(headers) symtab.o: symtab.c makefile ! \$(CC) \$(CFLAGS) \$(LIBS) \$(LDFLAGS) symtab.c sim.o: sim.c ! \$(CC) \$(CFLAGS) -I\$(INC) \$(LIBS) \$(LDFLAGS) $d_cckr sim.c !GROK!THIS! cat >>makefile <<'!NO!SUBS!' diff -c -r sim/sim/kernel/sim.c new-sim/sim/kernel/sim.c *** sim/sim/kernel/sim.c Sat Oct 23 07:48:47 1993 --- new-sim/sim/kernel/sim.c Mon May 19 17:33:17 1997 *************** *** 144,153 **** /* always put results relative to current directory */ ! *dump_path = '.'; ! outpathlen = strlen(dump_path); ! dump_path[outpathlen] = '/'; ! outpathlen++; if (argc > 1) { --- 144,153 ---- /* always put results relative to current directory */ ! dump_path[0] = '.'; ! dump_path[1] = '/'; ! dump_path[2] = '\0'; ! outpathlen = 2; if (argc > 1) { diff -c -r sim/src/Configure new-sim/src/Configure *** sim/src/Configure Thu Oct 28 07:02:56 1993 --- new-sim/src/Configure Mon May 19 17:19:47 1997 *************** *** 646,651 **** --- 646,656 ---- echo "Hooray, it works! I was beginning to wonder." cpp='cc -E' cppminus='-'; + # MTP: gcc-cpp puts in extra space + elif $contains 'abc .xyz' testcpp.out >/dev/null 2>&1 ; then + echo "Ha, gcc can not trick us." + cpp='cc -E' + cppminus='-'; else echo 'Nope...maybe "cc -P" will work...' cc -P testcpp.out 2>&1 *************** *** 1236,1241 **** --- 1241,1249 ---- EOCP cc -cckr try.c 2>try.cckr if $contains unknown try.cckr >/dev/null 2>&1; then + echo "Nope, it can't. " + d_cckr='' + elif $contains unrecognized try.cckr >/dev/null 2>&1; then echo "Nope, it can't. " d_cckr='' else diff -c -r sim/src/Makefile.SH new-sim/src/Makefile.SH *** sim/src/Makefile.SH Thu Oct 28 06:53:22 1993 --- new-sim/src/Makefile.SH Sun May 18 16:35:27 1997 *************** *** 28,34 **** LLIB = $lintlib DEFS = ! CPPFLAGS = $(DEFS) OPTFLAGS = -g -D_BSD_SIGNALS $d_cckr --- 28,34 ---- LLIB = $lintlib DEFS = ! CPPFLAGS = \$(DEFS) OPTFLAGS = -g -D_BSD_SIGNALS $d_cckr *************** *** 69,75 **** .SUFFIXES: .S .S.o: ! #$(CPP) $(CPPFLAGS) < $< | grep -v '^#' > $*.s $(AS) $(ASFLAGS) $(TARGET_ARCH) -o $@ $*.s @rm -f $*.s --- 69,75 ---- .SUFFIXES: .S .S.o: ! $(CPP) $(CPPFLAGS) < $< | grep -v '^#' > $*.s $(AS) $(ASFLAGS) $(TARGET_ARCH) -o $@ $*.s @rm -f $*.s diff -c -r sim/src/server.c new-sim/src/server.c *** sim/src/server.c Fri Oct 22 07:38:39 1993 --- new-sim/src/server.c Mon May 19 16:32:56 1997 *************** *** 5,10 **** --- 5,16 ---- * $Header: server.c,v 2.5 88/03/31 14:50:23 dupuy Rel $ */ + /* include stdio.h properly, before including it from within nest.h but + with extern #define'd to nothing, which is bogus and causes grief on + linux + */ + #include + #define extern #include "nest.h" #include "graph.h" diff -c -r sim/src/simulate.h new-sim/src/simulate.h *** sim/src/simulate.h Fri Oct 22 07:38:40 1993 --- new-sim/src/simulate.h Sun May 18 18:03:35 1997 *************** *** 67,69 **** --- 67,77 ---- #define noreport() #define onreport() #endif + + #ifdef __linux__ + /* linux uses _ rather than __ in dependencies */ + #define _xstack __xstack + #define _stack __stack + #define _cook __cook + #define _freeze __freeze + #endif diff -c -r sim/src/state.S new-sim/src/state.S *** sim/src/state.S Fri Oct 29 03:44:11 1993 --- new-sim/src/state.S Sun May 18 15:52:58 1997 *************** *** 254,259 **** --- 254,319 ---- #endif + #ifdef i386 + + .text + .align 2 + .globl __stack + __stack: + popl %ebx /* pop return address */ + movl %esp,%eax /* return arg pointer */ + jmp %ebx /* don't want ret so don't alter esp */ + + + .align 2 + .globl __xstack + __xstack: + popl %eax /* pop return address */ + movl (%esp),%esp /* copy new stack pointer into sp */ + jmp %eax /* jump directly to saved pc */ + + + .align 2 + .globl __freeze + __freeze: + movl 4(%esp),%eax /* eax = saved state */ + + movl %ebp, 4(%eax) /* save fp */ + movl %ebx, 8(%eax) /* save gen registers */ + movl %ecx, 12(%eax) + movl %edx, 16(%eax) + movl %esi, 20(%eax) + movl %edi, 24(%eax) + movl %esp, 28(%eax) /* save sp */ + fnsave 32(%eax) /* save fpu state */ + + movl (%esp), %ecx /* save pc */ + movl %ecx, (%eax) + + movl $0, %eax /* clear return register */ + ret + + .align 2 + .globl __cook + __cook: + popl %ecx /* forget calling pc on stack */ + + movl (%esp),%eax /* eax = saved */ + + movl 4(%eax), %ebp /* restore fp */ + movl 8(%eax), %ebx /* restore gen registers */ + movl 12(%eax), %ecx + movl 16(%eax), %edx + movl 20(%eax), %esi + movl 24(%eax), %edi + movl 28(%eax), %esp /* restore sp */ + frstor 32(%eax) /* restore fpu state */ + + pushl (%eax) /* push new pc on stack */ + movl $1, %eax /* return 1 */ + ret /* return - restores pc */ + #endif /* i386 */ + #ifdef sparc /* code by S. McCanne at LBL */ diff -c -r sim/src/state.h new-sim/src/state.h *** sim/src/state.h Thu Oct 28 02:06:01 1993 --- new-sim/src/state.h Mon May 19 16:36:12 1997 *************** *** 4,10 **** /* #define mc68000 /**/ /* #define u3b2 /**/ /* #define vax /**/ ! /* * Internal machine states are used to preserve the environment of the --- 4,10 ---- /* #define mc68000 /**/ /* #define u3b2 /**/ /* #define vax /**/ ! /* #define i386 /**/ /* * Internal machine states are used to preserve the environment of the *************** *** 63,66 **** --- 63,75 ---- int fp; int pc; #endif + + #ifdef i386 + int pc; /* %eip */ + int fp; /* %ebp */ + int regs[5]; /* %ebx, %ecx, %edx, %edi, %esi */ + int sp; /* %esp */ + char fpustate[108]; + #endif + } istate; diff -c -r sim/src/timers.c new-sim/src/timers.c *** sim/src/timers.c Fri Oct 22 07:38:39 1993 --- new-sim/src/timers.c Sun May 18 22:00:59 1997 *************** *** 22,28 **** timev unblocktime; int reason; { ! register process *proc = &(_proc_table[_current_node]); extern int errno; int olderrno; pointer stack; --- 22,28 ---- timev unblocktime; int reason; { ! process *proc = &(_proc_table[_current_node]); extern int errno; int olderrno; pointer stack; *************** *** 77,83 **** _start_timer (nowtime) timev nowtime; { ! register process *proc = &(_proc_table[_current_node]); if (time_nonzero (nowtime)) /* we should set new time values */ { --- 77,83 ---- _start_timer (nowtime) timev nowtime; { ! process *proc = &(_proc_table[_current_node]); if (time_nonzero (nowtime)) /* we should set new time values */ {