repository: /home/avi/kvm
branch: master
commit 436289e523194b3a433a227d2a3b108e5d05c092
Author: Avi Kivity <[EMAIL PROTECTED]>
Date:   Wed Nov 14 18:57:19 2007 +0200

    kvm: testsuite: exit after executing test

diff --git a/user/Makefile b/user/Makefile
index 70f3fbe..e9e9230 100644
--- a/user/Makefile
+++ b/user/Makefile
@@ -28,13 +28,15 @@ CXXFLAGS = $(autodepend-flags)
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
+FLATLIBS = $(TEST_DIR)/libcflat.a
+
 kvmctl: LDFLAGS += -pthread -lrt
 
 kvmctl: $(kvmctl_objs)
        $(CC) $(LDFLAGS) $^ -o $@
 
-%.flat: %.o
-       $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^
+%.flat: %.o $(FLATLIBS)
+       $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
 
 %.o: %.S
        $(CC) $(CFLAGS) -c -nostdlib -o $@ $^
diff --git a/user/config-x86-common.mak b/user/config-x86-common.mak
index 7dc0a2f..6d5c795 100644
--- a/user/config-x86-common.mak
+++ b/user/config-x86-common.mak
@@ -33,6 +33,9 @@ $(TEST_DIR)/test32.flat: $(TEST_DIR)/test32.o
 $(TEST_DIR)/smp.flat: $(cstart.o) $(TEST_DIR)/smp.o $(TEST_DIR)/printf.o \
                        $(TEST_DIR)/smptest.o
  
+$(TEST_DIR)/libcflat.a: $(TEST_DIR)/lib/exit.o
+       ar rcs $@ $^
+
 arch_clean:
        $(RM) $(TEST_DIR)/bootstrap $(TEST_DIR)/*.o $(TEST_DIR)/*.flat \
        $(TEST_DIR)/.*.d
diff --git a/user/test/x86/cstart.S b/user/test/x86/cstart.S
index 98df040..69a6262 100644
--- a/user/test/x86/cstart.S
+++ b/user/test/x86/cstart.S
@@ -4,7 +4,7 @@
 
 .section .init
        call main
-1:     hlt
-       jmp 1b
+       push %eax
+       call exit
 
 
diff --git a/user/test/x86/cstart64.S b/user/test/x86/cstart64.S
index 416db24..16641c2 100644
--- a/user/test/x86/cstart64.S
+++ b/user/test/x86/cstart64.S
@@ -112,9 +112,8 @@ start64:
        call load_tss
        call smp_init
        call main
-
-1:     hlt
-       jmp 1b
+       mov %eax, %edi
+       call exit
 
 load_tss:
        mov $0, %eax
diff --git a/user/test/x86/lib/exit.c b/user/test/x86/lib/exit.c
new file mode 100644
index 0000000..2ae43ea
--- /dev/null
+++ b/user/test/x86/lib/exit.c
@@ -0,0 +1,5 @@
+
+void exit(int code)
+{
+       asm volatile("out %0, %1" : : "a"(code), "d"((short)0xf4));
+}

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to