Browse Source

fix gp2x regression

kub 4 years ago
parent
commit
1fd8f98696
3 changed files with 4 additions and 4 deletions
  1. 1 1
      cpu/sh2/compiler.c
  2. 2 2
      cpu/sh2/sh2.h
  3. 1 1
      tools/mkoffsets.sh

+ 1 - 1
cpu/sh2/compiler.c

@@ -1248,7 +1248,7 @@ static void dr_activate_block(struct block_desc *bd, int tcache_id, int is_slave
   bd->active = 1;
 }
 
-static void REGPARM(3) ALIGNED(32) *dr_lookup_block(u32 pc, SH2 *sh2, int *tcache_id)
+static void REGPARM(3) *dr_lookup_block(u32 pc, SH2 *sh2, int *tcache_id)
 {
   struct block_entry *be = NULL;
   void *block = NULL;

+ 2 - 2
cpu/sh2/sh2.h

@@ -13,7 +13,7 @@ typedef enum {
 typedef struct SH2_
 {
 	// registers. this MUST correlate with enum sh2_reg_e.
-	unsigned int	r[16];		// 00
+	unsigned int	r[16] ALIGNED(32);
 	unsigned int	pc;		// 40
 	unsigned int	ppc;
 	unsigned int	pr;
@@ -80,7 +80,7 @@ typedef struct SH2_
 
 	unsigned char	data_array[0x1000]; // cache (can be used as RAM)
 	unsigned int	peri_regs[0x200/4]; // periphereal regs
-} SH2 ALIGNED(32);
+} SH2;
 
 #define CYCLE_MULT_SHIFT 10
 #define C_M68K_TO_SH2(xsh2, c) \

+ 1 - 1
tools/mkoffsets.sh

@@ -48,7 +48,7 @@ get_define () # prefix struct member member...
 	line=$(printf "#define %-20s 0x%04x" $prefix$name $rodata)
 }
 
-CFLAGS="$CFLAGS -fno-lto"
+if echo $CFLAGS | grep -qe -flto; then CFLAGS="$CFLAGS -fno-lto"; fi
 # determine endianess
 echo "const int val = 1;" >/tmp/getoffs.c
 compile_rodata