Add sparc and sparc64 support

Also get rid of the arch private ffz functions, the generic
one is just fine.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.c b/fio.c
index 7a420da..bcabe33 100644
--- a/fio.c
+++ b/fio.c
@@ -107,37 +107,43 @@
 	setitimer(ITIMER_REAL, &itimer, NULL);
 }
 
-/*
- * We need to rearm on BSD/solaris. Switch this to sigaction in the future...
- */
-static void set_sig_handlers(void (*sighandler)(int))
+static void sig_alrm(int sig)
 {
-	signal(SIGINT, sighandler);
-	signal(SIGALRM, sighandler);
-}
-
-static void sig_handler(int sig)
-{
-	set_sig_handlers(sig_handler);
-
-	if (!threads)
-		return;
-
-	switch (sig) {
-	case SIGALRM:
+	if (threads) {
 		update_io_ticks();
 		print_thread_status();
 		status_timer_arm();
-		break;
-	default:
+	}
+}
+
+static void sig_int(int sig)
+{
+	if (threads) {
 		printf("\nfio: terminating on signal %d\n", sig);
 		fflush(stdout);
 		terminate_threads(TERMINATE_ALL);
-		break;
 	}
 }
 
 /*
+ * We need to rearm on BSD/solaris. Switch this to sigaction in the future...
+ */
+static void set_sig_handlers(void)
+{
+	struct sigaction act;
+
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = sig_alrm;
+	act.sa_flags = SA_RESTART;
+	sigaction(SIGALRM, &act, NULL);
+
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = sig_int;
+	act.sa_flags = SA_RESTART;
+	sigaction(SIGINT, &act, NULL);
+}
+
+/*
  * Check if we are above the minimum rate given.
  */
 static int check_min_rate(struct thread_data *td, struct timeval *now)
@@ -1156,7 +1162,7 @@
 		fflush(stdout);
 	}
 
-	set_sig_handlers(sig_handler);
+	set_sig_handlers();
 
 	todo = thread_number;
 	nr_running = 0;