Skip to content

Commit d514406

Browse files
Replace deprecated pthread_yield with sched_yield.
pthread_yield is deprecated from glibc 2.34 hence replacing it with sched_yield. Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
1 parent bb10128 commit d514406

21 files changed

+67
-66
lines changed

e_qat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
# include <unistd.h>
5252
# include <string.h>
5353
# include <semaphore.h>
54+
# include <sched.h>
5455

5556
# ifdef QAT_OPENSSL_3
5657
# include "qat_prov_err.h"

qat_hw_asym_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ int qat_mod_exp(BIGNUM *res, const BIGNUM *base, const BIGNUM *exp,
302302
loop around and try again until the request
303303
completes and we can continue. */
304304
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
305-
pthread_yield();
305+
sched_yield();
306306
} else {
307-
pthread_yield();
307+
sched_yield();
308308
}
309309
}
310310
while (!op_done.flag ||

qat_hw_chachapoly.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -955,9 +955,9 @@ static int qat_chacha20_poly1305_tls_cipher(EVP_CIPHER_CTX * ctx, unsigned char
955955
loop around and try again until the request
956956
completes and we can continue. */
957957
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
958-
pthread_yield();
958+
sched_yield();
959959
} else {
960-
pthread_yield();
960+
sched_yield();
961961
}
962962
} while (!op_done.flag ||
963963
QAT_CHK_JOB_RESUMED_UNEXPECTEDLY(job_ret));
@@ -1262,9 +1262,9 @@ static int qat_chacha20_poly1305_do_cipher(EVP_CIPHER_CTX * ctx, unsigned char *
12621262
loop around and try again until the request
12631263
completes and we can continue. */
12641264
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
1265-
pthread_yield();
1265+
sched_yield();
12661266
} else {
1267-
pthread_yield();
1267+
sched_yield();
12681268
}
12691269
} while (!op_done.flag ||
12701270
QAT_CHK_JOB_RESUMED_UNEXPECTEDLY(job_ret));

qat_hw_ciphers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,9 +1685,9 @@ int qat_chained_ciphers_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
16851685
loop around and try again until the request
16861686
completes and we can continue. */
16871687
if ((job_ret = qat_pause_job(done.opDone.job, ASYNC_STATUS_OK)) == 0)
1688-
pthread_yield();
1688+
sched_yield();
16891689
} else {
1690-
pthread_yield();
1690+
sched_yield();
16911691
}
16921692
} while (!done.opDone.flag ||
16931693
QAT_CHK_JOB_RESUMED_UNEXPECTEDLY(job_ret));

