Add abort() for benefit of benchmark code
authorAndrew Waterman <andrew@sifive.com>
Wed, 26 Apr 2017 19:25:01 +0000 (12:25 -0700)
committerAndrew Waterman <andrew@sifive.com>
Wed, 26 Apr 2017 19:25:01 +0000 (12:25 -0700)
benchmarks/common/syscalls.c

index 4940aa24b9f31b02d0f81cea38ccd6be948525d1..0a7d6b728f633304d9b3aa9e01ecb2b8ddf6f57c 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <limits.h>
+#include <sys/signal.h>
 #include "util.h"
 
 #define SYS_write 64
@@ -68,6 +69,11 @@ void exit(int code)
   tohost_exit(code);
 }
 
+void abort()
+{
+  exit(128 + SIGABRT);
+}
+
 void printstr(const char* s)
 {
   syscall(SYS_write, 1, (uintptr_t)s, strlen(s));