From 34a9056f39fd864fcb0fd26573d11775f28a98d7 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Sun, 19 Apr 2009 21:17:09 +0000 Subject: [PATCH] - POLARSSL_HAVE_ASM also used in padlock and timing code. --- ChangeLog | 2 ++ include/polarssl/padlock.h | 2 +- library/timing.c | 17 ++++++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32d01f864..516462ee9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ PolarSSL ChangeLog load_file() * Made definition of net_htons() endian-clean for big endian systems (Found by Gernot). + * Undefining POLARSSL_HAVE_ASM now also handles prevents asm in + padlock and timing code. = Version 0.10.0 released on 2009-01-12 * Migrated XySSL to PolarSSL diff --git a/include/polarssl/padlock.h b/include/polarssl/padlock.h index 6f7a453ef..692b79215 100644 --- a/include/polarssl/padlock.h +++ b/include/polarssl/padlock.h @@ -24,7 +24,7 @@ #include "polarssl/aes.h" -#if (defined(__GNUC__) && defined(__i386__)) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) #ifndef POLARSSL_HAVE_X86 #define POLARSSL_HAVE_X86 diff --git a/library/timing.c b/library/timing.c index 107b639e4..b6ecbf6c8 100644 --- a/library/timing.c +++ b/library/timing.c @@ -51,7 +51,8 @@ struct _hr_time #endif -#if (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) +#if defined(POLARSSL_HAVE_ASM) && \ + (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) unsigned long hardclock( void ) { @@ -62,7 +63,7 @@ unsigned long hardclock( void ) } #else -#if defined(__GNUC__) && defined(__i386__) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) unsigned long hardclock( void ) { @@ -72,7 +73,8 @@ unsigned long hardclock( void ) } #else -#if defined(__GNUC__) && (defined(__amd64__) || defined(__x86_64__)) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && \ + (defined(__amd64__) || defined(__x86_64__)) unsigned long hardclock( void ) { @@ -82,7 +84,8 @@ unsigned long hardclock( void ) } #else -#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && \ + (defined(__powerpc__) || defined(__ppc__)) unsigned long hardclock( void ) { @@ -100,7 +103,7 @@ unsigned long hardclock( void ) } #else -#if defined(__GNUC__) && defined(__sparc__) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__sparc__) unsigned long hardclock( void ) { @@ -111,7 +114,7 @@ unsigned long hardclock( void ) } #else -#if defined(__GNUC__) && defined(__alpha__) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__alpha__) unsigned long hardclock( void ) { @@ -121,7 +124,7 @@ unsigned long hardclock( void ) } #else -#if defined(__GNUC__) && defined(__ia64__) +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__ia64__) unsigned long hardclock( void ) {