WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
oal_plat_type.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2021. All rights reserved.
3 * Description: Header file for oal_plat_type.h.
4 */
5
6#ifndef __OAL_PLAT_TYPE_H__
7#define __OAL_PLAT_TYPE_H__
8
9#include "osal_adapt.h"
10#include "td_base.h"
11/*****************************************************************************
12 1 Include other Head file
13*****************************************************************************/
14
15/*****************************************************************************
16 2 Define macro
17*****************************************************************************/
18#define STATIC static
19
20#ifndef INLINE__
21#ifdef INLINE_TO_FORCEINLINE
22#define INLINE__ __inline__ __attribute__((always_inline))
23#else
24#define INLINE__ __inline
25#endif
26#endif
27
28#ifdef osal_likely
29#undef osal_likely
30#endif
31#ifdef osal_unlikely
32#undef osal_unlikely
33#endif
34#ifdef HAVE_PCLINT_CHECK
35#define osal_likely(x) (x)
36#define osal_unlikely(x) (x)
37#else
38#define osal_likely(x) __builtin_expect(!!(x), 1)
39#define osal_unlikely(x) __builtin_expect(!!(x), 0)
40#endif
41
42#define OAL_LIKELY(_expr) uapi_likely(_expr)
43#define OAL_UNLIKELY(_expr) uapi_unlikely(_expr)
44
45#define osal_array_size(_array) (sizeof(_array) / sizeof((_array)[0]))
46
47#define hi_tolower(x) ((x) | 0x20) /* Works only for digits and letters, but small and fast */
48#define osal_makeu64(a, b) ((osal_u64)(((osal_u32)(a)) | ((osal_u64)((osal_u32)(b))) << 32))
49
50#ifndef NEWLINE
51#define NEWLINE "\r\n"
52#endif
53
54#define osal_array_size(_array) (sizeof(_array) / sizeof((_array)[0]))
55
56#ifndef OSAL_WRITE_BITS /* 与oal_plat_type.h重定义,先屏蔽后整改 */
57#define OSAL_WRITE_BITS
58static INLINE__ osal_void osal_write_bits(osal_u32 *data, osal_u32 val, osal_u32 bits, osal_u32 pos)
59{
60 (*data) &= ~((((osal_u32)1 << bits) - 1) << pos);
61 (*data) |= ((val & (((osal_u32)1 << bits) - 1)) << pos);
62}
63#endif
64#define osal_abs_of_diff(_l_a, _l_b) (((_l_a) > (_l_b)) ? ((_l_a) - (_l_b)) : ((_l_b) - (_l_a)))
65
66#define osal_bit(nr) (1UL << (nr))
67
68#endif /* __OAL_PLAT_TYPE_H */
#define INLINE__
Definition oal_plat_type.h:24
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
Definition hal_uart_v151_regs_def.h:38