Sort out the current file inclusion relationship of uadk, and adjust the inclusion order of some header files.
Changes v3 -> v4: Rebase on wd_comp_init2 patches.
Changes v2 -> v3: Update file relationship diagram
Changes v1 -> v2: adjust the content of wd_alg_common.h
liulongfang (3): uadk: Remove duplicate header files uadk: adjust header file include logic uadk: adjust the position of some functions
Makefile.am | 6 +- docs/uadk_file_relationship.svg | 41 +++++++ drv/hisi_comp.c | 1 - drv/hisi_sec.c | 4 - include/drv/wd_aead_drv.h | 3 +- include/drv/wd_cipher_drv.h | 4 +- include/drv/wd_comp_drv.h | 4 +- include/drv/wd_dh_drv.h | 3 +- include/drv/wd_digest_drv.h | 3 +- include/drv/wd_ecc_drv.h | 2 +- include/drv/wd_rsa_drv.h | 1 + include/hisi_qm_udrv.h | 3 +- include/wd.h | 192 +++++++++----------------------- include/wd_aead.h | 2 - include/wd_alg_common.h | 66 +---------- include/wd_cipher.h | 1 - include/wd_common.h | 16 ++- include/wd_comp.h | 2 +- include/wd_dh.h | 5 - include/wd_digest.h | 1 - include/wd_ecc.h | 1 - include/wd_rsa.h | 4 - include/wd_util.h | 144 +++++++++++++++++++++++- libwd.map | 10 -- wd.c | 136 +--------------------- wd_aead.c | 1 - wd_cipher.c | 1 - wd_comp.c | 3 - wd_dh.c | 2 - wd_digest.c | 1 - wd_ecc.c | 1 - wd_rsa.c | 3 +- wd_util.c | 129 ++++++++++++++++++++- 33 files changed, 397 insertions(+), 399 deletions(-) create mode 100644 docs/uadk_file_relationship.svg
In the current UADK software framework, because each module owner processes the code separately when editing the code, the header file inclusion processing during editing is not perfect, and there are repeatedly included header files, which need to be deleted.
Signed-off-by: liulongfang liulongfang@huawei.com --- drv/hisi_comp.c | 1 - drv/hisi_sec.c | 4 ---- include/drv/wd_aead_drv.h | 3 +-- include/drv/wd_cipher_drv.h | 4 ++-- include/drv/wd_comp_drv.h | 4 ++-- include/drv/wd_dh_drv.h | 3 ++- include/drv/wd_digest_drv.h | 3 +-- include/drv/wd_ecc_drv.h | 2 +- include/drv/wd_rsa_drv.h | 1 + include/wd_aead.h | 1 - include/wd_cipher.h | 1 - include/wd_comp.h | 2 +- include/wd_dh.h | 1 - include/wd_digest.h | 1 - include/wd_ecc.h | 1 - include/wd_rsa.h | 1 - include/wd_util.h | 3 ++- wd_aead.c | 1 - wd_cipher.c | 1 - wd_comp.c | 3 --- wd_dh.c | 2 -- wd_digest.c | 1 - wd_ecc.c | 1 - wd_rsa.c | 3 +-- wd_util.c | 1 - 25 files changed, 14 insertions(+), 35 deletions(-)
diff --git a/drv/hisi_comp.c b/drv/hisi_comp.c index c940c3f..2eede39 100644 --- a/drv/hisi_comp.c +++ b/drv/hisi_comp.c @@ -4,7 +4,6 @@ #include <asm/types.h> #include "drv/wd_comp_drv.h" #include "hisi_qm_udrv.h" -#include "wd.h"
#define ZLIB 0 #define GZIP 1 diff --git a/drv/hisi_sec.c b/drv/hisi_sec.c index 5b676e9..c30b653 100644 --- a/drv/hisi_sec.c +++ b/drv/hisi_sec.c @@ -8,10 +8,6 @@ #include "../include/drv/wd_digest_drv.h" #include "../include/drv/wd_aead_drv.h" #include "hisi_qm_udrv.h" -#include "wd_cipher.h" -#include "wd_digest.h" -#include "wd_aead.h" -#include "wd.h"
#define SEC_DIGEST_ALG_OFFSET 11 #define WORD_ALIGNMENT_MASK 0x3 diff --git a/include/drv/wd_aead_drv.h b/include/drv/wd_aead_drv.h index de4a7d7..7c657f6 100644 --- a/include/drv/wd_aead_drv.h +++ b/include/drv/wd_aead_drv.h @@ -4,9 +4,8 @@ #ifndef __WD_AEAD_DRV_H #define __WD_AEAD_DRV_H
-#include "../wd_common.h" -#include "../wd_alg_common.h" #include "../wd_aead.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/drv/wd_cipher_drv.h b/include/drv/wd_cipher_drv.h index f2417a8..82fb89a 100644 --- a/include/drv/wd_cipher_drv.h +++ b/include/drv/wd_cipher_drv.h @@ -5,9 +5,9 @@ #define __WD_CIPHER_DRV_H
#include <asm/types.h> -#include "../wd_common.h" -#include "../wd_alg_common.h" + #include "../wd_cipher.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/drv/wd_comp_drv.h b/include/drv/wd_comp_drv.h index 4c37116..4aeaee4 100644 --- a/include/drv/wd_comp_drv.h +++ b/include/drv/wd_comp_drv.h @@ -6,9 +6,9 @@
#include <pthread.h> #include <asm/types.h> -#include "../wd_common.h" -#include "../wd_alg_common.h" + #include "../wd_comp.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/drv/wd_dh_drv.h b/include/drv/wd_dh_drv.h index 57f774d..64144e1 100644 --- a/include/drv/wd_dh_drv.h +++ b/include/drv/wd_dh_drv.h @@ -5,8 +5,9 @@ #define __WD_DH_DRV_H
#include <asm/types.h> -#include "../wd_alg_common.h" + #include "../wd_dh.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/drv/wd_digest_drv.h b/include/drv/wd_digest_drv.h index 7ba1c30..586588b 100644 --- a/include/drv/wd_digest_drv.h +++ b/include/drv/wd_digest_drv.h @@ -3,9 +3,8 @@ #ifndef __WD_DIGEST_DRV_H #define __WD_DIGEST_DRV_H
-#include "../wd_common.h" -#include "../wd_alg_common.h" #include "../wd_digest.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/drv/wd_ecc_drv.h b/include/drv/wd_ecc_drv.h index ddf5e5b..4d27ccb 100644 --- a/include/drv/wd_ecc_drv.h +++ b/include/drv/wd_ecc_drv.h @@ -7,8 +7,8 @@ #include <stdint.h> #include <asm/types.h>
-#include "../wd.h" #include "../wd_ecc.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/drv/wd_rsa_drv.h b/include/drv/wd_rsa_drv.h index 108c2a3..baf112f 100644 --- a/include/drv/wd_rsa_drv.h +++ b/include/drv/wd_rsa_drv.h @@ -6,6 +6,7 @@ #include <asm/types.h>
#include "../wd_rsa.h" +#include "../wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/wd_aead.h b/include/wd_aead.h index 3be8e8a..47c496f 100644 --- a/include/wd_aead.h +++ b/include/wd_aead.h @@ -9,7 +9,6 @@
#include <dlfcn.h> #include "config.h" -#include "wd.h" #include "wd_alg_common.h" #include "wd_cipher.h" #include "wd_digest.h" diff --git a/include/wd_cipher.h b/include/wd_cipher.h index dfd6e60..8e69852 100644 --- a/include/wd_cipher.h +++ b/include/wd_cipher.h @@ -8,7 +8,6 @@ #define __WD_CIPHER_H
#include <dlfcn.h> -#include "wd.h" #include "wd_alg_common.h"
#ifdef __cplusplus diff --git a/include/wd_comp.h b/include/wd_comp.h index a0b83eb..782e5d2 100644 --- a/include/wd_comp.h +++ b/include/wd_comp.h @@ -8,7 +8,7 @@ #define __WD_COMP_H
#include <numa.h> -#include "wd.h" + #include "wd_alg_common.h"
#ifdef __cplusplus diff --git a/include/wd_dh.h b/include/wd_dh.h index f342722..1c72228 100644 --- a/include/wd_dh.h +++ b/include/wd_dh.h @@ -9,7 +9,6 @@
#include <stdbool.h>
-#include "wd.h" #include "wd_alg_common.h"
#ifdef __cplusplus diff --git a/include/wd_digest.h b/include/wd_digest.h index eb764ce..a44328e 100644 --- a/include/wd_digest.h +++ b/include/wd_digest.h @@ -8,7 +8,6 @@ #define __WD_DIGEST_H #include <dlfcn.h>
-#include "wd.h" #include "wd_alg_common.h"
#ifdef __cplusplus diff --git a/include/wd_ecc.h b/include/wd_ecc.h index 05a776d..a92bb4b 100644 --- a/include/wd_ecc.h +++ b/include/wd_ecc.h @@ -10,7 +10,6 @@ #include <stdlib.h> #include <errno.h>
-#include "wd.h" #include "wd_alg_common.h"
#ifdef __cplusplus diff --git a/include/wd_rsa.h b/include/wd_rsa.h index ef7a12c..70e3b05 100644 --- a/include/wd_rsa.h +++ b/include/wd_rsa.h @@ -9,7 +9,6 @@
#include <stdbool.h>
-#include "wd.h" #include "wd_alg_common.h"
#ifdef __cplusplus diff --git a/include/wd_util.h b/include/wd_util.h index a51a35d..d4b2814 100644 --- a/include/wd_util.h +++ b/include/wd_util.h @@ -12,7 +12,8 @@ #include <sys/ipc.h> #include <sys/shm.h> #include <asm/types.h> -#include "wd_alg_common.h" + +#include "wd_sched.h"
#ifdef __cplusplus extern "C" { diff --git a/wd_aead.c b/wd_aead.c index 69980ea..471cb65 100644 --- a/wd_aead.c +++ b/wd_aead.c @@ -6,7 +6,6 @@
#include <stdlib.h> #include <pthread.h> -#include "wd_util.h" #include "include/drv/wd_aead_drv.h" #include "wd_aead.h"
diff --git a/wd_cipher.c b/wd_cipher.c index ea998ae..b627c0d 100644 --- a/wd_cipher.c +++ b/wd_cipher.c @@ -7,7 +7,6 @@ #include <stdlib.h> #include <pthread.h> #include <sched.h> -#include "wd_util.h" #include "include/drv/wd_cipher_drv.h" #include "wd_cipher.h"
diff --git a/wd_comp.c b/wd_comp.c index 28fcbd3..cd938d9 100644 --- a/wd_comp.c +++ b/wd_comp.c @@ -12,10 +12,7 @@ #include <string.h> #include <time.h>
-#include "config.h" #include "drv/wd_comp_drv.h" -#include "wd_sched.h" -#include "wd_util.h" #include "wd_comp.h"
#define WD_POOL_MAX_ENTRIES 1024 diff --git a/wd_dh.c b/wd_dh.c index 1a9a6d6..74dbca0 100644 --- a/wd_dh.c +++ b/wd_dh.c @@ -12,10 +12,8 @@ #include <time.h> #include <dlfcn.h>
-#include "config.h" #include "include/drv/wd_dh_drv.h" #include "wd_util.h" -#include "wd_dh.h"
#define WD_POOL_MAX_ENTRIES 1024 #define DH_MAX_KEY_SIZE 512 diff --git a/wd_digest.c b/wd_digest.c index d49b2ab..ceecb6a 100644 --- a/wd_digest.c +++ b/wd_digest.c @@ -6,7 +6,6 @@
#include <stdlib.h> #include <pthread.h> -#include "wd_util.h" #include "include/drv/wd_digest_drv.h" #include "wd_digest.h"
diff --git a/wd_ecc.c b/wd_ecc.c index d27d43f..7fd632e 100644 --- a/wd_ecc.c +++ b/wd_ecc.c @@ -13,7 +13,6 @@ #include <time.h> #include <dlfcn.h>
-#include "wd_util.h" #include "include/drv/wd_ecc_drv.h" #include "include/wd_ecc_curve.h" #include "wd_ecc.h" diff --git a/wd_rsa.c b/wd_rsa.c index 6fd7a6a..a3b856a 100644 --- a/wd_rsa.c +++ b/wd_rsa.c @@ -12,9 +12,8 @@ #include <time.h> #include <dlfcn.h>
-#include "config.h" #include "include/drv/wd_rsa_drv.h" -#include "wd_util.h" +#include "wd_rsa.h"
#define WD_POOL_MAX_ENTRIES 1024 #define WD_HW_EACCESS 62 diff --git a/wd_util.c b/wd_util.c index 8fed8ac..433dd56 100644 --- a/wd_util.c +++ b/wd_util.c @@ -9,7 +9,6 @@ #include <semaphore.h> #include <string.h> #include <ctype.h> -#include "wd_alg_common.h" #include "wd_sched.h" #include "wd_util.h"
Adjust the header file inclusion logic to ensure that the data structures used internally are not exposed to the outside world.
Clarify the file relationship diagram of UADK, follow-up UADK framework evolution, continue to ensure that the logic of the basic file inclusion relationship is reasonable.
Signed-off-by: liulongfang liulongfang@huawei.com --- docs/uadk_file_relationship.svg | 41 ++++++++++++++++++++ drv/hisi_qm_udrv.c | 1 + include/hisi_qm_udrv.h | 3 +- include/wd.h | 55 +++++++++++++++++++++++++-- include/wd_aead.h | 1 - include/wd_alg_common.h | 66 ++------------------------------- include/wd_dh.h | 4 -- include/wd_rsa.h | 3 -- include/wd_util.h | 16 ++++++++ wd.c | 1 - 10 files changed, 115 insertions(+), 76 deletions(-) create mode 100644 docs/uadk_file_relationship.svg
diff --git a/docs/uadk_file_relationship.svg b/docs/uadk_file_relationship.svg new file mode 100644 index 0000000..da17de3 --- /dev/null +++ b/docs/uadk_file_relationship.svg @@ -0,0 +1,41 @@ +<svg height="2391" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 2255 2391" xmlns:ev="http://www.w3.org/2001/xml-events" width="2255" xmlns="http://www.w3.org/2000/svg"><style type="text/css"> +<![CDATA[.st1 {fill:#ffffff;font-family:微软雅黑;font-size:12pt}]]></style><defs/><g id="page1" transform="translate(5,5)"><rect height="2381" x="0" y="0" width="2245" fill="#fcfcfc" stroke="#808080"/> +<g id="shape1" transform="translate(1353.04,864.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="58" y="33.5">wd.h</tspan></text></g><g id="shape2" transform="translate(776.41,864.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#ff0000" stroke="#ff0000"/> +<text class="st1"><tspan x="42" y="33.5">wd_util.h</tspan></text></g><g id="shape3" transform="translate(1600.65,689.53)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="49" y="33.3">wd.c</tspan></text></g><g id="shape4" transform="translate(1505.04,892.03)"><path d="M0,0L93.5,-170.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M95.6,-174.7L90.5,-171.6C91.5,-171.6,92.6,-171.4,93.5,-170.8C94.5,-170.3,95.2,-169.6,95.8,-168.7L95.6,-174.7" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape5" transform="translate(1353.04,986.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#ff0000" stroke="#ff0000"/> +<text class="st1"><tspan x="5" y="33.5">wd_alg_common.h</tspan></text></g><g id="shape6" transform="translate(578.04,864.39)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="33" y="33.3">wd_util.c</tspan></text></g><g id="shape7" transform="translate(1429.04,920.03)"><path d="M0,0L0,61.6" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M0,66L3,60.8C2.1,61.3,1.1,61.6,0,61.6C-1.1,61.6,-2.1,61.3,-3,60.8L0,66" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape8" transform="translate(776.41,892.03)"><path d="M0,0L-62,.2" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M-66.4,.2L-61.2,3.2C-61.7,2.3,-62,1.3,-62,.2C-62,-0.9,-61.7,-2,-61.2,-2.8L-66.4,.2" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape9" transform="translate(1179.04,558.62)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="32" y="33.5">wd_sched.h</tspan></text></g><g id="shape10" transform="translate(1387.41,586.26)"><path d="M0,0L-535,0L-535,273.4" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M-535,277.8L-532,272.6C-532.9,273.1,-533.9,273.4,-535,273.4C-536.1,273.4,-537.1,273.1,-538,272.6L-535,277.8" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape11" transform="translate(1600.65,558.98)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="23" y="33.3">wd_sched.c</tspan></text></g><g id="shape12" transform="translate(1331.04,586.62)"><path d="M0,0L265.2,.2" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M269.6,.2L264.4,-2.8C264.9,-1.9,265.2,-0.9,265.2,.2C265.2,1.3,264.9,2.3,264.4,3.2L269.6,.2" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape13" transform="translate(1600.65,1163.71)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="27" y="33.3">wd_aead.c</tspan></text></g><g id="shape14" transform="translate(1600.65,1250.21)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="22" y="33.3">wd_cipher.c</tspan></text></g><g id="shape15" transform="translate(1600.65,1344.24)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="22" y="33.3">wd_digest.c</tspan></text></g><g id="shape16" transform="translate(1600.65,1473.39)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="24" y="33.3">wd_comp.c</tspan></text></g><g id="shape17" transform="translate(1600.65,1592.39)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="34" y="33.3">wd_rsa.c</tspan></text></g><g id="shape18" transform="translate(1600.65,1676.38)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="35" y="33.3">wd_dh.c</tspan></text></g><g id="shape19" transform="translate(1600.65,1803.38)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="33" y="33.3">wd_ecc.c</tspan></text></g><g id="shape20" transform="translate(1600.65,926.62)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="9" y="33.3">wd_mempool.c</tspan></text></g><g id="shape21" transform="translate(1505.04,892.03)"><path d="M0,0L91.9,60" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M95.6,62.4L92.9,57.1C92.9,58.1,92.5,59.1,91.9,60C91.3,60.9,90.5,61.6,89.6,62.1L95.6,62.4" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape22" transform="matrix(1,0.08,-0.08,1,1066.2,1148)"><path d="M0,0C139,23.4,402.7,23.7,531.9,.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M536.2,0L530.6,-2C531.2,-1.2,531.7,-0.3,531.9,.8C532.1,1.9,532,2.9,531.6,3.9L536.2,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape23" transform="translate(1179.04,1120.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="36" y="33.5">wd_aead.h</tspan></text></g><g id="shape24" transform="translate(914.22,1120.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="20" y="33.5">wd_aead_drv.h</tspan></text></g><g id="shape25" transform="translate(1179.04,1242.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="31" y="33.5">wd_cipher.h</tspan></text></g><g id="shape26" transform="translate(914.22,1242.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="15" y="33.5">wd_cipher_drv.h</tspan></text></g><g id="shape27" transform="matrix(1,0.01,-0.01,1,1066.2,1270)"><path d="M0,0C99.9,35.3,363.4,35.6,530.2,.9" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M534.5,0L528.8,-1.9C529.5,-1.1,530,-0.2,530.2,.9C530.4,2,530.3,3,530,4L534.5,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape28" transform="translate(1179.04,1331.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="31" y="33.5">wd_digest.h</tspan></text></g><g id="shape29" transform="translate(914.22,1331.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="16" y="33.5">wd_digest_drv.h</tspan></text></g><g id="shape30" transform="matrix(1,0.02,-0.02,1,1066.2,1359)"><path d="M0,0C47,42.1,311.1,42.4,530.3,.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M534.6,0L528.9,-2C529.6,-1.2,530.1,-0.2,530.3,.8C530.5,1.9,530.4,3,530.1,3.9L534.6,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape31" transform="translate(1179.04,1432.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="33" y="33.5">wd_comp.h</tspan></text></g><g id="shape32" transform="translate(914.22,1432.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="17" y="33.5">wd_comp_drv.h</tspan></text></g><g id="shape33" transform="matrix(1,0.08,-0.08,1,1066.2,1460)"><path d="M0,0C89.8,39,354.3,39.3,531.7,.9" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M536,0L530.3,-1.8C531,-1.1,531.5,-0.1,531.7,.9C532,2,531.9,3.1,531.6,4L536,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape34" transform="translate(252.54,864.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="45" y="33.5">config.h</tspan></text></g><g id="shape35" transform="matrix(0.99,0.15,-0.15,0.99,1331,1460)"><path d="M0,0C62.8,-15.6,195.1,-15.9,268.4,-0.9" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M272.7,0L268.3,-4C268.6,-3,268.7,-2,268.4,-0.9C268.2,.2,267.7,1.1,267,1.9L272.7,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape36" transform="matrix(1,0.05,-0.05,1,1331,1359)"><path d="M0,0C75.4,-17.2,205.9,-17.6,265.7,-1.2" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M269.9,0L265.8,-4.3C266,-3.3,266,-2.3,265.7,-1.2C265.4,-0.2,264.8,.7,264.1,1.4L269.9,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape37" transform="translate(1179.04,1148.03)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape38" transform="translate(914.22,1558.22)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="28" y="33.5">wd_rsa_drv.h</tspan></text></g><g id="shape39" transform="matrix(1,0.06,-0.06,1,1066.2,1586.2)"><path d="M0,0C-2,33.7,262.9,33.9,531.2,.5" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M535.5,0L530,-2.3C530.6,-1.5,531,-0.5,531.2,.5C531.3,1.6,531.1,2.7,530.7,3.6L535.5,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape40" transform="translate(1179.04,1647.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="44" y="33.5">wd_dh.h</tspan></text></g><g id="shape41" transform="matrix(0.99,0.11,-0.11,0.99,1331,1675)"><path d="M0,0C83.2,-17.8,213.9,-18.3,267,-1.4" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M271.2,0L267.2,-4.5C267.4,-3.5,267.4,-2.5,267,-1.4C266.7,-0.4,266.1,.5,265.3,1.2L271.2,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape42" transform="translate(914.22,1647.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="29" y="33.5">wd_dh_drv.h</tspan></text></g><g id="shape43" transform="matrix(1,0,-0,1,990.2,1703)"><path d="M0,0C151.2,24.5,452.1,24.8,606.1,.7" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M610.4,0L604.8,-2.1C605.5,-1.4,605.9,-0.4,606.1,.7C606.3,1.8,606.1,2.8,605.8,3.8L610.4,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape44" transform="translate(1179.04,1768.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="42" y="33.5">wd_ecc.h</tspan></text></g><g id="shape45" transform="translate(914.22,1768.03)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="26" y="33.5">wd_ecc_drv.h</tspan></text></g><g id="shape46" transform="translate(1179.04,1874.32)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="18" y="33.5">wd_ecc_curve.h</tspan></text></g><g id="shape47" transform="matrix(1,0.01,-0.01,1,990.2,1824)"><path d="M0,0C131.2,39.7,432.6,40,606.2,1" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M610.5,0L604.7,-1.8C605.4,-1,606,-0.1,606.2,1C606.4,2,606.4,3.1,606.1,4.1L610.5,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape48" transform="matrix(0.99,0.13,-0.13,0.99,1331,1796)"><path d="M0,0C63.2,-15.7,195.1,-16,267.6,-0.9" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M271.9,0L267.5,-4C267.8,-3.1,267.8,-2,267.6,-0.9C267.4,.1,266.9,1.1,266.2,1.8L271.9,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape49" transform="matrix(0.97,-0.26,0.26,0.97,1331,1902.3)"><path d="M0,0C76,19.6,211,20,274.6,1.3" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M278.8,0L273,-1.3C273.7,-0.6,274.3,.3,274.6,1.3C275,2.3,275,3.4,274.8,4.4L278.8,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><path d="M0,0L0,702.3" id="shape50" fill="none" stroke="#ff0000" transform="translate(1429.04,1042.03)" stroke-width="4"/><g id="shape51" transform="translate(1429.02,1082.37)"><path d="M0,0L-174,0L-174,33.3" fill="none" stroke="#ff0000"/><path d="M-174,37.7L-171,32.5C-171.9,33,-172.9,33.3,-174,33.3C-175.1,33.3,-176.1,33,-177,32.5L-174,37.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape52" transform="matrix(0,-1,1,0,1179,1359)"><path d="M0,0C39.1,-31.4,141.2,-32,207,-1.9" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M211,0L207.6,-4.9C207.7,-3.9,207.5,-2.9,207,-1.9C206.6,-0.9,205.9,-0.1,205,.5L211,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape53" transform="matrix(0,-1,1,0,1179,1270)"><path d="M0,0C29.2,-13.4,86.4,-14,118,-1.7" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M122,0L118.4,-4.8C118.5,-3.8,118.4,-2.7,118,-1.7C117.5,-0.7,116.9,.1,116,.7L122,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape54" transform="translate(1429.02,1205.37)"><path d="M0,0L-174,0L-174,32.3" fill="none" stroke="#ff0000"/><path d="M-174,36.7L-171,31.5C-171.9,32,-172.9,32.3,-174,32.3C-175.1,32.3,-176.1,32,-177,31.5L-174,36.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape55" transform="matrix(0.99,0.16,-0.16,0.99,1331,1148)"><path d="M0,0C91,-20.1,222.3,-20.7,269.1,-1.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M273.1,0L269.6,-4.8C269.7,-3.8,269.5,-2.8,269.1,-1.8C268.6,-0.8,268,0,267.1,.6L273.1,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape56" transform="translate(1430.02,1314.37)"><path d="M0,0L-175,0L-175,12.3" fill="none" stroke="#ff0000"/><path d="M-175,16.7L-172,11.5C-172.9,12,-173.9,12.3,-175,12.3C-176.1,12.3,-177.1,12,-178,11.5L-175,16.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape57" transform="translate(1428.02,1414.37)"><path d="M0,0L-173,0L-173,13.3" fill="none" stroke="#ff0000"/><path d="M-173,17.7L-170,12.5C-170.9,13,-171.9,13.3,-173,13.3C-174.1,13.3,-175.1,13,-176,12.5L-173,17.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape58" transform="translate(1430.02,1628.37)"><path d="M0,0L-175,0L-175,14.3" fill="none" stroke="#ff0000"/><path d="M-175,18.7L-172,13.5C-172.9,14,-173.9,14.3,-175,14.3C-176.1,14.3,-177.1,14,-178,13.5L-175,18.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape59" transform="translate(1429.04,1744.37)"><path d="M0,0L-174,0L-174,19.3" fill="none" stroke="#ff0000"/><path d="M-174,23.7L-171,18.5C-171.9,19,-172.9,19.3,-174,19.3C-175.1,19.3,-176.1,19,-177,18.5L-174,23.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape60" transform="translate(1179.04,1270.03)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape61" transform="translate(1179.04,1359.03)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape62" transform="translate(1179.04,1460.03)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape63" transform="translate(1179.04,1675.03)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape64" transform="translate(1179.04,1796.03)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape65" transform="translate(252.54,1067.68)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="20" y="33.5">hisi_qm_udrv.h</tspan></text></g><g id="shape66" transform="translate(578.04,1067.68)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="11" y="33.3">hisi_qm_udrv.c</tspan></text></g><g id="shape67" transform="matrix(0,1,-1,0,252.5,892)"><path d="M0,0C50,58.4,148.9,59.5,200.7,3.3" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#92d050"/><path d="M203.6,0L198,1.9C199,2.1,199.9,2.6,200.7,3.3C201.5,4,202.1,4.9,202.4,5.9L203.6,0" stroke-linecap="round" fill="#92d050" stroke="#92d050" stroke-width="1"/></g><g id="shape68" transform="translate(853.19,1014.08)"><path d="M0,0L-524.7,0L-524.7,49.2" fill="none" stroke="#ff0000"/><path d="M-524.7,53.6L-521.7,48.4C-522.5,48.9,-523.6,49.2,-524.7,49.2C-525.7,49.2,-526.8,48.9,-527.7,48.4L-524.7,53.6" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape69" transform="matrix(1,-0,0,1,404.5,1095.7)"><path d="M0,0C42,0,124.5,0,169.1,0" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M173.5,0L168.3,-3C168.8,-2.1,169.1,-1.1,169.1,0C169.1,1.1,168.8,2.1,168.3,3L173.5,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape70" transform="translate(1353.04,762.15)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="47" y="33.5">uacce.h</tspan></text></g><g id="shape71" transform="translate(1429.04,818.15)"><path d="M0,0L0,41.5" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M0,45.9L3,40.7C2.1,41.2,1.1,41.5,0,41.5C-1.1,41.5,-2.1,41.2,-3,40.7L0,45.9" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape72" transform="translate(578.04,1432.39)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="23" y="33.3">hisi_comp.c</tspan></text></g><g id="shape73" transform="translate(578.04,1250.21)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="32" y="33.3">hisi_sec.c</tspan></text></g><g id="shape74" transform="translate(578.04,1676.38)"><path d="M120.7,55.6C126.9,55.6,132,50.6,132,44.3L132,11.3C132,5.1,126.9,0,120.7,0L11.3,0C5.1,0,0,5.1,0,11.3L0,44.3C0,50.6,5.1,55.6,11.3,55.6L120.7,55.6z" fill="#f5aa22" stroke="#f5aa22"/> +<text class="st1"><tspan x="27" y="33.3">hisi_hpre.c</tspan></text></g><g id="shape75" transform="matrix(-1,0,-0,-1,914.2,1460)"><path d="M0,0C49.6,0,147.5,0,199.8,0" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M204.2,0L199,-3C199.5,-2.1,199.8,-1.1,199.8,0C199.8,1.1,199.5,2.1,199,3L204.2,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape76" transform="matrix(0.6,0.8,-0.8,0.6,328.5,1123.7)"><path d="M0,0C118,29.2,322.9,29.6,414.8,1.3" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M418.9,0L413.1,-1.3C413.8,-0.6,414.4,.3,414.8,1.3C415.1,2.4,415.1,3.4,414.9,4.4L418.9,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape77" transform="matrix(-1,0.04,-0.04,-1,914.2,1270)"><path d="M0,0C49.7,0,147.6,0,199.9,0" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M204.3,0L199.1,-3C199.7,-2.1,199.9,-1.1,199.9,0C199.9,1.1,199.7,2.1,199.1,3L204.3,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape78" transform="matrix(-0.93,-0.37,0.37,-0.93,914.2,1359)"><path d="M0,0C50.7,-24.7,156.7,-25.3,215.6,-1.7" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M219.7,0L216,-4.8C216.2,-3.8,216,-2.7,215.6,-1.7C215.2,-0.7,214.5,.2,213.7,.8L219.7,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape79" transform="matrix(-0.84,0.54,-0.54,-0.84,914.2,1148)"><path d="M0,0C56.2,27.7,173.4,28.2,238,1.7" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M242.1,0L236.1,-0.7C236.9,-0.1,237.6,.7,238,1.7C238.4,2.7,238.6,3.8,238.5,4.8L242.1,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape80" transform="matrix(0.85,0.53,-0.53,0.85,328.5,1123.7)"><path d="M0,0C71.9,0,214.3,0,289,0" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M293.4,0L288.2,-3C288.7,-2.1,289,-1.1,289,0C289,1.1,288.7,2.1,288.2,3L293.4,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape81" transform="matrix(0.39,0.92,-0.92,0.39,328.5,1123.7)"><path d="M0,0C148.9,73.9,461,74.5,627.9,1.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M631.9,0L625.9,-0.6C626.7,-0,627.4,.8,627.9,1.8C628.3,2.8,628.4,3.8,628.3,4.8L631.9,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape82" transform="matrix(-0.99,0.14,-0.14,-0.99,914.2,1675)"><path d="M0,0C50.1,0,149,0,201.9,0" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M206.3,0L201.1,-3C201.6,-2.1,201.9,-1.1,201.9,0C201.9,1.1,201.6,2.1,201.1,3L206.3,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape83" transform="matrix(-0.87,0.5,-0.5,-0.87,914.2,1586.2)"><path d="M0,0C52.6,30.6,166.8,31.3,231.8,1.9" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M235.8,0L229.8,-0.5C230.7,.1,231.4,.9,231.8,1.9C232.3,2.9,232.5,3.9,232.4,4.9L235.8,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape84" transform="matrix(-0.91,-0.41,0.41,-0.91,914.2,1796)"><path d="M0,0C55.4,-25.6,163.4,-26.2,219.9,-1.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M223.9,0L220.4,-4.9C220.5,-3.9,220.3,-2.8,219.9,-1.8C219.4,-0.8,218.7,-0,217.9,.6L223.9,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape85" transform="translate(1179.04,1558.22)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#6dc7df" stroke="#6dc7df"/> +<text class="st1"><tspan x="43" y="33.5">wd_rsa.h</tspan></text></g><g id="shape86" transform="translate(1179.04,1586.22)"><path d="M0,0L-108.4,0" stroke-dasharray="11,5,11,5,2.5,5" fill="none" stroke="#00b050"/><path d="M-112.8,0L-107.6,3C-108.1,2.1,-108.4,1.1,-108.4,0C-108.4,-1.1,-108.1,-2.1,-107.6,-3L-112.8,0" stroke-linecap="round" fill="#00b050" stroke="#00b050" stroke-width="1"/></g><g id="shape87" transform="translate(1430.02,1535.37)"><path d="M0,0L-175,0L-175,18.5" fill="none" stroke="#ff0000"/><path d="M-175,22.9L-172,17.7C-172.9,18.2,-173.9,18.5,-175,18.5C-176.1,18.5,-177.1,18.2,-178,17.7L-175,22.9" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape88" transform="matrix(0.99,0.13,-0.13,0.99,1331,1586.2)"><path d="M0,0C76.2,-19.9,207.6,-20.4,267.6,-1.4" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M271.8,0L267.8,-4.5C268,-3.5,267.9,-2.4,267.6,-1.4C267.2,-0.4,266.6,.5,265.9,1.2L271.8,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><path d="M0,0L0,832.3" id="shape89" fill="none" stroke="#ff0000" transform="translate(852.41,920.03)" stroke-width="4"/><g id="shape90" transform="translate(853.41,1752.37)"><path d="M0,0L136.8,0L136.8,11.3" fill="none" stroke="#ff0000"/><path d="M136.8,15.7L139.8,10.5C138.9,11,137.9,11.3,136.8,11.3C135.7,11.3,134.7,11,133.8,10.5L136.8,15.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape91" transform="translate(853.41,1631.37)"><path d="M0,0L136.8,0L136.8,11.3" fill="none" stroke="#ff0000"/><path d="M136.8,15.7L139.8,10.5C138.9,11,137.9,11.3,136.8,11.3C135.7,11.3,134.7,11,133.8,10.5L136.8,15.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape92" transform="translate(853.41,1542.56)"><path d="M0,0L136.8,0L136.8,11.3" fill="none" stroke="#ff0000"/><path d="M136.8,15.7L139.8,10.5C138.9,11,137.9,11.3,136.8,11.3C135.7,11.3,134.7,11,133.8,10.5L136.8,15.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape93" transform="translate(853.41,1416.37)"><path d="M0,0L136.8,0L136.8,11.3" fill="none" stroke="#ff0000"/><path d="M136.8,15.7L139.8,10.5C138.9,11,137.9,11.3,136.8,11.3C135.7,11.3,134.7,11,133.8,10.5L136.8,15.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape94" transform="translate(853.41,1315.37)"><path d="M0,0L136.8,0L136.8,11.3" fill="none" stroke="#ff0000"/><path d="M136.8,15.7L139.8,10.5C138.9,11,137.9,11.3,136.8,11.3C135.7,11.3,134.7,11,133.8,10.5L136.8,15.7" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape95" transform="translate(853.19,1212.9)"><path d="M0,0L137,0L137,24.7" fill="none" stroke="#ff0000"/><path d="M137,29.1L140,23.9C139.1,24.4,138.1,24.7,137,24.7C135.9,24.7,134.9,24.4,134,23.9L137,29.1" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape96" transform="translate(853.19,1095.26)"><path d="M0,0L137,0L137,20.4" fill="none" stroke="#ff0000"/><path d="M137,24.8L140,19.6C139.1,20.1,138.1,20.4,137,20.4C135.9,20.4,134.9,20.1,134,19.6L137,24.8" stroke-linecap="round" fill="#ff0000" stroke="#ff0000" stroke-width="1"/></g><g id="shape97" transform="matrix(1,0.03,-0.03,1,1331,1270)"><path d="M0,0C89.9,-20.1,219.5,-20.7,265.7,-1.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#00b0f0"/><path d="M269.7,0L266.2,-4.9C266.3,-3.8,266.2,-2.8,265.7,-1.8C265.3,-0.8,264.6,0,263.8,.6L269.7,0" stroke-linecap="round" fill="#00b0f0" stroke="#00b0f0" stroke-width="1"/></g><g id="shape98" transform="translate(914.22,689.17)"><path d="M28,56L124,56C139.5,56,152,43.5,152,28C152,12.5,139.5,0,124,0L28,0C12.5,0,0,12.5,0,28C0,43.5,12.5,56,28,56z" fill="#7030a0" stroke="#7030a0"/> +<text class="st1"><tspan x="20" y="33.5">wd_common.h</tspan></text></g><g id="shape99" transform="translate(914.22,717.17)"><path d="M0,0L-270.2,-0.5L-270.2,142.8" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M-270.2,147.2L-267.2,142C-268.1,142.5,-269.1,142.8,-270.2,142.8C-271.3,142.8,-272.3,142.5,-273.2,142L-270.2,147.2" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape100" transform="translate(1066.22,717.17)"><path d="M0,0L530,.2" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M534.4,.2L529.2,-2.8C529.8,-1.9,530,-0.9,530,.2C530,1.3,529.8,2.3,529.2,3.2L534.4,.2" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g><g id="shape101" transform="translate(1353.04,1014.03)"><path d="M0,0L-98,0L-98,-395" stroke-dasharray="11,5,2.5,5" fill="none" stroke="#6dc7df"/><path d="M-98,-399.4L-101,-394.2C-100.1,-394.7,-99.1,-395,-98,-395C-96.9,-395,-95.9,-394.7,-95,-394.2L-98,-399.4" stroke-linecap="round" fill="#6dc7df" stroke="#6dc7df" stroke-width="1"/></g></g></svg> \ No newline at end of file diff --git a/drv/hisi_qm_udrv.c b/drv/hisi_qm_udrv.c index 6647840..a3b5dc1 100644 --- a/drv/hisi_qm_udrv.c +++ b/drv/hisi_qm_udrv.c @@ -8,6 +8,7 @@ #include <sys/mman.h>
#include "hisi_qm_udrv.h" +#include "wd_util.h"
#define QM_DBELL_CMD_SQ 0 #define QM_DBELL_CMD_CQ 1 diff --git a/include/hisi_qm_udrv.h b/include/hisi_qm_udrv.h index dda320d..32f8183 100644 --- a/include/hisi_qm_udrv.h +++ b/include/hisi_qm_udrv.h @@ -10,8 +10,7 @@ #include <linux/types.h>
#include "config.h" -#include "wd.h" -#include "wd_alg_common.h" +#include "wd_util.h"
#ifdef __cplusplus extern "C" { diff --git a/include/wd.h b/include/wd.h index facd992..136d661 100644 --- a/include/wd.h +++ b/include/wd.h @@ -30,6 +30,13 @@ extern "C" { #define WD_CTX_CNT_NUM 1024 #define WD_IPC_KEY 0x500011
+/* Required compiler attributes */ +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + +#define handle_t uintptr_t +typedef struct wd_dev_mask wd_dev_mask_t; + typedef void (*wd_log)(const char *format, ...);
#ifndef WD_NO_LOG @@ -91,7 +98,12 @@ typedef void (*wd_log)(const char *format, ...); #define WD_IS_ERR(h) ((uintptr_t)(h) > \ (uintptr_t)(-1000))
-enum wcrypto_type { +enum wd_buff_type { + WD_FLAT_BUF, + WD_SGL_BUF, +}; + +enum wd_alg_type { WD_CIPHER, WD_DIGEST, WD_AEAD, @@ -136,8 +148,11 @@ struct wd_dev_mask { unsigned int magic; };
-#define handle_t uintptr_t -typedef struct wd_dev_mask wd_dev_mask_t; +struct wd_datalist { + void *data; + __u32 len; + struct wd_datalist *next; +};
#if defined(__AARCH64_CMODEL_SMALL__) && __AARCH64_CMODEL_SMALL__ #define dsb(opt) { asm volatile("dsb " #opt : : : "memory"); } @@ -190,6 +205,40 @@ static inline long WD_PTR_ERR(const void *ptr) return (long)ptr; }
+enum wd_ctx_mode { + CTX_MODE_SYNC = 0, + CTX_MODE_ASYNC, + CTX_MODE_MAX, +}; + +/** + * struct wd_ctx - Define one ctx and related type. + * @ctx: The ctx itself. + * @op_type: Define the operation type of this specific ctx. + * e.g. 0: compression; 1: decompression. + * @ctx_mode: Define this ctx is used for synchronization of asynchronization + * 1: synchronization; 0: asynchronization; + */ +struct wd_ctx { + handle_t ctx; + __u8 op_type; + __u8 ctx_mode; +}; + +/** + * struct wd_ctx_config - Define a ctx set and its related attributes, which + * will be used in the scope of current process. + * @ctx_num: The ctx number in below ctx array. + * @ctxs: Point to a ctx array, length is above ctx_num. + * @priv: The attributes of ctx defined by user, which is used by user + * defined scheduler. + */ +struct wd_ctx_config { + __u32 ctx_num; + struct wd_ctx *ctxs; + void *priv; +}; + /** * wd_request_ctx() - Request a communication context from a device. * @dev: Indicate one device. diff --git a/include/wd_aead.h b/include/wd_aead.h index 47c496f..ba7d062 100644 --- a/include/wd_aead.h +++ b/include/wd_aead.h @@ -8,7 +8,6 @@ #define __WD_AEAD_H
#include <dlfcn.h> -#include "config.h" #include "wd_alg_common.h" #include "wd_cipher.h" #include "wd_digest.h" diff --git a/include/wd_alg_common.h b/include/wd_alg_common.h index 96e908f..7a9b739 100644 --- a/include/wd_alg_common.h +++ b/include/wd_alg_common.h @@ -10,17 +10,15 @@ #include <pthread.h> #include <stdbool.h> #include "wd.h" -#include "wd_common.h"
#ifdef __cplusplus extern "C" { #endif
-/* Required compiler attributes */ -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) +#define BYTE_BITS 8 +#define BYTE_BITS_SHIFT 3 +#define GET_NEGATIVE(val) (0 - (val))
-#define BYTE_BITS_SHIFT 3 #define BITS_TO_BYTES(bits) (((bits) + 7) >> 3) #define BYTES_TO_BITS(bytes) ((bytes) << 3)
@@ -29,40 +27,6 @@ extern "C" { #define CTX_TYPE_INVALID 9999 #define POLL_TIME 1000
-enum wd_ctx_mode { - CTX_MODE_SYNC = 0, - CTX_MODE_ASYNC, - CTX_MODE_MAX, -}; - -/** - * struct wd_ctx - Define one ctx and related type. - * @ctx: The ctx itself. - * @op_type: Define the operation type of this specific ctx. - * e.g. 0: compression; 1: decompression. - * @ctx_mode: Define this ctx is used for synchronization of asynchronization - * 1: synchronization; 0: asynchronization; - */ -struct wd_ctx { - handle_t ctx; - __u8 op_type; - __u8 ctx_mode; -}; - -/** - * struct wd_ctx_config - Define a ctx set and its related attributes, which - * will be used in the scope of current process. - * @ctx_num: The ctx number in below ctx array. - * @ctxs: Point to a ctx array, length is above ctx_num. - * @priv: The attributes of ctx defined by user, which is used by user - * defined scheduler. - */ -struct wd_ctx_config { - __u32 ctx_num; - struct wd_ctx *ctxs; - void *priv; -}; - /** * struct wd_ctx_nums - Define the ctx sets numbers. * @sync_ctx_num: The ctx numbers which are used for sync mode for each @@ -90,27 +54,11 @@ struct wd_ctx_params { struct bitmask *bmp; };
-struct wd_ctx_internal { - handle_t ctx; - __u8 op_type; - __u8 ctx_mode; - pthread_spinlock_t lock; -}; - -struct wd_ctx_config_internal { - __u32 ctx_num; - struct wd_ctx_internal *ctxs; - void *priv; - int pid; - bool epoll_en; - unsigned long *msg_cnt; -}; - /** * struct wd_comp_sched - Define a scheduler. * @name: Name of this scheduler. * @sched_policy: Method for scheduler to perform scheduling - * @sched_init: inited the scheduler input parameters. + * @sched_init: inited the scheduler input parameters. * @pick_next_ctx: Pick the proper ctx which a request will be sent to. * config points to the ctx config; sched_ctx points to * scheduler context; req points to the request. Return @@ -131,12 +79,6 @@ struct wd_sched { handle_t h_sched_ctx; };
-struct wd_datalist { - void *data; - __u32 len; - struct wd_datalist *next; -}; - #ifdef __cplusplus } #endif diff --git a/include/wd_dh.h b/include/wd_dh.h index 1c72228..3912680 100644 --- a/include/wd_dh.h +++ b/include/wd_dh.h @@ -15,10 +15,6 @@ extern "C" { #endif
-#define BYTE_BITS 8 -#define BYTE_BITS_SHIFT 3 -#define GET_NEGATIVE(val) (0 - (val)) - typedef void (*wd_dh_cb_t)(void *cb_param);
enum wd_dh_op_type { diff --git a/include/wd_rsa.h b/include/wd_rsa.h index 70e3b05..e16171f 100644 --- a/include/wd_rsa.h +++ b/include/wd_rsa.h @@ -15,13 +15,10 @@ extern "C" { #endif
-#define BYTE_BITS 8 -#define BYTE_BITS_SHIFT 3 #define CRT_PARAMS_SZ(key_size) ((5 * (key_size)) >> 1) #define CRT_GEN_PARAMS_SZ(key_size) ((7 * (key_size)) >> 1) #define GEN_PARAMS_SZ(key_size) ((key_size) << 1) #define CRT_PARAM_SZ(key_size) ((key_size) >> 1) -#define GET_NEGATIVE(val) (0 - (val))
typedef void (*wd_rsa_cb_t)(void *cb_param);
diff --git a/include/wd_util.h b/include/wd_util.h index d4b2814..9b581d4 100644 --- a/include/wd_util.h +++ b/include/wd_util.h @@ -19,6 +19,22 @@ extern "C" { #endif
+struct wd_ctx_internal { + handle_t ctx; + __u8 op_type; + __u8 ctx_mode; + pthread_spinlock_t lock; +}; + +struct wd_ctx_config_internal { + __u32 ctx_num; + struct wd_ctx_internal *ctxs; + void *priv; + int pid; + bool epoll_en; + unsigned long *msg_cnt; +}; + #define FOREACH_NUMA(i, config, config_numa) \ for ((i) = 0, (config_numa) = (config)->config_per_numa; \ (i) < (config)->numa_num; (config_numa)++, (i)++) diff --git a/wd.c b/wd.c index 9eb69d2..629c0df 100644 --- a/wd.c +++ b/wd.c @@ -18,7 +18,6 @@ #include <numa.h> #include <sched.h>
-#include "wd_alg_common.h" #include "wd.h"
#define SYS_CLASS_DIR "/sys/class/uacce"
These functions are all operation functions for the device, and they are only called in the device driver and do not need to be presented to the user APP. Therefore, move them to the internal public file wd_util.c
Signed-off-by: liulongfang liulongfang@huawei.com --- Makefile.am | 6 +- drv/hisi_qm_udrv.c | 1 - include/wd.h | 137 -------------------------------------------- include/wd_common.h | 16 +++++- include/wd_util.h | 125 ++++++++++++++++++++++++++++++++++++++++ libwd.map | 10 ---- wd.c | 135 +------------------------------------------ wd_util.c | 128 ++++++++++++++++++++++++++++++++++++++++- 8 files changed, 269 insertions(+), 289 deletions(-)
diff --git a/Makefile.am b/Makefile.am index c4957bc..d831e37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,7 +65,7 @@ libwd_comp_la_SOURCES=wd_comp.c wd_comp.h wd_comp_drv.h wd_util.c wd_util.h \ wd_sched.c wd_sched.h wd.c wd.h
libhisi_zip_la_SOURCES=drv/hisi_comp.c hisi_comp.h drv/hisi_qm_udrv.c \ - hisi_qm_udrv.h wd_comp_drv.h + hisi_qm_udrv.h wd_util.c wd_util.h wd_comp_drv.h
libwd_crypto_la_SOURCES=wd_cipher.c wd_cipher.h wd_cipher_drv.h \ wd_aead.c wd_aead.h wd_aead_drv.h \ @@ -78,10 +78,10 @@ libwd_crypto_la_SOURCES=wd_cipher.c wd_cipher.h wd_cipher_drv.h \ wd.c wd.h
libhisi_sec_la_SOURCES=drv/hisi_sec.c drv/hisi_qm_udrv.c \ - hisi_qm_udrv.h wd_cipher_drv.h wd_aead_drv.h + hisi_qm_udrv.h wd_util.c wd_util.h wd_cipher_drv.h wd_aead_drv.h
libhisi_hpre_la_SOURCES=drv/hisi_hpre.c drv/hisi_qm_udrv.c \ - hisi_qm_udrv.h wd_hpre_drv.h + hisi_qm_udrv.h wd_util.c wd_util.h wd_hpre_drv.h if WD_STATIC_DRV AM_CFLAGS += -DWD_STATIC_DRV AM_CFLAGS += -DWD_NO_LOG diff --git a/drv/hisi_qm_udrv.c b/drv/hisi_qm_udrv.c index a3b5dc1..6647840 100644 --- a/drv/hisi_qm_udrv.c +++ b/drv/hisi_qm_udrv.c @@ -8,7 +8,6 @@ #include <sys/mman.h>
#include "hisi_qm_udrv.h" -#include "wd_util.h"
#define QM_DBELL_CMD_SQ 0 #define QM_DBELL_CMD_CQ 1 diff --git a/include/wd.h b/include/wd.h index 136d661..c2dddfb 100644 --- a/include/wd.h +++ b/include/wd.h @@ -154,47 +154,6 @@ struct wd_datalist { struct wd_datalist *next; };
-#if defined(__AARCH64_CMODEL_SMALL__) && __AARCH64_CMODEL_SMALL__ -#define dsb(opt) { asm volatile("dsb " #opt : : : "memory"); } -#define rmb() dsb(ld) /* read fence */ -#define wmb() dsb(st) /* write fence */ -#define mb() dsb(sy) /* rw fence */ -#else -#define rmb() __sync_synchronize() /* read fence */ -#define wmb() __sync_synchronize() /* write fence */ -#define mb() __sync_synchronize() /* rw fence */ -#endif - -static inline uint32_t wd_ioread32(void *addr) -{ - uint32_t ret; - - ret = *((volatile uint32_t *)addr); - rmb(); - return ret; -} - -static inline uint64_t wd_ioread64(void *addr) -{ - uint64_t ret; - - ret = *((volatile uint64_t *)addr); - rmb(); - return ret; -} - -static inline void wd_iowrite32(void *addr, uint32_t value) -{ - wmb(); - *((volatile uint32_t *)addr) = value; -} - -static inline void wd_iowrite64(void *addr, uint64_t value) -{ - wmb(); - *((volatile uint64_t *)addr) = value; -} - static inline void *WD_ERR_PTR(uintptr_t error) { return (void *)error; @@ -260,81 +219,6 @@ handle_t wd_request_ctx(struct uacce_dev *dev); */ void wd_release_ctx(handle_t h_ctx);
-/** - * wd_ctx_start() - Start a context. - * @h_ctx: The handle of context which will be started. - * - * Return 0 if successful or less than 0 otherwise. - * - * Context will be started after calling this function. If necessary resource - * (e.g. MMIO and DUS) already got, tasks can be received by context. - */ -int wd_ctx_start(handle_t h_ctx); - -/** - * wd_release_ctx_force() - Release a context forcely. - * @h_ctx: The handle of context which will be released. - * - * Return 0 if successful or less than 0 otherwise. - * - * Context will be stopped and related hardware will be released, which avoids - * release delay in wd_release_ctx(). After calling this function, context - * related hardware resource will be released, however, fd is still there. - * wd_release_ctx mush be used to release context finally, other APIs about - * context can not work with this context after calling wd_release_ctx_force. - */ -int wd_release_ctx_force(handle_t h_ctx); - -/** - * wd_ctx_set_priv() - Store some information in context. - * @h_ctx: The handle of context. - * @priv: The pointer of memory which stores above information. - * - * Return 0 if successful or less than 0 otherwise. - */ -int wd_ctx_set_priv(handle_t h_ctx, void *priv); - -/** - * wd_ctx_get_priv() - Get stored information in context. - * @h_ctx: The handle of context. - * - * Return pointer of memory of stored information if successful or NULL - * otherwise. - */ -void *wd_ctx_get_priv(handle_t h_ctx); - -/** - * wd_ctx_get_api() - Get api string of context. - * @h_ctx: The handle of context. - * - * Return api string or NULL otherwise. - * - * This function is a wrapper of reading /sys/class/uacce/<dev>/api, which is - * used to define api version between user space and kernel driver. - */ -char *wd_ctx_get_api(handle_t h_ctx); - -/** - * wd_ctx_mmap_qfr() - Map and get the base address of one context region. - * @h_ctx: The handle of context. - * @qfrt: Name of context region, which could be got in kernel head file - * include/uapi/misc/uacce/uacce.h - * - * Return pointer of context region if successful or NULL otherwise. - * - * Normally, UACCE_QFRT_MMIO is for MMIO registers of one context, - * UACCE_QFRT_DUS is for task communication memory of one context. - */ -void *wd_ctx_mmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt); - -/** - * wd_ctx_unmap_qfr() - Unmap one context region. - * @h_ctx: The handle of context. - * @qfrt: Name of context region, which could be got in kernel head file - * include/uapi/misc/uacce/uacce.h. - */ -void wd_ctx_unmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt); - /** * wd_ctx_wait() - Wait task in context finished. * @h_ctx: The handle of context. @@ -425,27 +309,6 @@ struct uacce_dev *wd_get_accel_dev(const char *alg_name); */ void wd_free_list_accels(struct uacce_dev_list *list);
-/** - * wd_ctx_set_io_cmd() - Send ioctl command to context. - * @h_ctx: The handle of context. - * @cmd: ioctl command which could be found in Linux kernel head file, - * include/uapi/misc/uacce/uacce.h, hisi_qm.h... - * @arg: Command output buffer if some information will be got from kernel or - * NULL otherwise. - * - * This function is a wrapper of ioctl. - */ -int wd_ctx_set_io_cmd(handle_t h_ctx, unsigned long cmd, void *arg); - -/** - * wd_ctx_get_region_size() - Get region offset size - * @h_ctx: The handle of context. - * @qfrt: Name of context region, which could be got in kernel head file - * include/uapi/misc/uacce/uacce.h - * Return device region size. - */ -unsigned long wd_ctx_get_region_size(handle_t h_ctx, enum uacce_qfrt qfrt); - enum wd_page_type { WD_HUGE_PAGE = 0, WD_NORMAL_PAGE, diff --git a/include/wd_common.h b/include/wd_common.h index 91dd066..941179c 100644 --- a/include/wd_common.h +++ b/include/wd_common.h @@ -7,13 +7,23 @@ #ifndef __WD_COMMON_H #define __WD_COMMON_H
+#include "uacce.h" + #ifdef __cplusplus extern "C" { #endif
-enum wd_buff_type { - WD_FLAT_BUF, - WD_SGL_BUF, +#define MAX_DEV_NAME_LEN 256 + +struct wd_ctx_h { + int fd; + char dev_path[MAX_DEV_NAME_LEN]; + char *dev_name; + char *drv_name; + unsigned long qfrs_offs[UACCE_QFRT_MAX]; + void *qfrs_base[UACCE_QFRT_MAX]; + struct uacce_dev *dev; + void *priv; };
#ifdef __cplusplus diff --git a/include/wd_util.h b/include/wd_util.h index 9b581d4..0e47496 100644 --- a/include/wd_util.h +++ b/include/wd_util.h @@ -19,6 +19,131 @@ extern "C" { #endif
+#if defined(__AARCH64_CMODEL_SMALL__) && __AARCH64_CMODEL_SMALL__ +#define dsb(opt) { asm volatile("dsb " #opt : : : "memory"); } +#define rmb() dsb(ld) /* read fence */ +#define wmb() dsb(st) /* write fence */ +#define mb() dsb(sy) /* rw fence */ +#else +#define rmb() __sync_synchronize() /* read fence */ +#define wmb() __sync_synchronize() /* write fence */ +#define mb() __sync_synchronize() /* rw fence */ +#endif + +static inline uint32_t wd_ioread32(void *addr) +{ + uint32_t ret; + + ret = *((volatile uint32_t *)addr); + rmb(); + return ret; +} + +static inline uint64_t wd_ioread64(void *addr) +{ + uint64_t ret; + + ret = *((volatile uint64_t *)addr); + rmb(); + return ret; +} + +static inline void wd_iowrite32(void *addr, uint32_t value) +{ + wmb(); + *((volatile uint32_t *)addr) = value; +} + +static inline void wd_iowrite64(void *addr, uint64_t value) +{ + wmb(); + *((volatile uint64_t *)addr) = value; +} + +/** + * wd_ctx_start() - Start a context. + * @h_ctx: The handle of context which will be started. + * + * Return 0 if successful or less than 0 otherwise. + * + * Context will be started after calling this function. If necessary resource + * (e.g. MMIO and DUS) already got, tasks can be received by context. + */ +int wd_ctx_start(handle_t h_ctx); + +/** + * wd_release_ctx_force() - Release a context forcely. + * @h_ctx: The handle of context which will be released. + * + * Return 0 if successful or less than 0 otherwise. + * + * Context will be stopped and related hardware will be released, which avoids + * release delay in wd_release_ctx(). After calling this function, context + * related hardware resource will be released, however, fd is still there. + * wd_release_ctx mush be used to release context finally, other APIs about + * context can not work with this context after calling wd_release_ctx_force. + */ +int wd_release_ctx_force(handle_t h_ctx); + +/** + * wd_ctx_set_priv() - Store some information in context. + * @h_ctx: The handle of context. + * @priv: The pointer of memory which stores above information. + * + * Return 0 if successful or less than 0 otherwise. + */ +int wd_ctx_set_priv(handle_t h_ctx, void *priv); + +/** + * wd_ctx_get_priv() - Get stored information in context. + * @h_ctx: The handle of context. + * + * Return pointer of memory of stored information if successful or NULL + * otherwise. + */ +void *wd_ctx_get_priv(handle_t h_ctx); + +/** + * wd_ctx_get_api() - Get api string of context. + * @h_ctx: The handle of context. + * + * Return api string or NULL otherwise. + * + * This function is a wrapper of reading /sys/class/uacce/<dev>/api, which is + * used to define api version between user space and kernel driver. + */ +char *wd_ctx_get_api(handle_t h_ctx); + +/** + * wd_ctx_mmap_qfr() - Map and get the base address of one context region. + * @h_ctx: The handle of context. + * @qfrt: Name of context region, which could be got in kernel head file + * include/uapi/misc/uacce/uacce.h + * + * Return pointer of context region if successful or NULL otherwise. + * + * Normally, UACCE_QFRT_MMIO is for MMIO registers of one context, + * UACCE_QFRT_DUS is for task communication memory of one context. + */ +void *wd_ctx_mmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt); + +/** + * wd_ctx_unmap_qfr() - Unmap one context region. + * @h_ctx: The handle of context. + * @qfrt: Name of context region, which could be got in kernel head file + * include/uapi/misc/uacce/uacce.h. + */ +void wd_ctx_unmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt); + +/** + * wd_ctx_get_region_size() - Get region offset size + * @h_ctx: The handle of context. + * @qfrt: Name of context region, which could be got in kernel head file + * include/uapi/misc/uacce/uacce.h + * Return device region size. + */ +unsigned long wd_ctx_get_region_size(handle_t h_ctx, enum uacce_qfrt qfrt); + struct wd_ctx_internal { handle_t ctx; __u8 op_type; diff --git a/libwd.map b/libwd.map index 459f9ba..335a8fc 100644 --- a/libwd.map +++ b/libwd.map @@ -2,7 +2,6 @@ UADK_2.0 { global: wd_request_ctx; wd_release_ctx; - wd_ctx_get_api; wd_ctx_wait; wd_is_sva; wd_is_isolate; @@ -12,15 +11,6 @@ global: wd_get_accel_list; wd_get_accel_dev; wd_free_list_accels; - - wd_release_ctx_force; - wd_ctx_set_priv; - wd_ctx_get_priv; - wd_ctx_start; - wd_ctx_mmap_qfr; - wd_ctx_unmap_qfr; - wd_ctx_set_io_cmd; - wd_ctx_get_region_size; wd_ctx_get_dev_name;
wd_block_alloc; diff --git a/wd.c b/wd.c index 629c0df..d86ce35 100644 --- a/wd.c +++ b/wd.c @@ -12,13 +12,12 @@ #include <stdbool.h> #include <stdlib.h> #include <string.h> -#include <sys/ioctl.h> -#include <sys/mman.h> #include <sys/stat.h> #include <numa.h> #include <sched.h>
#include "wd.h" +#include "wd_common.h"
#define SYS_CLASS_DIR "/sys/class/uacce"
@@ -31,17 +30,6 @@ enum UADK_LOG_LEVEL {
static int uadk_log_level;
-struct wd_ctx_h { - int fd; - char dev_path[MAX_DEV_NAME_LEN]; - char *dev_name; - char *drv_name; - unsigned long qfrs_offs[UACCE_QFRT_MAX]; - void *qfrs_base[UACCE_QFRT_MAX]; - struct uacce_dev *dev; - void *priv; -}; - static void wd_parse_log_level(void) { const char *syslog_file = "/etc/rsyslog.conf"; @@ -440,114 +428,6 @@ void wd_release_ctx(handle_t h_ctx) free(ctx); }
-int wd_ctx_start(handle_t h_ctx) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - int ret; - - if (!ctx) - return -WD_EINVAL; - - ret = wd_ctx_set_io_cmd(h_ctx, UACCE_CMD_START, NULL); - if (ret) - WD_ERR("failed to start on %s (%d), ret = %d!\n", - ctx->dev_path, -errno, ret); - - return ret; -} - -int wd_release_ctx_force(handle_t h_ctx) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - int ret; - - if (!ctx) - return -WD_EINVAL; - - ret = wd_ctx_set_io_cmd(h_ctx, UACCE_CMD_PUT_Q, NULL); - if (ret) - WD_ERR("failed to stop on %s (%d), ret = %d!\n", - ctx->dev_path, -errno, ret); - - return ret; -} - -void *wd_ctx_mmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - off_t off = qfrt * getpagesize(); - size_t size; - void *addr; - - if (!ctx || qfrt >= UACCE_QFRT_MAX || !ctx->qfrs_offs[qfrt]) { - WD_ERR("failed to check input ctx or qfrt!\n"); - return NULL; - } - - size = ctx->qfrs_offs[qfrt]; - - addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, ctx->fd, off); - if (addr == MAP_FAILED) { - WD_ERR("failed to mmap, qfrt = %d, err = %d!\n", qfrt, -errno); - return NULL; - } - - ctx->qfrs_base[qfrt] = addr; - - return addr; -} - -void wd_ctx_unmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - - if (!ctx || qfrt >= UACCE_QFRT_MAX) - return; - - if (ctx->qfrs_offs[qfrt] != 0) - munmap(ctx->qfrs_base[qfrt], ctx->qfrs_offs[qfrt]); -} - -unsigned long wd_ctx_get_region_size(handle_t h_ctx, enum uacce_qfrt qfrt) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - if (!ctx || qfrt >= UACCE_QFRT_MAX) - return 0; - return ctx->qfrs_offs[qfrt]; -} - -void *wd_ctx_get_priv(handle_t h_ctx) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - - if (!ctx) - return NULL; - - return ctx->priv; -} - -int wd_ctx_set_priv(handle_t h_ctx, void *priv) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - - if (!ctx) - return -WD_EINVAL; - - ctx->priv = priv; - - return 0; -} - -char *wd_ctx_get_api(handle_t h_ctx) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - - if (!ctx || !ctx->dev) - return NULL; - - return ctx->dev->api; -} - int wd_ctx_wait(handle_t h_ctx, __u16 ms) { struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; @@ -808,19 +688,6 @@ struct uacce_dev *wd_get_accel_dev(const char *alg_name) return target; }
-int wd_ctx_set_io_cmd(handle_t h_ctx, unsigned long cmd, void *arg) -{ - struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; - - if (!ctx) - return -WD_EINVAL; - - if (!arg) - return ioctl(ctx->fd, cmd); - - return ioctl(ctx->fd, cmd, arg); -} - struct bitmask *wd_create_device_nodemask(struct uacce_dev_list *list) { struct uacce_dev_list *p; diff --git a/wd_util.c b/wd_util.c index 433dd56..0aa412c 100644 --- a/wd_util.c +++ b/wd_util.c @@ -8,9 +8,12 @@ #include <pthread.h> #include <semaphore.h> #include <string.h> +#include <sys/ioctl.h> +#include <sys/mman.h> #include <ctype.h> -#include "wd_sched.h" + #include "wd_util.h" +#include "wd_common.h"
#define WD_ASYNC_DEF_POLL_NUM 1 #define WD_ASYNC_DEF_QUEUE_DEPTH 1024 @@ -64,6 +67,129 @@ struct async_task_queue { int (*alg_poll_ctx)(__u32, __u32, __u32 *); };
+int wd_ctx_set_io_cmd(handle_t h_ctx, unsigned long cmd, void *arg) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + + if (!ctx) + return -WD_EINVAL; + + if (!arg) + return ioctl(ctx->fd, cmd); + + return ioctl(ctx->fd, cmd, arg); +} + +int wd_ctx_start(handle_t h_ctx) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + int ret; + + if (!ctx) + return -WD_EINVAL; + + ret = wd_ctx_set_io_cmd(h_ctx, UACCE_CMD_START, NULL); + if (ret) + WD_ERR("failed to start on %s (%d), ret = %d!\n", + ctx->dev_path, -errno, ret); + + return ret; +} + +int wd_release_ctx_force(handle_t h_ctx) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + int ret; + + if (!ctx) + return -WD_EINVAL; + + ret = wd_ctx_set_io_cmd(h_ctx, UACCE_CMD_PUT_Q, NULL); + if (ret) + WD_ERR("failed to stop on %s (%d), ret = %d!\n", + ctx->dev_path, -errno, ret); + + return ret; +} + +void *wd_ctx_mmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + off_t off = qfrt * getpagesize(); + size_t size; + void *addr; + + if (!ctx || qfrt >= UACCE_QFRT_MAX || !ctx->qfrs_offs[qfrt]) { + WD_ERR("failed to check input ctx or qfrt!\n"); + return NULL; + } + + size = ctx->qfrs_offs[qfrt]; + + addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, ctx->fd, off); + if (addr == MAP_FAILED) { + WD_ERR("failed to mmap, qfrt = %d, err = %d!\n", qfrt, -errno); + return NULL; + } + + ctx->qfrs_base[qfrt] = addr; + + return addr; +} + +void wd_ctx_unmap_qfr(handle_t h_ctx, enum uacce_qfrt qfrt) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + + if (!ctx || qfrt >= UACCE_QFRT_MAX) + return; + + if (ctx->qfrs_offs[qfrt] != 0) + munmap(ctx->qfrs_base[qfrt], ctx->qfrs_offs[qfrt]); +} + +unsigned long wd_ctx_get_region_size(handle_t h_ctx, enum uacce_qfrt qfrt) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + + if (!ctx || qfrt >= UACCE_QFRT_MAX) + return 0; + + return ctx->qfrs_offs[qfrt]; +} + +void *wd_ctx_get_priv(handle_t h_ctx) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + + if (!ctx) + return NULL; + + return ctx->priv; +} + +int wd_ctx_set_priv(handle_t h_ctx, void *priv) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + + if (!ctx) + return -WD_EINVAL; + + ctx->priv = priv; + + return 0; +} + +char *wd_ctx_get_api(handle_t h_ctx) +{ + struct wd_ctx_h *ctx = (struct wd_ctx_h *)h_ctx; + + if (!ctx || !ctx->dev) + return NULL; + + return ctx->dev->api; +} + static void clone_ctx_to_internal(struct wd_ctx *ctx, struct wd_ctx_internal *ctx_in) {