diff -Nru fio-1.57/debian/changelog fio-1.57/debian/changelog --- fio-1.57/debian/changelog 2011-08-03 21:16:17.000000000 +0900 +++ fio-1.57/debian/changelog 2011-08-25 11:36:32.000000000 +0900 @@ -1,3 +1,10 @@ +fio (1.57-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Add support SH4A and SH5. + + -- Nobuhiro Iwamatsu Thu, 25 Aug 2011 00:17:52 +0000 + fio (1.57-1) unstable; urgency=low * Imported Upstream version 1.57. diff -Nru fio-1.57/debian/patches/debian-changes-1.57-1.1 fio-1.57/debian/patches/debian-changes-1.57-1.1 --- fio-1.57/debian/patches/debian-changes-1.57-1.1 1970-01-01 09:00:00.000000000 +0900 +++ fio-1.57/debian/patches/debian-changes-1.57-1.1 2011-08-25 11:44:14.000000000 +0900 @@ -0,0 +1,108 @@ +Description: Upstream changes introduced in version 1.57-1.1 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + fio (1.57-1.1) unstable; urgency=low + . + * Non-maintainer upload. + * Add support SH4A and SH5. + . + The person named in the Author field signed this changelog entry. +Author: Nobuhiro Iwamatsu + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- fio-1.57.orig/fio.c ++++ fio-1.57/fio.c +@@ -35,6 +35,9 @@ + #include + #include + #include ++#if defined(__sh__) ++#include ++#endif + + #include "fio.h" + #include "hash.h" +@@ -61,6 +64,10 @@ int shm_id = 0; + int temp_stall_ts; + unsigned long done_secs = 0; + ++#if defined(__sh__) ++int synco_support = 0; ++#endif ++ + static struct fio_mutex *startup_mutex; + static struct fio_mutex *writeout_mutex; + static volatile int fio_abort; +@@ -1690,10 +1697,34 @@ static void run_threads(void) + fio_unpin_memory(); + } + +-int main(int argc, char *argv[]) ++#if defined(__sh__) ++ ++#define CPU_HAS_LLSC 0x0040 ++static void chk_envp(char *envp[]) ++{ ++ Elf32_auxv_t *auxv; ++ ++ while(*envp++ != NULL); ++ ++ for (auxv = (Elf32_auxv_t *)envp; auxv->a_type != AT_NULL; auxv++) ++ { ++ if(auxv->a_type == AT_HWCAP) { ++ if (auxv->a_un.a_val & CPU_HAS_LLSC) ++ synco_support = 1; ++ } ++ } ++ ++} ++#endif ++ ++int main(int argc, char* argv[], char* envp[]) + { + long ps; + ++#if defined(__sh__) ++ chk_envp(envp); ++#endif ++ + sinit(); + init_rand(&__fio_rand_state); + +--- fio-1.57.orig/arch/arch-sh.h ++++ fio-1.57/arch/arch-sh.h +@@ -22,11 +22,15 @@ + + #define nop __asm__ __volatile__ ("nop": : :"memory") + +-#if defined(__SH4A__) +-#define mb() __asm__ __volatile__ ("synco": : :"memory") +-#else +-#define mb() __asm__ __volatile__ (" " : : : "memory") +-#endif ++extern int synco_support; ++ ++#define mb()\ ++do {\ ++ if(synco_support) \ ++ __asm__ __volatile__ ("synco": : :"memory"); \ ++ else \ ++ __asm__ __volatile__ (" " : : : "memory"); \ ++} while (0) + + #define read_barrier() mb() + #define write_barrier() mb() diff -Nru fio-1.57/debian/patches/series fio-1.57/debian/patches/series --- fio-1.57/debian/patches/series 2011-08-01 19:38:38.000000000 +0900 +++ fio-1.57/debian/patches/series 2011-08-25 11:36:32.000000000 +0900 @@ -1 +1,2 @@ makefile +debian-changes-1.57-1.1