diff options
author | jsing <> | 2024-10-19 13:06:11 +0000 |
---|---|---|
committer | jsing <> | 2024-10-19 13:06:11 +0000 |
commit | ddd498e9dc3b8e01469736ea80d9583f6d3b978a (patch) | |
tree | 80abe0c72655c8ae71236c909363b30c8bb010ba /src/lib/libcrypto/arch/i386 | |
parent | d2377970fef7d1c8e41cbb1d93b5e43185f032fc (diff) | |
download | openbsd-ddd498e9dc3b8e01469736ea80d9583f6d3b978a.tar.gz openbsd-ddd498e9dc3b8e01469736ea80d9583f6d3b978a.tar.bz2 openbsd-ddd498e9dc3b8e01469736ea80d9583f6d3b978a.zip |
Remove IA32 specific code from cryptlib.c.
Move the IA32 specific code to arch/{amd64,i386}/crypto_cpu_caps.c, rather
than polluting cryptlib.c with machine dependent code. A stub version of
crypto_cpu_caps_ia32() still remains for now.
Diffstat (limited to 'src/lib/libcrypto/arch/i386')
-rw-r--r-- | src/lib/libcrypto/arch/i386/crypto_arch.h | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/arch/i386/crypto_cpu_caps.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/libcrypto/arch/i386/crypto_arch.h b/src/lib/libcrypto/arch/i386/crypto_arch.h index d566d8064a..64b2da587b 100644 --- a/src/lib/libcrypto/arch/i386/crypto_arch.h +++ b/src/lib/libcrypto/arch/i386/crypto_arch.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_arch.h,v 1.2 2024/10/18 14:44:02 jsing Exp $ */ | 1 | /* $OpenBSD: crypto_arch.h,v 1.3 2024/10/19 13:06:11 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -19,6 +19,7 @@ | |||
19 | #define HEADER_CRYPTO_ARCH_H | 19 | #define HEADER_CRYPTO_ARCH_H |
20 | 20 | ||
21 | #define HAVE_CRYPTO_CPU_CAPS_INIT | 21 | #define HAVE_CRYPTO_CPU_CAPS_INIT |
22 | #define HAVE_CRYPTO_CPU_CAPS_IA32 | ||
22 | 23 | ||
23 | #ifndef OPENSSL_NO_ASM | 24 | #ifndef OPENSSL_NO_ASM |
24 | 25 | ||
diff --git a/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c b/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c index e5b36a15cc..b0da0d636c 100644 --- a/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c +++ b/src/lib/libcrypto/arch/i386/crypto_cpu_caps.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_cpu_caps.c,v 1.1 2024/10/18 14:44:02 jsing Exp $ */ | 1 | /* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/10/19 13:06:11 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -22,7 +22,7 @@ | |||
22 | #include "x86_arch.h" | 22 | #include "x86_arch.h" |
23 | 23 | ||
24 | /* Legacy architecture specific capabilities, used by perlasm. */ | 24 | /* Legacy architecture specific capabilities, used by perlasm. */ |
25 | extern uint64_t OPENSSL_ia32cap_P; | 25 | uint64_t OPENSSL_ia32cap_P; |
26 | 26 | ||
27 | /* Machine independent CPU capabilities. */ | 27 | /* Machine independent CPU capabilities. */ |
28 | extern uint64_t crypto_cpu_caps; | 28 | extern uint64_t crypto_cpu_caps; |
@@ -112,3 +112,9 @@ crypto_cpu_caps_init(void) | |||
112 | 112 | ||
113 | OPENSSL_ia32cap_P = caps; | 113 | OPENSSL_ia32cap_P = caps; |
114 | } | 114 | } |
115 | |||
116 | uint64_t | ||
117 | crypto_cpu_caps_ia32(void) | ||
118 | { | ||
119 | return OPENSSL_ia32cap_P; | ||
120 | } | ||