Lines Matching +full:32 +full:- +full:bit
6 * Copyright (c) 2015-2016, Intel Corporation.
8 * SPDX-License-Identifier: Apache-2.0
27 #define BSWAP_40(x) ((uint64_t) ((((x) >> 32) & 0xff) | \
31 (((x) & 0xff) << 32)))
48 * @brief Convert 16-bit integer from little-endian to host endianness.
50 * @param val 16-bit integer in little-endian format.
52 * @return 16-bit integer in host endianness.
56 * @brief Convert 16-bit integer from host endianness to little-endian.
58 * @param val 16-bit integer in host endianness.
60 * @return 16-bit integer in little-endian format.
64 * @brief Convert 24-bit integer from little-endian to host endianness.
66 * @param val 24-bit integer in little-endian format.
68 * @return 24-bit integer in host endianness.
72 * @brief Convert 24-bit integer from host endianness to little-endian.
74 * @param val 24-bit integer in host endianness.
76 * @return 24-bit integer in little-endian format.
80 * @brief Convert 32-bit integer from little-endian to host endianness.
82 * @param val 32-bit integer in little-endian format.
84 * @return 32-bit integer in host endianness.
88 * @brief Convert 32-bit integer from host endianness to little-endian.
90 * @param val 32-bit integer in host endianness.
92 * @return 32-bit integer in little-endian format.
96 * @brief Convert 48-bit integer from little-endian to host endianness.
98 * @param val 48-bit integer in little-endian format.
100 * @return 48-bit integer in host endianness.
104 * @brief Convert 48-bit integer from host endianness to little-endian.
106 * @param val 48-bit integer in host endianness.
108 * @return 48-bit integer in little-endian format.
112 * @brief Convert 16-bit integer from big-endian to host endianness.
114 * @param val 16-bit integer in big-endian format.
116 * @return 16-bit integer in host endianness.
120 * @brief Convert 16-bit integer from host endianness to big-endian.
122 * @param val 16-bit integer in host endianness.
124 * @return 16-bit integer in big-endian format.
128 * @brief Convert 24-bit integer from big-endian to host endianness.
130 * @param val 24-bit integer in big-endian format.
132 * @return 24-bit integer in host endianness.
136 * @brief Convert 24-bit integer from host endianness to big-endian.
138 * @param val 24-bit integer in host endianness.
140 * @return 24-bit integer in big-endian format.
144 * @brief Convert 32-bit integer from big-endian to host endianness.
146 * @param val 32-bit integer in big-endian format.
148 * @return 32-bit integer in host endianness.
152 * @brief Convert 32-bit integer from host endianness to big-endian.
154 * @param val 32-bit integer in host endianness.
156 * @return 32-bit integer in big-endian format.
160 * @brief Convert 48-bit integer from big-endian to host endianness.
162 * @param val 48-bit integer in big-endian format.
164 * @return 48-bit integer in host endianness.
168 * @brief Convert 48-bit integer from host endianness to big-endian.
170 * @param val 48-bit integer in host endianness.
172 * @return 48-bit integer in big-endian format.
176 * @brief Convert 16-bit unsigned integer to byte array.
183 * @param val 16-bit unsigned integer.
185 * @return 16-bit unsigned integer as byte array.
189 * @brief Convert 32-bit unsigned integer to byte array.
197 * @param val 32-bit unsigned integer.
199 * @return 32-bit unsigned integer as byte array.
203 * @brief Convert 64-bit unsigned integer to byte array.
213 * @param val 64-bit unsigned integer.
215 * @return 64-bit unsigned integer as byte array.
259 (((val) >> 32) & 0xff), \
304 (((val) >> 32) & 0xff), \
313 * @brief Put a 16-bit integer as big-endian to arbitrary location.
315 * Put a 16-bit integer, originally in host endianness, to a
316 * potentially unaligned memory location in big-endian format.
318 * @param val 16-bit integer in host endianness.
328 * @brief Put a 24-bit integer as big-endian to arbitrary location.
330 * Put a 24-bit integer, originally in host endianness, to a
331 * potentially unaligned memory location in big-endian format.
333 * @param val 24-bit integer in host endianness.
343 * @brief Put a 32-bit integer as big-endian to arbitrary location.
345 * Put a 32-bit integer, originally in host endianness, to a
346 * potentially unaligned memory location in big-endian format.
348 * @param val 32-bit integer in host endianness.
357 * @brief Put a 40-bit integer as big-endian to arbitrary location.
359 * Put a 40-bit integer, originally in host endianness, to a
360 * potentially unaligned memory location in big-endian format.
362 * @param val 40-bit integer in host endianness.
367 dst[0] = val >> 32; in sys_put_be40()
372 * @brief Put a 48-bit integer as big-endian to arbitrary location.
374 * Put a 48-bit integer, originally in host endianness, to a
375 * potentially unaligned memory location in big-endian format.
377 * @param val 48-bit integer in host endianness.
382 sys_put_be16(val >> 32, dst); in sys_put_be48()
387 * @brief Put a 64-bit integer as big-endian to arbitrary location.
389 * Put a 64-bit integer, originally in host endianness, to a
390 * potentially unaligned memory location in big-endian format.
392 * @param val 64-bit integer in host endianness.
397 sys_put_be32(val >> 32, dst); in sys_put_be64()
402 * @brief Put a 16-bit integer as little-endian to arbitrary location.
404 * Put a 16-bit integer, originally in host endianness, to a
405 * potentially unaligned memory location in little-endian format.
407 * @param val 16-bit integer in host endianness.
417 * @brief Put a 24-bit integer as little-endian to arbitrary location.
419 * Put a 24-bit integer, originally in host endianness, to a
420 * potentially unaligned memory location in little-endian format.
422 * @param val 24-bit integer in host endianness.
432 * @brief Put a 32-bit integer as little-endian to arbitrary location.
434 * Put a 32-bit integer, originally in host endianness, to a
435 * potentially unaligned memory location in little-endian format.
437 * @param val 32-bit integer in host endianness.
447 * @brief Put a 40-bit integer as little-endian to arbitrary location.
449 * Put a 40-bit integer, originally in host endianness, to a
450 * potentially unaligned memory location in little-endian format.
452 * @param val 40-bit integer in host endianness.
458 dst[4] = val >> 32; in sys_put_le40()
462 * @brief Put a 48-bit integer as little-endian to arbitrary location.
464 * Put a 48-bit integer, originally in host endianness, to a
465 * potentially unaligned memory location in little-endian format.
467 * @param val 48-bit integer in host endianness.
473 sys_put_le16(val >> 32, &dst[4]); in sys_put_le48()
477 * @brief Put a 64-bit integer as little-endian to arbitrary location.
479 * Put a 64-bit integer, originally in host endianness, to a
480 * potentially unaligned memory location in little-endian format.
482 * @param val 64-bit integer in host endianness.
488 sys_put_le32(val >> 32, &dst[4]); in sys_put_le64()
492 * @brief Get a 16-bit integer stored in big-endian format.
494 * Get a 16-bit integer, stored in big-endian format in a potentially
497 * @param src Location of the big-endian 16-bit integer to get.
499 * @return 16-bit integer in host endianness.
507 * @brief Get a 24-bit integer stored in big-endian format.
509 * Get a 24-bit integer, stored in big-endian format in a potentially
512 * @param src Location of the big-endian 24-bit integer to get.
514 * @return 24-bit integer in host endianness.
522 * @brief Get a 32-bit integer stored in big-endian format.
524 * Get a 32-bit integer, stored in big-endian format in a potentially
527 * @param src Location of the big-endian 32-bit integer to get.
529 * @return 32-bit integer in host endianness.
537 * @brief Get a 40-bit integer stored in big-endian format.
539 * Get a 40-bit integer, stored in big-endian format in a potentially
542 * @param src Location of the big-endian 40-bit integer to get.
544 * @return 40-bit integer in host endianness.
552 * @brief Get a 48-bit integer stored in big-endian format.
554 * Get a 48-bit integer, stored in big-endian format in a potentially
557 * @param src Location of the big-endian 48-bit integer to get.
559 * @return 48-bit integer in host endianness.
567 * @brief Get a 64-bit integer stored in big-endian format.
569 * Get a 64-bit integer, stored in big-endian format in a potentially
572 * @param src Location of the big-endian 64-bit integer to get.
574 * @return 64-bit integer in host endianness.
578 return ((uint64_t)sys_get_be32(&src[0]) << 32) | sys_get_be32(&src[4]); in sys_get_be64()
582 * @brief Get a 16-bit integer stored in little-endian format.
584 * Get a 16-bit integer, stored in little-endian format in a potentially
587 * @param src Location of the little-endian 16-bit integer to get.
589 * @return 16-bit integer in host endianness.
597 * @brief Get a 24-bit integer stored in little-endian format.
599 * Get a 24-bit integer, stored in little-endian format in a potentially
602 * @param src Location of the little-endian 24-bit integer to get.
604 * @return 24-bit integer in host endianness.
612 * @brief Get a 32-bit integer stored in little-endian format.
614 * Get a 32-bit integer, stored in little-endian format in a potentially
617 * @param src Location of the little-endian 32-bit integer to get.
619 * @return 32-bit integer in host endianness.
627 * @brief Get a 40-bit integer stored in little-endian format.
629 * Get a 40-bit integer, stored in little-endian format in a potentially
632 * @param src Location of the little-endian 40-bit integer to get.
634 * @return 40-bit integer in host endianness.
642 * @brief Get a 48-bit integer stored in little-endian format.
644 * Get a 48-bit integer, stored in little-endian format in a potentially
647 * @param src Location of the little-endian 48-bit integer to get.
649 * @return 48-bit integer in host endianness.
657 * @brief Get a 64-bit integer stored in little-endian format.
659 * Get a 64-bit integer, stored in little-endian format in a potentially
662 * @param src Location of the little-endian 64-bit integer to get.
664 * @return 64-bit integer in host endianness.
668 return ((uint64_t)sys_get_le32(&src[4]) << 32) | sys_get_le32(&src[0]); in sys_get_le64()
675 * i.e.: src[n] will be put in dst[end-n]
693 psrc += length - 1; in sys_memcpy_swap()
695 for (; length > 0; length--) { in sys_memcpy_swap()
696 *pdst++ = *psrc--; in sys_memcpy_swap()
703 * In-place memory swap, where final content will be reversed.
704 * I.e.: buf[n] will be put in buf[end-n]
717 ((uint8_t *)buf)[i] = ((uint8_t *)buf)[length - 1 - i]; in sys_mem_swap()
718 ((uint8_t *)buf)[length - 1 - i] = tmp; in sys_mem_swap()