diff options
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl/initial-aarch64-bits.patch')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl/initial-aarch64-bits.patch | 87 |
1 files changed, 54 insertions, 33 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/initial-aarch64-bits.patch b/meta/recipes-connectivity/openssl/openssl/initial-aarch64-bits.patch index 770097db78..972b367993 100644 --- a/meta/recipes-connectivity/openssl/openssl/initial-aarch64-bits.patch +++ b/meta/recipes-connectivity/openssl/openssl/initial-aarch64-bits.patch | |||
@@ -5,6 +5,9 @@ X-Git-Url: http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=039 | |||
5 | 5 | ||
6 | Initial aarch64 bits. | 6 | Initial aarch64 bits. |
7 | Upstream-Status: backport (will be included in 1.0.2) | 7 | Upstream-Status: backport (will be included in 1.0.2) |
8 | |||
9 | ported the patch to the 1.0.0m version | ||
10 | Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> 2015/03/24 | ||
8 | --- | 11 | --- |
9 | crypto/bn/bn_lcl.h | 9 +++++++++ | 12 | crypto/bn/bn_lcl.h | 9 +++++++++ |
10 | crypto/md32_common.h | 18 ++++++++++++++++++ | 13 | crypto/md32_common.h | 18 ++++++++++++++++++ |
@@ -16,10 +19,10 @@ Index: openssl-1.0.1f/crypto/bn/bn_lcl.h | |||
16 | =================================================================== | 19 | =================================================================== |
17 | --- openssl-1.0.1f.orig/crypto/bn/bn_lcl.h 2014-01-06 15:47:42.000000000 +0200 | 20 | --- openssl-1.0.1f.orig/crypto/bn/bn_lcl.h 2014-01-06 15:47:42.000000000 +0200 |
18 | +++ openssl-1.0.1f/crypto/bn/bn_lcl.h 2014-02-28 10:37:55.495979037 +0200 | 21 | +++ openssl-1.0.1f/crypto/bn/bn_lcl.h 2014-02-28 10:37:55.495979037 +0200 |
19 | @@ -300,6 +300,15 @@ | 22 | @@ -295,6 +295,15 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b, |
20 | : "r"(a), "r"(b)); | 23 | : "r"(a), "r"(b)); |
21 | # endif | 24 | # endif |
22 | # endif | 25 | # endif |
23 | +# elif defined(__aarch64__) && defined(SIXTY_FOUR_BIT_LONG) | 26 | +# elif defined(__aarch64__) && defined(SIXTY_FOUR_BIT_LONG) |
24 | +# if defined(__GNUC__) && __GNUC__>=2 | 27 | +# if defined(__GNUC__) && __GNUC__>=2 |
25 | +# define BN_UMULT_HIGH(a,b) ({ \ | 28 | +# define BN_UMULT_HIGH(a,b) ({ \ |
@@ -29,17 +32,17 @@ Index: openssl-1.0.1f/crypto/bn/bn_lcl.h | |||
29 | + : "r"(a), "r"(b)); \ | 32 | + : "r"(a), "r"(b)); \ |
30 | + ret; }) | 33 | + ret; }) |
31 | +# endif | 34 | +# endif |
32 | # endif /* cpu */ | 35 | # endif /* cpu */ |
33 | #endif /* OPENSSL_NO_ASM */ | 36 | # endif /* OPENSSL_NO_ASM */ |
34 | 37 | ||
35 | Index: openssl-1.0.1f/crypto/md32_common.h | 38 | Index: openssl-1.0.1f/crypto/md32_common.h |
36 | =================================================================== | 39 | =================================================================== |
37 | --- openssl-1.0.1f.orig/crypto/md32_common.h 2014-01-06 15:47:42.000000000 +0200 | 40 | --- openssl-1.0.1f.orig/crypto/md32_common.h 2014-01-06 15:47:42.000000000 +0200 |
38 | +++ openssl-1.0.1f/crypto/md32_common.h 2014-02-28 10:39:21.751979107 +0200 | 41 | +++ openssl-1.0.1f/crypto/md32_common.h 2014-02-28 10:39:21.751979107 +0200 |
39 | @@ -213,6 +213,24 @@ | 42 | @@ -213,6 +213,42 @@ |
40 | asm ("bswapl %0":"=r"(r):"0"(r)); \ | 43 | asm ("bswapl %0":"=r"(r):"0"(r)); \ |
41 | *((unsigned int *)(c))=r; (c)+=4; r; }) | 44 | *((unsigned int *)(c))=r; (c)+=4; r; }) |
42 | # endif | 45 | # endif |
43 | +# elif defined(__aarch64__) | 46 | +# elif defined(__aarch64__) |
44 | +# if defined(__BYTE_ORDER__) | 47 | +# if defined(__BYTE_ORDER__) |
45 | +# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ | 48 | +# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ |
@@ -58,25 +61,43 @@ Index: openssl-1.0.1f/crypto/md32_common.h | |||
58 | +# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l)) | 61 | +# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l)) |
59 | +# endif | 62 | +# endif |
60 | +# endif | 63 | +# endif |
64 | +# endif | ||
65 | +# elif defined(__aarch64__) | ||
66 | +# if defined(__BYTE_ORDER__) | ||
67 | +# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ | ||
68 | +# define HOST_c2l(c,l) ({ unsigned int r; \ | ||
69 | + asm ("rev %w0,%w1" \ | ||
70 | + :"=r"(r) \ | ||
71 | + :"r"(*((const unsigned int *)(c))));\ | ||
72 | + (c)+=4; (l)=r; }) | ||
73 | +# define HOST_l2c(l,c) ({ unsigned int r; \ | ||
74 | + asm ("rev %w0,%w1" \ | ||
75 | + :"=r"(r) \ | ||
76 | + :"r"((unsigned int)(l)));\ | ||
77 | + *((unsigned int *)(c))=r; (c)+=4; r; }) | ||
78 | +# elif defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | ||
79 | +# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l)) | ||
80 | +# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l)) | ||
81 | +# endif | ||
82 | # endif | ||
61 | # endif | 83 | # endif |
62 | # endif | 84 | # endif |
63 | #endif | ||
64 | Index: openssl-1.0.1f/crypto/modes/modes_lcl.h | 85 | Index: openssl-1.0.1f/crypto/modes/modes_lcl.h |
65 | =================================================================== | 86 | =================================================================== |
66 | --- openssl-1.0.1f.orig/crypto/modes/modes_lcl.h 2014-02-28 10:47:48.731979011 +0200 | 87 | --- openssl-1.0.1f.orig/crypto/modes/modes_lcl.h 2014-02-28 10:47:48.731979011 +0200 |
67 | +++ openssl-1.0.1f/crypto/modes/modes_lcl.h 2014-02-28 10:48:49.707978919 +0200 | 88 | +++ openssl-1.0.1f/crypto/modes/modes_lcl.h 2014-02-28 10:48:49.707978919 +0200 |
68 | @@ -29,6 +29,7 @@ | 89 | @@ -28,6 +28,7 @@ typedef unsigned char u8; |
69 | #if defined(__i386) || defined(__i386__) || \ | 90 | #if defined(__i386) || defined(__i386__) || \ |
70 | defined(__x86_64) || defined(__x86_64__) || \ | 91 | defined(__x86_64) || defined(__x86_64__) || \ |
71 | defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \ | 92 | defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \ |
72 | + defined(__aarch64__) || \ | 93 | + defined(__aarch64__) || \ |
73 | defined(__s390__) || defined(__s390x__) | 94 | defined(__s390__) || defined(__s390x__) |
74 | # undef STRICT_ALIGNMENT | 95 | # undef STRICT_ALIGNMENT |
75 | #endif | 96 | #endif |
76 | @@ -50,6 +51,13 @@ | 97 | @@ -49,6 +50,13 @@ typedef unsigned char u8; |
77 | # define BSWAP4(x) ({ u32 ret=(x); \ | 98 | # define BSWAP4(x) ({ u32 ret=(x); \ |
78 | asm ("bswapl %0" \ | 99 | asm ("bswapl %0" \ |
79 | : "+r"(ret)); ret; }) | 100 | : "+r"(ret)); ret; }) |
80 | +# elif defined(__aarch64__) | 101 | +# elif defined(__aarch64__) |
81 | +# define BSWAP8(x) ({ u64 ret; \ | 102 | +# define BSWAP8(x) ({ u64 ret; \ |
82 | + asm ("rev %0,%1" \ | 103 | + asm ("rev %0,%1" \ |
@@ -84,25 +105,25 @@ Index: openssl-1.0.1f/crypto/modes/modes_lcl.h | |||
84 | +# define BSWAP4(x) ({ u32 ret; \ | 105 | +# define BSWAP4(x) ({ u32 ret; \ |
85 | + asm ("rev %w0,%w1" \ | 106 | + asm ("rev %w0,%w1" \ |
86 | + : "=r"(ret) : "r"(x)); ret; }) | 107 | + : "=r"(ret) : "r"(x)); ret; }) |
87 | # elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT) | 108 | # elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT) |
88 | # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ | 109 | # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ |
89 | asm ("rev %0,%0; rev %1,%1" \ | 110 | asm ("rev %0,%0; rev %1,%1" \ |
90 | Index: openssl-1.0.1f/crypto/sha/sha512.c | 111 | Index: openssl-1.0.1f/crypto/sha/sha512.c |
91 | =================================================================== | 112 | =================================================================== |
92 | --- openssl-1.0.1f.orig/crypto/sha/sha512.c 2014-01-06 15:47:42.000000000 +0200 | 113 | --- openssl-1.0.1f.orig/crypto/sha/sha512.c 2014-01-06 15:47:42.000000000 +0200 |
93 | +++ openssl-1.0.1f/crypto/sha/sha512.c 2014-02-28 10:52:14.579978981 +0200 | 114 | +++ openssl-1.0.1f/crypto/sha/sha512.c 2014-02-28 10:52:14.579978981 +0200 |
94 | @@ -55,6 +55,7 @@ | 115 | @@ -55,6 +55,7 @@ const char SHA512_version[] = "SHA-512" OPENSSL_VERSION_PTEXT; |
95 | #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ | 116 | # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ |
96 | defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \ | 117 | defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \ |
97 | defined(__s390__) || defined(__s390x__) || \ | 118 | defined(__s390__) || defined(__s390x__) || \ |
98 | + defined(__aarch64__) || \ | 119 | + defined(__aarch64__) || \ |
99 | defined(SHA512_ASM) | 120 | defined(SHA512_ASM) |
100 | #define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA | 121 | # define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA |
101 | #endif | 122 | # endif |
102 | @@ -347,6 +348,18 @@ | 123 | @@ -353,6 +354,18 @@ static const SHA_LONG64 K512[80] = { |
103 | asm ("rotrdi %0,%1,%2" \ | 124 | asm ("rotrdi %0,%1,%2" \ |
104 | : "=r"(ret) \ | 125 | : "=r"(ret) \ |
105 | : "r"(a),"K"(n)); ret; }) | 126 | : "r"(a),"K"(n)); ret; }) |
106 | +# elif defined(__aarch64__) | 127 | +# elif defined(__aarch64__) |
107 | +# define ROTR(a,n) ({ SHA_LONG64 ret; \ | 128 | +# define ROTR(a,n) ({ SHA_LONG64 ret; \ |
108 | + asm ("ror %0,%1,%2" \ | 129 | + asm ("ror %0,%1,%2" \ |
@@ -115,6 +136,6 @@ Index: openssl-1.0.1f/crypto/sha/sha512.c | |||
115 | + : "=r"(ret) \ | 136 | + : "=r"(ret) \ |
116 | + : "r"(*((const SHA_LONG64 *)(&(x))))); ret; }) | 137 | + : "r"(*((const SHA_LONG64 *)(&(x))))); ret; }) |
117 | +# endif | 138 | +# endif |
118 | # endif | 139 | # endif |
119 | # elif defined(_MSC_VER) | 140 | # elif defined(_MSC_VER) |
120 | # if defined(_WIN64) /* applies to both IA-64 and AMD64 */ | 141 | # if defined(_WIN64) /* applies to both IA-64 and AMD64 */ |