qat_hw_dh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,9 @@ int qat_dh_generate_key(DH *dh)
474474
loop around and try again until the request
475475
completes and we can continue. */
476476
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
477-
pthread_yield();
477+
sched_yield();
478478
} else {
479-
pthread_yield();
479+
sched_yield();
480480
}
481481
}
482482
while (!op_done.flag ||
@@ -801,9 +801,9 @@ int qat_dh_compute_key(unsigned char *key, const BIGNUM *in_pub_key, DH *dh)
801801
loop around and try again until the request
802802
completes and we can continue. */
803803
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
804-
pthread_yield();
804+
sched_yield();
805805
} else {
806-
pthread_yield();
806+
sched_yield();
807807
}
808808
}
809809
while (!op_done.flag ||

qat_hw_dsa.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,9 @@ DSA_SIG *qat_dsa_do_sign(const unsigned char *dgst, int dlen,
556556
loop around and try again until the request
557557
completes and we can continue. */
558558
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
559-
pthread_yield();
559+
sched_yield();
560560
} else {
561-
pthread_yield();
561+
sched_yield();
562562
}
563563
} while (!op_done.flag ||
564564
QAT_CHK_JOB_RESUMED_UNEXPECTEDLY(job_ret));
@@ -916,9 +916,9 @@ int qat_dsa_do_verify(const unsigned char *dgst, int dgst_len,
916916
loop around and try again until the request
917917
completes and we can continue. */
918918
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
919-
pthread_yield();
919+
sched_yield();
920920
} else {
921-
pthread_yield();
921+
sched_yield();
922922
}
923923
}
924924
while (!op_done.flag ||

qat_hw_ec.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ int qat_ecdh_compute_key(unsigned char **outX, size_t *outlenX,
502502
loop around and try again until the request
503503
completes and we can continue. */
504504
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
505-
pthread_yield();
505+
sched_yield();
506506
} else {
507-
pthread_yield();
507+
sched_yield();
508508
}
509509
}
510510
while (!op_done.flag ||
@@ -1266,9 +1266,9 @@ ECDSA_SIG *qat_ecdsa_do_sign(const unsigned char *dgst, int dgst_len,
12661266
loop around and try again until the request
12671267
completes and we can continue. */
12681268
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
1269-
pthread_yield();
1269+
sched_yield();
12701270
} else {
1271-
pthread_yield();
1271+
sched_yield();
12721272
}
12731273
}
12741274
while (!op_done.flag ||
@@ -1686,9 +1686,9 @@ int qat_ecdsa_do_verify(const unsigned char *dgst, int dgst_len,
16861686
loop around and try again until the request
16871687
completes and we can continue. */
16881688
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
1689-
pthread_yield();
1689+
sched_yield();
16901690
} else {
1691-
pthread_yield();
1691+
sched_yield();
16921692
}
16931693
}
16941694
while (!op_done.flag ||

qat_hw_ecx.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ int qat_pkey_ecx_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
401401
loop around and try again until the request
402402
completes and we can continue. */
403403
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
404-
pthread_yield();
404+
sched_yield();
405405
} else {
406-
pthread_yield();
406+
sched_yield();
407407
}
408408
}
409409
while (!op_done.flag ||
@@ -738,9 +738,9 @@ int qat_pkey_ecx_derive25519(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keyl
738738
loop around and try again until the request
739739
completes and we can continue. */
740740
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
741-
pthread_yield();
741+
sched_yield();
742742
} else {
743-
pthread_yield();
743+
sched_yield();
744744
}
745745
}
746746
while (!op_done.flag ||
@@ -1030,9 +1030,9 @@ int qat_pkey_ecx_derive448(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen
10301030
loop around and try again until the request
10311031
completes and we can continue. */
10321032
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
1033-
pthread_yield();
1033+
sched_yield();
10341034
} else {
1035-
pthread_yield();
1035+
sched_yield();
10361036
}
10371037
}
10381038
while (!op_done.flag ||

qat_hw_gcm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,9 @@ int qat_aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
12081208
loop around and try again until the request
12091209
completes and we can continue. */
12101210
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
1211-
pthread_yield();
1211+
sched_yield();
12121212
} else {
1213-
pthread_yield();
1213+
sched_yield();
12141214
}
12151215
} while (!op_done.flag ||
12161216
QAT_CHK_JOB_RESUMED_UNEXPECTEDLY(job_ret));
@@ -1530,9 +1530,9 @@ int qat_aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
15301530
loop around and try again until the request
15311531
completes and we can continue. */
15321532
if ((job_ret = qat_pause_job(op_done.job, 0)) == 0)
1533-
pthread_yield();
1533+
sched_yield();
15341534
} else {
1535-
pthread_yield();
1535+
sched_yield();
15361536
}
15371537
} while (!op_done.flag ||
15381538
QAT_CHK_JOB_RESUMED_UNEXPECTEDLY(job_ret));

qat_hw_hkdf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,9 @@ int qat_hkdf_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *olen)
701701
loop around and try again until the request
702702
completes and we can continue. */
703703
if ((job_ret = qat_pause_job(op_done.job, ASYNC_STATUS_OK)) == 0)
704-
pthread_yield();
704+
sched_yield();
705705
} else {
706-
pthread_yield();
706+
sched_yield();
707707
}
708708
}
709709
while (!op_done.flag ||

0 commit comments

Comments
 (0)