Header file of utility functions. More...
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | NO_OS_BIT(x) |
#define | NO_OS_BIT_ULL(x) |
#define | NO_OS_ARRAY_SIZE(x) |
#define | NO_OS_DIV_ROUND_UP(x, y) |
#define | NO_OS_DIV_ROUND_CLOSEST(x, y) |
#define | NO_OS_DIV_ROUND_CLOSEST_ULL(x, y) |
#define | no_os_min(x, y) |
#define | no_os_min_t(type, x, y) |
#define | no_os_max(x, y) |
#define | no_os_max_t(type, x, y) |
#define | no_os_clamp(val, min_val, max_val) |
#define | no_os_clamp_t(type, val, min_val, max_val) |
#define | no_os_swap(x, y) |
#define | no_os_round_up(x, y) |
#define | NO_OS_BITS_PER_LONG 32 |
#define | NO_OS_GENMASK(h, l) |
#define | NO_OS_GENMASK_ULL(h, l) |
#define | no_os_bswap_constant_32(x) |
#define | no_os_bswap_constant_16(x) |
#define | no_os_bit_swap_constant_8(x) |
#define | NO_OS_U16_MAX ((uint16_t)~0U) |
#define | NO_OS_S16_MAX ((int16_t)(NO_OS_U16_MAX>>1)) |
#define | NO_OS_DIV_U64(x, y) |
#define | NO_OS_UNUSED_PARAM(x) |
#define | no_os_shift_right(x, s) |
#define | no_os_align(x, align) |
#define | no_os_bcd2bin(x) |
#define | no_os_bin2bcd(x) |
#define | NO_OS_CONTAINER_OF(ptr, type, name) |
Functions | |
int | no_os_test_bit (int pos, const volatile void *addr) |
uint32_t | no_os_find_first_set_bit (uint32_t word) |
uint64_t | no_os_find_first_set_bit_u64 (uint64_t word) |
uint32_t | no_os_find_last_set_bit (uint32_t word) |
uint32_t | no_os_find_closest (int32_t val, const int32_t *array, uint32_t size) |
uint32_t | no_os_field_prep (uint32_t mask, uint32_t val) |
uint64_t | no_os_field_prep_u64 (uint64_t mask, uint64_t val) |
uint32_t | no_os_field_get (uint32_t mask, uint32_t word) |
uint32_t | no_os_field_max (uint32_t mask) |
uint64_t | no_os_field_max_u64 (uint64_t mask) |
int32_t | no_os_log_base_2 (uint32_t x) |
uint32_t | no_os_greatest_common_divisor (uint32_t a, uint32_t b) |
uint64_t | no_os_greatest_common_divisor_u64 (uint64_t a, uint64_t b) |
uint32_t | no_os_lowest_common_multiple (uint32_t a, uint32_t b) |
void | no_os_rational_best_approximation (uint32_t given_numerator, uint32_t given_denominator, uint32_t max_numerator, uint32_t max_denominator, uint32_t *best_numerator, uint32_t *best_denominator) |
void | no_os_rational_best_approximation_u64 (uint64_t given_numerator, uint64_t given_denominator, uint64_t max_numerator, uint64_t max_denominator, uint64_t *best_numerator, uint64_t *best_denominator) |
unsigned int | no_os_hweight8 (uint8_t word) |
unsigned int | no_os_hweight16 (uint16_t word) |
unsigned int | no_os_hweight32 (uint32_t word) |
uint64_t | no_os_do_div (uint64_t *n, uint64_t base) |
uint64_t | no_os_div64_u64_rem (uint64_t dividend, uint64_t divisor, uint64_t *remainder) |
uint64_t | no_os_div_u64_rem (uint64_t dividend, uint32_t divisor, uint32_t *remainder) |
int64_t | no_os_div_s64_rem (int64_t dividend, int32_t divisor, int32_t *remainder) |
uint64_t | no_os_div_u64 (uint64_t dividend, uint32_t divisor) |
int64_t | no_os_div_s64 (int64_t dividend, int32_t divisor) |
int32_t | no_os_str_to_int32 (const char *str) |
uint32_t | no_os_str_to_uint32 (const char *str) |
void | no_os_put_unaligned_be16 (uint16_t val, uint8_t *buf) |
uint16_t | no_os_get_unaligned_be16 (uint8_t *buf) |
void | no_os_put_unaligned_le16 (uint16_t val, uint8_t *buf) |
uint16_t | no_os_get_unaligned_le16 (uint8_t *buf) |
void | no_os_put_unaligned_be24 (uint32_t val, uint8_t *buf) |
uint32_t | no_os_get_unaligned_be24 (uint8_t *buf) |
void | no_os_put_unaligned_le24 (uint32_t val, uint8_t *buf) |
uint32_t | no_os_get_unaligned_le24 (uint8_t *buf) |
void | no_os_put_unaligned_be32 (uint32_t val, uint8_t *buf) |
uint32_t | no_os_get_unaligned_be32 (uint8_t *buf) |
void | no_os_put_unaligned_le32 (uint32_t val, uint8_t *buf) |
uint32_t | no_os_get_unaligned_le32 (uint8_t *buf) |
int16_t | no_os_sign_extend16 (uint16_t value, int index) |
int32_t | no_os_sign_extend32 (uint32_t value, int index) |
uint64_t | no_os_mul_u32_u32 (uint32_t a, uint32_t b) |
uint64_t | no_os_mul_u64_u32_shr (uint64_t a, uint32_t mul, unsigned int shift) |
uint64_t | no_os_mul_u64_u32_div (uint64_t a, uint32_t mul, uint32_t divisor) |
bool | no_os_is_big_endian (void) |
void | no_os_memswap64 (void *buf, uint32_t bytes, uint32_t step) |
Header file of utility functions.
Copyright 2018(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define no_os_align | ( | x, | |
align ) |
#define NO_OS_ARRAY_SIZE | ( | x | ) |
#define no_os_bcd2bin | ( | x | ) |
#define no_os_bin2bcd | ( | x | ) |
#define NO_OS_BIT | ( | x | ) |
#define no_os_bit_swap_constant_8 | ( | x | ) |
#define NO_OS_BIT_ULL | ( | x | ) |
#define NO_OS_BITS_PER_LONG 32 |
#define no_os_bswap_constant_16 | ( | x | ) |
#define no_os_bswap_constant_32 | ( | x | ) |
#define no_os_clamp | ( | val, | |
min_val, | |||
max_val ) |
#define no_os_clamp_t | ( | type, | |
val, | |||
min_val, | |||
max_val ) |
#define NO_OS_CONTAINER_OF | ( | ptr, | |
type, | |||
name ) |
#define NO_OS_DIV_ROUND_CLOSEST | ( | x, | |
y ) |
#define NO_OS_DIV_ROUND_CLOSEST_ULL | ( | x, | |
y ) |
#define NO_OS_DIV_ROUND_UP | ( | x, | |
y ) |
#define NO_OS_DIV_U64 | ( | x, | |
y ) |
#define NO_OS_GENMASK | ( | h, | |
l ) |
#define NO_OS_GENMASK_ULL | ( | h, | |
l ) |
#define no_os_max | ( | x, | |
y ) |
#define no_os_max_t | ( | type, | |
x, | |||
y ) |
#define no_os_min | ( | x, | |
y ) |
#define no_os_min_t | ( | type, | |
x, | |||
y ) |
#define no_os_round_up | ( | x, | |
y ) |
#define NO_OS_S16_MAX ((int16_t)(NO_OS_U16_MAX>>1)) |
#define no_os_shift_right | ( | x, | |
s ) |
#define no_os_swap | ( | x, | |
y ) |
#define NO_OS_U16_MAX ((uint16_t)~0U) |
#define NO_OS_UNUSED_PARAM | ( | x | ) |
uint64_t no_os_div64_u64_rem | ( | uint64_t | dividend, |
uint64_t | divisor, | ||
uint64_t * | remainder ) |
int64_t no_os_div_s64 | ( | int64_t | dividend, |
int32_t | divisor ) |
int64_t no_os_div_s64_rem | ( | int64_t | dividend, |
int32_t | divisor, | ||
int32_t * | remainder ) |
uint64_t no_os_div_u64 | ( | uint64_t | dividend, |
uint32_t | divisor ) |
uint64_t no_os_div_u64_rem | ( | uint64_t | dividend, |
uint32_t | divisor, | ||
uint32_t * | remainder ) |
uint64_t no_os_do_div | ( | uint64_t * | n, |
uint64_t | base ) |
uint32_t no_os_field_get | ( | uint32_t | mask, |
uint32_t | word ) |
uint32_t no_os_field_max | ( | uint32_t | mask | ) |
uint64_t no_os_field_max_u64 | ( | uint64_t | mask | ) |
uint32_t no_os_field_prep | ( | uint32_t | mask, |
uint32_t | val ) |
uint64_t no_os_field_prep_u64 | ( | uint64_t | mask, |
uint64_t | val ) |
uint32_t no_os_find_closest | ( | int32_t | val, |
const int32_t * | array, | ||
uint32_t | size ) |
uint32_t no_os_find_first_set_bit | ( | uint32_t | word | ) |
uint64_t no_os_find_first_set_bit_u64 | ( | uint64_t | word | ) |
uint32_t no_os_find_last_set_bit | ( | uint32_t | word | ) |
uint16_t no_os_get_unaligned_be16 | ( | uint8_t * | buf | ) |
uint32_t no_os_get_unaligned_be24 | ( | uint8_t * | buf | ) |
uint32_t no_os_get_unaligned_be32 | ( | uint8_t * | buf | ) |
uint16_t no_os_get_unaligned_le16 | ( | uint8_t * | buf | ) |
uint32_t no_os_get_unaligned_le24 | ( | uint8_t * | buf | ) |
uint32_t no_os_get_unaligned_le32 | ( | uint8_t * | buf | ) |
uint32_t no_os_greatest_common_divisor | ( | uint32_t | a, |
uint32_t | b ) |
uint64_t no_os_greatest_common_divisor_u64 | ( | uint64_t | a, |
uint64_t | b ) |
unsigned int no_os_hweight16 | ( | uint16_t | word | ) |
unsigned int no_os_hweight32 | ( | uint32_t | word | ) |
unsigned int no_os_hweight8 | ( | uint8_t | word | ) |
bool no_os_is_big_endian | ( | void | ) |
int32_t no_os_log_base_2 | ( | uint32_t | x | ) |
uint32_t no_os_lowest_common_multiple | ( | uint32_t | a, |
uint32_t | b ) |
void no_os_memswap64 | ( | void * | buf, |
uint32_t | bytes, | ||
uint32_t | step ) |
uint64_t no_os_mul_u32_u32 | ( | uint32_t | a, |
uint32_t | b ) |
uint64_t no_os_mul_u64_u32_div | ( | uint64_t | a, |
uint32_t | mul, | ||
uint32_t | divisor ) |
uint64_t no_os_mul_u64_u32_shr | ( | uint64_t | a, |
uint32_t | mul, | ||
unsigned int | shift ) |
void no_os_put_unaligned_be16 | ( | uint16_t | val, |
uint8_t * | buf ) |
void no_os_put_unaligned_be24 | ( | uint32_t | val, |
uint8_t * | buf ) |
void no_os_put_unaligned_be32 | ( | uint32_t | val, |
uint8_t * | buf ) |
void no_os_put_unaligned_le16 | ( | uint16_t | val, |
uint8_t * | buf ) |
void no_os_put_unaligned_le24 | ( | uint32_t | val, |
uint8_t * | buf ) |
void no_os_put_unaligned_le32 | ( | uint32_t | val, |
uint8_t * | buf ) |
void no_os_rational_best_approximation | ( | uint32_t | given_numerator, |
uint32_t | given_denominator, | ||
uint32_t | max_numerator, | ||
uint32_t | max_denominator, | ||
uint32_t * | best_numerator, | ||
uint32_t * | best_denominator ) |
void no_os_rational_best_approximation_u64 | ( | uint64_t | given_numerator, |
uint64_t | given_denominator, | ||
uint64_t | max_numerator, | ||
uint64_t | max_denominator, | ||
uint64_t * | best_numerator, | ||
uint64_t * | best_denominator ) |
int16_t no_os_sign_extend16 | ( | uint16_t | value, |
int | index ) |
int32_t no_os_sign_extend32 | ( | uint32_t | value, |
int | index ) |
int32_t no_os_str_to_int32 | ( | const char * | str | ) |
uint32_t no_os_str_to_uint32 | ( | const char * | str | ) |
|
inline |