WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_base.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2019. All rights reserved.
3 * Description: Basic definitions
4 * Author: Huawei LiteOS Team
5 * Create: 2013-01-01
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
35#ifndef _LOS_BASE_H
36#define _LOS_BASE_H
37
38#include "los_builddef.h"
39#include "los_typedef.h"
40#include "los_config.h"
41#include "los_printf.h"
42#include "los_list.h"
43#include "los_err.h"
44#include "los_errno.h"
45#include "los_hw.h"
46#include "los_tick.h"
47#include "los_io.h"
48#include "securec.h"
49#ifdef LOSCFG_DEBUG_VERSION
50#include "arch/interrupt.h" /* import ArchIntLock() */
51#include "los_exc.h"
52#endif
53
54#ifdef __cplusplus
55extern "C" {
56#endif /* __cplusplus */
57
78#define LOS_ASSERT_COND(expression) LOS_ASSERT(expression)
79
84#define LOS_NO_WAIT 0
85
90#define LOS_WAIT_FOREVER 0xFFFFFFFF
91
115#ifndef ALIGN
116#define ALIGN(addr, boundary) LOS_Align(addr, boundary)
117#endif
118
142#define TRUNCATE(addr, size) ((UINTPTR)(addr) & ~((size) - 1))
143
147#define READ_UINT8(value, addr) { (value) = READ8_MB(addr); }
148
152#define READ_UINT16(value, addr) { (value) = READ16_MB(addr); }
153
157#define READ_UINT32(value, addr) { (value) = READ32_MB(addr); }
158
162#define READ_UINT64(value, addr) { (value) = READ64_MB(addr); }
163
167#define WRITE_UINT8(value, addr) WRITE8_MB(addr, value)
168
172#define WRITE_UINT16(value, addr) WRITE16_MB(addr, value)
173
177#define WRITE_UINT32(value, addr) WRITE32_MB(addr, value)
178
182#define WRITE_UINT64(value, addr) WRITE64_MB(addr, value)
183
187#define GET_UINT8(addr) READ8_MB(addr)
188
192#define GET_UINT16(addr) READ16_MB(addr)
193
197#define GET_UINT32(addr) READ32_MB(addr)
198
202#define GET_UINT64(addr) READ64_MB(addr)
203
224#ifdef LOSCFG_DEBUG_VERSION
225#define LOS_ASSERT(judge) do { \
226 if ((UINTPTR)(judge) == 0) { \
227 (VOID)ArchIntLock(); \
228 LOS_PANIC("ASSERT ERROR! %s, %d, %s\n", __FILE__, __LINE__, __FUNCTION__); \
229 } \
230} while (0)
231#else
232#define LOS_ASSERT(judge)
233#endif
234
257extern UINTPTR LOS_Align(UINTPTR addr, UINT32 boundary);
258
287extern VOID LOS_Msleep(UINT32 msecs);
288
289#ifdef __cplusplus
290}
291#endif /* __cplusplus */
292
293#endif /* _LOS_BASE_H */
UINTPTR LOS_Align(UINTPTR addr, UINT32 boundary)
Align the address (addr) by some bytes (boundary) you specify.
void LOS_Msleep(UINT32 msecs)
Sleep the current task.
#define VOID
Definition los_typedef.h:88
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52