From: Julian Seward Date: Wed, 8 Sep 2010 15:12:33 +0000 (+0000) Subject: Fix somewhat nonsensical ifdeffery. X-Git-Tag: svn/VALGRIND_3_6_0~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=437bec2e42176fd2929ddcb5a35f50d6f900115b;p=thirdparty%2Fvalgrind.git Fix somewhat nonsensical ifdeffery. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11345 --- diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c index 54feb67f4f..fdd2ce8030 100644 --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c @@ -382,14 +382,14 @@ Int VG_(machine_arm_archlevel) = 4; #endif -/* Determine what insn set and insn set variant the host has, and - record it. To be called once at system startup. Returns False if - this a CPU incapable of running Valgrind. */ - +/* For hwcaps detection on ppc32/64 and arm we'll need to do SIGILL + testing, so we need a jmp_buf. */ #if defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_arm) #include // For jmp_buf static jmp_buf env_unsup_insn; static void handler_unsup_insn ( Int x ) { __builtin_longjmp(env_unsup_insn,1); } +#endif + /* Helper function for VG_(machine_get_hwcaps), assumes the SIGILL/etc * handlers are installed. Determines the the sizes affected by dcbz @@ -399,11 +399,12 @@ static void handler_unsup_insn ( Int x ) { __builtin_longjmp(env_unsup_insn,1); * Not very defensive: assumes that as long as the dcbz/dcbzl * instructions don't raise a SIGILL, that they will zero an aligned, * contiguous block of memory of a sensible size. */ +#if defined(VGA_ppc32) || defined(VGA_ppc64) static void find_ppc_dcbz_sz(VexArchInfo *arch_info) { Int dcbz_szB = 0; Int dcbzl_szB; -#define MAX_DCBZL_SZB (128) /* largest known effect of dcbzl */ +# define MAX_DCBZL_SZB (128) /* largest known effect of dcbzl */ char test_block[4*MAX_DCBZL_SZB]; char *aligned = test_block; Int i; @@ -449,9 +450,15 @@ static void find_ppc_dcbz_sz(VexArchInfo *arch_info) VG_(debugLog)(1, "machine", "dcbz_szB=%d dcbzl_szB=%d\n", dcbz_szB, dcbzl_szB); +# undef MAX_DCBZL_SZB } -#undef MAX_DCBZL_SZB -#endif +#endif /* defined(VGA_ppc32) || defined(VGA_ppc64) */ + + + +/* Determine what insn set and insn set variant the host has, and + record it. To be called once at system startup. Returns False if + this a CPU incapable of running Valgrind. */ Bool VG_(machine_get_hwcaps)( void ) {