VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.7/include/crypto/riscv_arch.h@ 107278

最後變更 在這個檔案從107278是 104078,由 vboxsync 提交於 11 月 前

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

檔案大小: 1.7 KB
 
1/*
2 * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_CRYPTO_RISCV_ARCH_H
11# define OSSL_CRYPTO_RISCV_ARCH_H
12
13# include <ctype.h>
14# include <stdint.h>
15
16# define RISCV_DEFINE_CAP(NAME, INDEX, BIT_INDEX) +1
17extern uint32_t OPENSSL_riscvcap_P[ ((
18# include "riscv_arch.def"
19) + sizeof(uint32_t) - 1) / sizeof(uint32_t) ];
20
21# ifdef OPENSSL_RISCVCAP_IMPL
22# define RISCV_DEFINE_CAP(NAME, INDEX, BIT_INDEX) +1
23uint32_t OPENSSL_riscvcap_P[ ((
24# include "riscv_arch.def"
25) + sizeof(uint32_t) - 1) / sizeof(uint32_t) ];
26# endif
27
28# define RISCV_DEFINE_CAP(NAME, INDEX, BIT_INDEX) \
29 static inline int RISCV_HAS_##NAME(void) \
30 { \
31 return (OPENSSL_riscvcap_P[INDEX] & (1 << BIT_INDEX)) != 0; \
32 }
33# include "riscv_arch.def"
34
35struct RISCV_capability_s {
36 const char *name;
37 size_t index;
38 size_t bit_offset;
39};
40
41# define RISCV_DEFINE_CAP(NAME, INDEX, BIT_INDEX) +1
42extern const struct RISCV_capability_s RISCV_capabilities[
43# include "riscv_arch.def"
44];
45
46# ifdef OPENSSL_RISCVCAP_IMPL
47# define RISCV_DEFINE_CAP(NAME, INDEX, BIT_INDEX) \
48 { #NAME, INDEX, BIT_INDEX },
49const struct RISCV_capability_s RISCV_capabilities[] = {
50# include "riscv_arch.def"
51};
52# endif
53
54# define RISCV_DEFINE_CAP(NAME, INDEX, BIT_INDEX) +1
55static const size_t kRISCVNumCaps =
56# include "riscv_arch.def"
57;
58
59#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette