Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
bit_rev.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_ARCH_ARM_BIT_REV_H_
8#define ZEPHYR_INCLUDE_ARCH_ARM_BIT_REV_H_
9
10#ifndef _ASMLANGUAGE
11
12#include <arm_acle.h>
13#include <zephyr/types.h>
14#include <zephyr/sys/util.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
26
27#if defined(CONFIG_ARCH_HAS_BIT_REV) || defined(__DOXYGEN__)
28
37{
38 return __rbit(x);
39}
40
49{
50 return arch_sys_bit_rev32(x) >> 16;
51}
52
61{
62 return arch_sys_bit_rev32(x) >> 24;
63}
64#endif /* CONFIG_ARCH_HAS_BIT_REV || __DOXYGEN__ */
65
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif /* !_ASMLANGUAGE */
75#endif /* ZEPHYR_INCLUDE_ARCH_ARM_BIT_REV_H_ */
static uint16_t arch_sys_bit_rev16(uint16_t x)
Reverse the bits in a 16-bit value.
Definition bit_rev.h:48
static uint8_t arch_sys_bit_rev8(uint8_t x)
Reverse the bits in an 8-bit value.
Definition bit_rev.h:60
static uint32_t arch_sys_bit_rev32(uint32_t x)
Reverse the bits in a 32-bit value.
Definition bit_rev.h:36
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Misc utilities.