30#define SETBIT(x, y) (x | (1ULL << y))
31#define SETBITS(x, y, z) (x | (y << z))
32#define GETBIT(x, y) ((x & (1ULL << y)) > y)
33#define CLEARBIT(x, y) (x & (~(1ULL << y)))
34#define CLEARBITS(x, y, z) \
35 for (int i = y; i <= z; ++i) { \
39#define SHELL_CHECK_NULL_ARG(arg_ptr) \
40 if (arg_ptr == NULL) { \
41 shell_error(shell, "Parameter \"" #arg_ptr "\" passed in as NULL"); \
45#define SHELL_CHECK_NULL_ARG_WITH_RETURN(arg_ptr, ret_val) \
46 if (arg_ptr == NULL) { \
47 shell_error(shell, "Parameter \"" #arg_ptr "\" passed in as NULL"); \
51#define CHECK_NULL_ARG(arg_ptr) \
52 if (arg_ptr == NULL) { \
53 LOG_DBG("Parameter \"" #arg_ptr "\" passed in as NULL"); \
57#define CHECK_NULL_ARG_WITH_RETURN(arg_ptr, ret_val) \
58 if (arg_ptr == NULL) { \
59 LOG_DBG("Parameter \"" #arg_ptr "\" passed in as NULL"); \
63#define CHECK_ARG_WITH_RETURN(cmp, ret_val) \
65 LOG_DBG("Parameter \"" #cmp "\" true"); \
69#define CHECK_MSGQ_INIT(msgq) CHECK_NULL_ARG((msgq)->buffer_start);
71#define CHECK_MSGQ_INIT_WITH_RETURN(msgq, ret_val) \
72 CHECK_NULL_ARG_WITH_RETURN((msgq)->buffer_start, ret_val);
74#define CHECK_MUTEX_INIT(mutex) CHECK_NULL_ARG((mutex)->wait_q.waitq.head);
76#define CHECK_MUTEX_INIT_WITH_RETURN(mutex, ret_val) \
77 CHECK_NULL_ARG_WITH_RETURN((mutex)->wait_q.waitq.head, ret_val);
79#define SET_FLAG_WITH_RETURN(flag, set_val, ret_val) \
81 LOG_DBG("Set parameter \"" #flag "\" to true"); \
103 uint8_t source_inft, uint8_t target_inft, uint16_t
data_len,
116double power(
double x,
int y);
119void clear_bits(uint32_t *value,
int start_bit,
int end_bit);
uint8_t seq_source
Definition: ipmb.h:5
uint16_t data_len
Definition: ipmb.h:14
uint8_t data[]
Definition: isl69259.c:2
I2C_MSG construct_i2c_message(uint8_t bus_id, uint8_t address, uint8_t tx_len, uint8_t *data, uint8_t rx_len)
Definition: libutil.c:65
ipmi_msg construct_ipmi_message(uint8_t seq_source, uint8_t netFn, uint8_t command, uint8_t source_inft, uint8_t target_inft, uint16_t data_len, uint8_t *data)
Definition: libutil.c:37
void reverse_array(uint8_t arr[], uint8_t size)
Definition: libutil.c:77
int find_byte_data_in_buf(const uint8_t *buf, uint8_t byte_data, int start_index, int end_index)
Definition: libutil.c:185
int ascii_to_val(uint8_t ascii_byte)
Definition: libutil.c:87
int uint8_t_to_dec_ascii_pointer(uint8_t val, uint8_t *result, uint8_t len)
Definition: libutil.c:163
void convert_uint8_t_pointer_to_uint32_t(uint32_t *data_32, const uint8_t *data_8, uint8_t len, uint8_t endian)
Definition: libutil.c:129
uint32_t uint32_t_byte_reverse(uint32_t data)
Definition: libutil.c:97
BYTE_ENDIAN
Definition: libutil.h:97
@ BIG_ENDIAN
Definition: libutil.h:99
@ SMALL_ENDIAN
Definition: libutil.h:98
BIT_SETTING_READING
Definition: libutil.h:86
@ BIT_SET
Definition: libutil.h:88
@ BIT_GET
Definition: libutil.h:89
@ BIT_CLEAR
Definition: libutil.h:87
void clear_bits(uint32_t *value, int start_bit, int end_bit)
Definition: libutil.c:196
double power(double x, int y)
Definition: libutil.c:147
BIT_SETTING_READING_N
Definition: libutil.h:92
@ BIT_CLEAR_N
Definition: libutil.h:94
@ BIT_SET_N
Definition: libutil.h:93
void convert_uint32_t_to_uint8_t_pointer(uint32_t data_32, uint8_t *data_8, uint8_t len, uint8_t endian)
Definition: libutil.c:109
void sort_bubble(int *array, int len)
Definition: libutil.c:208
uint16_t size
Definition: pldm_oem.h:0
Definition: hal_i2c.h:163