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 | 3 ++ 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 | 18 +++++++++ wd.c | 1 - 10 files changed, 79 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..4b6fa68 --- /dev/null +++ b/docs/uadk_file_relationship.svg @@ -0,0 +1,3 @@ +<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 b0580ba..a851cc1 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 @@ -96,7 +103,12 @@ static inline void *WD_ERR_PTR(uintptr_t error) return (void *)error; }
-enum wcrypto_type { +enum wd_buff_type { + WD_FLAT_BUF, + WD_SGL_BUF, +}; + +enum wd_alg_type { WD_CIPHER, WD_DIGEST, WD_AEAD, @@ -141,8 +153,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"); } @@ -185,6 +200,40 @@ static inline void wd_iowrite64(void *addr, uint64_t value) *((volatile uint64_t *)addr) = value; }
+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 c455dc3..5c04ad9 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,61 +27,11 @@ 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_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 @@ -104,12 +52,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 aea7a23..0ef5bdf 100644 --- a/include/wd_util.h +++ b/include/wd_util.h @@ -12,10 +12,28 @@ #include <sys/shm.h> #include <asm/types.h>
+#include "wd.h" + #ifdef __cplusplus 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 6ea17f3..048e7c1 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"