diff options
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch b/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch new file mode 100644 index 0000000000..703b8c125b --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl-1.0.1e/initial-aarch64-bits.patch | |||
@@ -0,0 +1,111 @@ | |||
1 | From: Andy Polyakov <appro@openssl.org> | ||
2 | Date: Sun, 13 Oct 2013 17:15:15 +0000 (+0200) | ||
3 | Subject: Initial aarch64 bits. | ||
4 | X-Git-Url: http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=039081b80977e2a5de84e1f88f8b4d025b559956 | ||
5 | |||
6 | Initial aarch64 bits. | ||
7 | --- | ||
8 | crypto/bn/bn_lcl.h | 9 +++++++++ | ||
9 | crypto/md32_common.h | 18 ++++++++++++++++++ | ||
10 | crypto/modes/modes_lcl.h | 8 ++++++++ | ||
11 | crypto/sha/sha512.c | 13 +++++++++++++ | ||
12 | 4 files changed, 48 insertions(+) | ||
13 | |||
14 | --- a/crypto/bn/bn_lcl.h | ||
15 | +++ b/crypto/bn/bn_lcl.h | ||
16 | @@ -300,6 +300,15 @@ extern "C" { | ||
17 | : "r"(a), "r"(b)); | ||
18 | # endif | ||
19 | # endif | ||
20 | +# elif defined(__aarch64__) && defined(SIXTY_FOUR_BIT_LONG) | ||
21 | +# if defined(__GNUC__) && __GNUC__>=2 | ||
22 | +# define BN_UMULT_HIGH(a,b) ({ \ | ||
23 | + register BN_ULONG ret; \ | ||
24 | + asm ("umulh %0,%1,%2" \ | ||
25 | + : "=r"(ret) \ | ||
26 | + : "r"(a), "r"(b)); \ | ||
27 | + ret; }) | ||
28 | +# endif | ||
29 | # endif /* cpu */ | ||
30 | #endif /* OPENSSL_NO_ASM */ | ||
31 | |||
32 | --- a/crypto/md32_common.h | ||
33 | +++ b/crypto/md32_common.h | ||
34 | @@ -213,6 +213,24 @@ | ||
35 | asm ("bswapl %0":"=r"(r):"0"(r)); \ | ||
36 | *((unsigned int *)(c))=r; (c)+=4; r; }) | ||
37 | # endif | ||
38 | +# elif defined(__aarch64__) | ||
39 | +# if defined(__BYTE_ORDER__) | ||
40 | +# if defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ | ||
41 | +# define HOST_c2l(c,l) ({ unsigned int r; \ | ||
42 | + asm ("rev %w0,%w1" \ | ||
43 | + :"=r"(r) \ | ||
44 | + :"r"(*((const unsigned int *)(c))));\ | ||
45 | + (c)+=4; (l)=r; }) | ||
46 | +# define HOST_l2c(l,c) ({ unsigned int r; \ | ||
47 | + asm ("rev %w0,%w1" \ | ||
48 | + :"=r"(r) \ | ||
49 | + :"r"((unsigned int)(l)));\ | ||
50 | + *((unsigned int *)(c))=r; (c)+=4; r; }) | ||
51 | +# elif defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ | ||
52 | +# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l)) | ||
53 | +# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, (l)) | ||
54 | +# endif | ||
55 | +# endif | ||
56 | # endif | ||
57 | # endif | ||
58 | #endif | ||
59 | --- a/crypto/modes/modes_lcl.h | ||
60 | +++ b/crypto/modes/modes_lcl.h | ||
61 | @@ -29,6 +29,7 @@ typedef unsigned char u8; | ||
62 | #if defined(__i386) || defined(__i386__) || \ | ||
63 | defined(__x86_64) || defined(__x86_64__) || \ | ||
64 | defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \ | ||
65 | + defined(__aarch64__) || \ | ||
66 | defined(__s390__) || defined(__s390x__) || \ | ||
67 | ( (defined(__arm__) || defined(__arm)) && \ | ||
68 | (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ | ||
69 | @@ -53,6 +54,13 @@ typedef unsigned char u8; | ||
70 | # define BSWAP4(x) ({ u32 ret=(x); \ | ||
71 | asm ("bswapl %0" \ | ||
72 | : "+r"(ret)); ret; }) | ||
73 | +# elif defined(__aarch64__) | ||
74 | +# define BSWAP8(x) ({ u64 ret; \ | ||
75 | + asm ("rev %0,%1" \ | ||
76 | + : "=r"(ret) : "r"(x)); ret; }) | ||
77 | +# define BSWAP4(x) ({ u32 ret; \ | ||
78 | + asm ("rev %w0,%w1" \ | ||
79 | + : "=r"(ret) : "r"(x)); ret; }) | ||
80 | # elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT) | ||
81 | # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ | ||
82 | asm ("rev %0,%0; rev %1,%1" \ | ||
83 | --- a/crypto/sha/sha512.c | ||
84 | +++ b/crypto/sha/sha512.c | ||
85 | @@ -55,6 +55,7 @@ const char SHA512_version[]="SHA-512" OP | ||
86 | #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ | ||
87 | defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \ | ||
88 | defined(__s390__) || defined(__s390x__) || \ | ||
89 | + defined(__aarch64__) || \ | ||
90 | defined(SHA512_ASM) | ||
91 | #define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA | ||
92 | #endif | ||
93 | @@ -340,6 +341,18 @@ static const SHA_LONG64 K512[80] = { | ||
94 | asm ("rotrdi %0,%1,%2" \ | ||
95 | : "=r"(ret) \ | ||
96 | : "r"(a),"K"(n)); ret; }) | ||
97 | +# elif defined(__aarch64__) | ||
98 | +# define ROTR(a,n) ({ SHA_LONG64 ret; \ | ||
99 | + asm ("ror %0,%1,%2" \ | ||
100 | + : "=r"(ret) \ | ||
101 | + : "r"(a),"I"(n)); ret; }) | ||
102 | +# if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ | ||
103 | + __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ | ||
104 | +# define PULL64(x) ({ SHA_LONG64 ret; \ | ||
105 | + asm ("rev %0,%1" \ | ||
106 | + : "=r"(ret) \ | ||
107 | + : "r"(*((const SHA_LONG64 *)(&(x))))); ret; }) | ||
108 | +# endif | ||
109 | # endif | ||
110 | # elif defined(_MSC_VER) | ||
111 | # if defined(_WIN64) /* applies to both IA-64 and AMD64 */ | ||