]> Git Repo - qemu.git/commitdiff
tests/tcg: move MIPS specific tests into subdir
authorAlex Bennée <[email protected]>
Thu, 5 Apr 2018 14:50:08 +0000 (15:50 +0100)
committerAlex Bennée <[email protected]>
Wed, 20 Jun 2018 19:22:34 +0000 (20:22 +0100)
These only need to be built for MIPS guests.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
tests/tcg/README
tests/tcg/hello-mips.c [deleted file]
tests/tcg/mips/README [new file with mode: 0644]
tests/tcg/mips/hello-mips.c [new file with mode: 0644]

index 625f2326e67463f7e13151832eaf53e1fa45929e..a5643d33e788858b58db9881f4eee10ba8012fb7 100644 (file)
@@ -3,17 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be
 built for all guest architectures that support linux-user executable,
 or they are architecture specific.
 
-
-
-MIPS
-====
-
-hello-mips
-----------
-
-hello-mipsel
-------------
-
 CRIS
 ====
 The testsuite for CRIS is in tests/tcg/cris.  You can run it
diff --git a/tests/tcg/hello-mips.c b/tests/tcg/hello-mips.c
deleted file mode 100644 (file)
index f825673..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-* MIPS o32 Linux syscall example
-*
-* http://www.linux-mips.org/wiki/RISC/os
-* http://www.linux-mips.org/wiki/MIPSABIHistory
-* http://www.linux.com/howtos/Assembly-HOWTO/mips.shtml
-*
-* mipsel-linux-gcc -nostdlib -mno-abicalls -fno-PIC -mabi=32 \
-*                  -O2 -static -o hello-mips hello-mips.c
-*
-*/
-#define __NR_SYSCALL_BASE      4000
-#define __NR_exit                      (__NR_SYSCALL_BASE+  1)
-#define __NR_write                     (__NR_SYSCALL_BASE+  4)
-
-static inline void exit1(int status)
-{
-    register unsigned long __a0 asm("$4") = (unsigned long) status;
-
-    __asm__ __volatile__ (
-        "      .set push       \n"
-        "      .set noreorder  \n"
-        "      li      $2, %0  \n"
-        "      syscall         \n"
-        "      .set pop        "
-        :
-       : "i" (__NR_exit), "r" (__a0)
-       : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
-         "memory");
-}
-
-static inline int write(int fd, const char *buf, int len)
-{
-    register unsigned long __a0 asm("$4") = (unsigned long) fd;
-    register unsigned long __a1 asm("$5") = (unsigned long) buf;
-    register unsigned long __a2 asm("$6") = (unsigned long) len;
-    register unsigned long __a3 asm("$7");
-    unsigned long __v0;
-
-    __asm__ __volatile__ (
-        "      .set push       \n"
-        "      .set noreorder  \n"
-        "      li      $2, %2  \n"
-        "      syscall         \n"
-        "      move    %0, $2  \n"
-        "      .set pop        "
-        : "=r" (__v0), "=r" (__a3)
-        : "i" (__NR_write), "r" (__a0), "r" (__a1), "r" (__a2)
-       : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
-         "memory");
-
-/*    if (__a3 == 0) */
-        return (int) __v0;
-/*
-    errno = __v0;
-    return -1;
- */
-}
-
-void __start(void)
-{
-    write (1, "Hello, World!\n", 14);
-    exit1 (42);
-}
diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README
new file mode 100644 (file)
index 0000000..e5bbc58
--- /dev/null
@@ -0,0 +1,7 @@
+MIPS
+====
+
+hello-mips
+----------
+
+A very simple inline assembly, write syscall based hello world
diff --git a/tests/tcg/mips/hello-mips.c b/tests/tcg/mips/hello-mips.c
new file mode 100644 (file)
index 0000000..f825673
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+* MIPS o32 Linux syscall example
+*
+* http://www.linux-mips.org/wiki/RISC/os
+* http://www.linux-mips.org/wiki/MIPSABIHistory
+* http://www.linux.com/howtos/Assembly-HOWTO/mips.shtml
+*
+* mipsel-linux-gcc -nostdlib -mno-abicalls -fno-PIC -mabi=32 \
+*                  -O2 -static -o hello-mips hello-mips.c
+*
+*/
+#define __NR_SYSCALL_BASE      4000
+#define __NR_exit                      (__NR_SYSCALL_BASE+  1)
+#define __NR_write                     (__NR_SYSCALL_BASE+  4)
+
+static inline void exit1(int status)
+{
+    register unsigned long __a0 asm("$4") = (unsigned long) status;
+
+    __asm__ __volatile__ (
+        "      .set push       \n"
+        "      .set noreorder  \n"
+        "      li      $2, %0  \n"
+        "      syscall         \n"
+        "      .set pop        "
+        :
+       : "i" (__NR_exit), "r" (__a0)
+       : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
+         "memory");
+}
+
+static inline int write(int fd, const char *buf, int len)
+{
+    register unsigned long __a0 asm("$4") = (unsigned long) fd;
+    register unsigned long __a1 asm("$5") = (unsigned long) buf;
+    register unsigned long __a2 asm("$6") = (unsigned long) len;
+    register unsigned long __a3 asm("$7");
+    unsigned long __v0;
+
+    __asm__ __volatile__ (
+        "      .set push       \n"
+        "      .set noreorder  \n"
+        "      li      $2, %2  \n"
+        "      syscall         \n"
+        "      move    %0, $2  \n"
+        "      .set pop        "
+        : "=r" (__v0), "=r" (__a3)
+        : "i" (__NR_write), "r" (__a0), "r" (__a1), "r" (__a2)
+       : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
+         "memory");
+
+/*    if (__a3 == 0) */
+        return (int) __v0;
+/*
+    errno = __v0;
+    return -1;
+ */
+}
+
+void __start(void)
+{
+    write (1, "Hello, World!\n", 14);
+    exit1 (42);
+}
This page took 0.032375 seconds and 4 git commands to generate.