summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exec.h6
-rw-r--r--softmmu_header.h4
-rw-r--r--softmmu_template.h4
3 files changed, 10 insertions, 4 deletions
diff --git a/exec.h b/exec.h
index 5341496b72..29779f99de 100644
--- a/exec.h
+++ b/exec.h
@@ -32,6 +32,12 @@
#define __builtin_expect(x, n) (x)
#endif
+#ifdef __i386__
+#define REGPARM(n) __attribute((regparm(n)))
+#else
+#define REGPARM(n)
+#endif
+
/* is_jmp field values */
#define DISAS_NEXT 0 /* next instruction can be analyzed */
#define DISAS_JUMP 1 /* only pc was modified dynamically */
diff --git a/softmmu_header.h b/softmmu_header.h
index 12306a6667..36cf9f0a11 100644
--- a/softmmu_header.h
+++ b/softmmu_header.h
@@ -49,8 +49,8 @@
#if MEMUSER == 0
-DATA_TYPE __attribute((regparm(1))) glue(glue(__ld, SUFFIX), _mmu)(unsigned long addr);
-void __attribute((regparm(2))) glue(glue(__st, SUFFIX), _mmu)(unsigned long addr, DATA_TYPE v);
+DATA_TYPE REGPARM(1) glue(glue(__ld, SUFFIX), _mmu)(unsigned long addr);
+void REGPARM(2) glue(glue(__st, SUFFIX), _mmu)(unsigned long addr, DATA_TYPE v);
#endif
static inline int glue(glue(ldu, SUFFIX), MEMSUFFIX)(void *ptr)
diff --git a/softmmu_template.h b/softmmu_template.h
index 871cf5491c..c36e25ae20 100644
--- a/softmmu_template.h
+++ b/softmmu_template.h
@@ -81,7 +81,7 @@ static inline void glue(io_write, SUFFIX)(unsigned long physaddr,
}
/* handle all cases except unaligned access which span two pages */
-DATA_TYPE __attribute((regparm(1))) glue(glue(__ld, SUFFIX), _mmu)(unsigned long addr)
+DATA_TYPE REGPARM(1) glue(glue(__ld, SUFFIX), _mmu)(unsigned long addr)
{
DATA_TYPE res;
int is_user, index;
@@ -163,7 +163,7 @@ static DATA_TYPE glue(slow_ld, SUFFIX)(unsigned long addr, void *retaddr)
}
-void __attribute((regparm(2))) glue(glue(__st, SUFFIX), _mmu)(unsigned long addr, DATA_TYPE val)
+void REGPARM(2) glue(glue(__st, SUFFIX), _mmu)(unsigned long addr, DATA_TYPE val)
{
unsigned long physaddr, tlb_addr;
void *retaddr;