commit 9a2b020a5090f8a6adcd2a6adaca4f45e6e16c45
parent d52d77e87cb09ce493323ff70a48234d99484511
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date: Sat, 11 Sep 2010 23:09:14 +0200
segmentation bug fix, thanks to Charles Forsyth
Diffstat:
5 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
@@ -3,6 +3,7 @@ The following people have contributed source code to vx32.
Bryan Ford <baford@pdos.csail.mit.edu>
Michael Teichgräber <mt4swm@googlemail.com>
Russ Cox <rsc@swtch.com>
+Charles Forsyth <forsyth@terzarima.net>
Jesus Galan Lopez <yiyu.jgl@gmail.com>
Tuly Gray
Devon H. O'Dell
diff --git a/src/9vx/main.c b/src/9vx/main.c
@@ -62,6 +62,7 @@ static int singlethread;
static void bootinit(void);
static void siginit(void);
+static void machkeyinit(void);
static char* getuser(void);
static char* nobootprompt(char*);
@@ -87,6 +88,9 @@ main(int argc, char **argv)
char *inifile;
/* Minimal set up to make print work. */
+#ifndef TLS
+ machkeyinit();
+#endif
setmach(&mach0);
coherence = nop;
quotefmtinstall();
@@ -725,10 +729,6 @@ setsigsegv(int vx32)
void
mach0init(void)
{
-#ifndef TLS
- machkeyinit();
-#endif
-
conf.nmach = 1;
machinit(); /* common per-processor init */
active.machs = 1;
diff --git a/src/9vx/sched.c b/src/9vx/sched.c
@@ -159,8 +159,7 @@ runproc(void)
unlock(&kprocq.lk);
punlock(&run);
/*
- * To avoid the "double sleep" bug
- * Full history begins at:
+ * To avoid the "double sleep" bug. See:
* http://9fans.net/archive/2010/06/71
*/
while (p->mach)
diff --git a/src/Makefrag b/src/Makefrag
@@ -1,8 +1,7 @@
# Main top-level makefile fragment for the vx32 virtual machine.
# Compiler flags common to both host and VX32 environment files.
-#COMMON_CFLAGS = -g -O3 -MD -std=gnu99 -I. $(CFLAGS)
-COMMON_CFLAGS = -g -MD -std=gnu99 -I. $(CFLAGS)
+COMMON_CFLAGS = -g -O2 -MD -std=gnu99 -I. -fno-stack-protector $(CFLAGS)
COMMON_LDFLAGS = -g -L. $(LDFLAGS)
# Host environment compiler options
diff --git a/src/libvx32/run32.S b/src/libvx32/run32.S
@@ -111,6 +111,7 @@ EXT(vxrun_return):
popl %edi
popl %esi
popl %ebx
+ cld
ret
@@ -128,6 +129,7 @@ EXT(vxrun_cleanup):
// (DS/ES/SS were already restored by vxrun_return.)
movw VXEMU_HOST_VS(%eax),VSEG
+ cld
ret
// Don't put anything here!