From 8b43bc737beced9427e5ad1b0a605cb1d41c93bd Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 15 Aug 2013 02:46:16 +0300 Subject: [PATCH] simpler solution to regparm problem --- pico/32x/sh2soc.c | 2 +- pico/pico_int.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pico/32x/sh2soc.c b/pico/32x/sh2soc.c index bdd07a04..373dd478 100644 --- a/pico/32x/sh2soc.c +++ b/pico/32x/sh2soc.c @@ -294,7 +294,7 @@ void REGPARM(3) sh2_peripheral_write16(u32 a, u32 d, SH2 *sh2) r[(a / 2) ^ 1] = d; } -void sh2_peripheral_write32(u32 a, u32 d, SH2 *sh2) +void REGPARM(3) sh2_peripheral_write32(u32 a, u32 d, SH2 *sh2) { u32 *r = sh2->peri_regs; elprintf(EL_32XP, "%csh2 peri w32 [%08x] %08x @%06x", diff --git a/pico/pico_int.h b/pico/pico_int.h index 339d1bf1..fa99c5bc 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -796,9 +796,9 @@ void p32x_timers_do(unsigned int m68k_slice); unsigned int sh2_peripheral_read8(unsigned int a, SH2 *sh2); unsigned int sh2_peripheral_read16(unsigned int a, SH2 *sh2); unsigned int sh2_peripheral_read32(unsigned int a, SH2 *sh2); -void sh2_peripheral_write8(unsigned int a, unsigned int d, SH2 *sh2); -void sh2_peripheral_write16(unsigned int a, unsigned int d, SH2 *sh2); -void sh2_peripheral_write32(unsigned int a, unsigned int d, SH2 *sh2); +void REGPARM(3) sh2_peripheral_write8(unsigned int a, unsigned int d, SH2 *sh2); +void REGPARM(3) sh2_peripheral_write16(unsigned int a, unsigned int d, SH2 *sh2); +void REGPARM(3) sh2_peripheral_write32(unsigned int a, unsigned int d, SH2 *sh2); #else #define Pico32xInit() @@ -926,7 +926,7 @@ void pevt_dump(void); #define cdprintf(x...) #endif -#ifdef __i386__ +#if defined(__GNUC__) && defined(__i386__) #define REGPARM(x) __attribute__((regparm(x))) #else #define REGPARM(x) -- 2.39.5