WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_hwi.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2020. All rights reserved.
3 * Description: Hwi HeadFile
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
33#ifndef _LOS_HWI_H
34#define _LOS_HWI_H
35
36#include "los_base.h"
37#include "hal_hwi.h"
38#include "arch/cpu.h"
39#include "arch/interrupt.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
48extern size_t IntActive(VOID);
49
56#define OS_INT_ACTIVE IntActive()
57
66#define OS_INT_INACTIVE (!(OS_INT_ACTIVE))
67
73#define OS_HWI_PRIO_HIGHEST 0
74
80#define OS_HWI_PRIO_LOWEST (LOSCFG_HWI_PRIO_LIMIT - 1)
81
86#if (OS_HWI_PRIO_HIGHEST == 0)
87#define HWI_PRI_VALID(pri) ((pri) <= OS_HWI_PRIO_LOWEST)
88#else
89#define HWI_PRI_VALID(pri) (((pri) >= OS_HWI_PRIO_HIGHEST) && ((pri) <= OS_HWI_PRIO_LOWEST))
90#endif
91
104#define LOS_ERRNO_HWI_NUM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x00)
105#define OS_ERRNO_HWI_NUM_INVALID LOS_ERRNO_HWI_NUM_INVALID
106
119#define LOS_ERRNO_HWI_PROC_FUNC_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x01)
120#define OS_ERRNO_HWI_PROC_FUNC_NULL LOS_ERRNO_HWI_PROC_FUNC_NULL
121
131#define OS_ERRNO_HWI_CB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x02)
132
145#define LOS_ERRNO_HWI_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x03)
146#define OS_ERRNO_HWI_NO_MEMORY LOS_ERRNO_HWI_NO_MEMORY
147
161#define LOS_ERRNO_HWI_ALREADY_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x04)
162#define OS_ERRNO_HWI_ALREADY_CREATED LOS_ERRNO_HWI_ALREADY_CREATED
163
176#define LOS_ERRNO_HWI_PRIO_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x05)
177#define OS_ERRNO_HWI_PRIO_INVALID LOS_ERRNO_HWI_PRIO_INVALID
178
188#define OS_ERRNO_HWI_MODE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x06)
189
199#define OS_ERRNO_HWI_FASTMODE_ALREADY_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x07)
200
213#define LOS_ERRNO_HWI_INTERR LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x08)
214#define OS_ERRNO_HWI_INTERR LOS_ERRNO_HWI_INTERR
215
229#define LOS_ERRNO_HWI_SHARED_ERROR LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x09)
230#define OS_ERRNO_HWI_SHARED_ERROR LOS_ERRNO_HWI_SHARED_ERROR
231
241#define OS_ERRNO_HWI_ARG_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0a)
242
256#define LOS_ERRNO_HWI_HWINUM_UNCREATE LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0b)
257#define OS_ERRNO_HWI_HWINUM_UNCREATE LOS_ERRNO_HWI_HWINUM_UNCREATE
258
271#define LOS_ERRNO_HWI_NO_CPUP_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0c)
272
285#define LOS_ERRNO_HWI_NOT_INTERRUPT_CONTEXT LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0d)
286
299#define LOS_ERRNO_HWI_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0e)
300
311#define LOS_ERRNO_HWI_ARG_NOT_ENABLED LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0f)
312
318
324
330
337
357
377
384#define IRQF_SHARED 0x8000U
385
395
413STATIC INLINE UINT32 LOS_IntLock(VOID)
414{
415 return ArchIntLock();
416}
417
434STATIC INLINE UINT32 LOS_IntUnLock(VOID)
435{
436 return ArchIntUnlock();
437}
438
457STATIC INLINE VOID LOS_IntRestore(UINT32 intSave)
458{
459 ArchIntRestore(intSave);
460}
461
506 HWI_PRIOR_T hwiPrio,
507 HWI_MODE_T hwiMode,
508 HWI_PROC_FUNC hwiHandler,
509 HWI_IRQ_PARAM_S *irqParam);
510
548
570
591
614
636
660
682extern UINT32 LOS_HwiSendIpi(HWI_HANDLE_T hwiNum, UINT32 cpuMask);
683
706
732
755
756#ifdef LOSCFG_HWI_PRE_POST_PROCESS
774typedef VOID (*HWI_PROC_HOOK)(HWI_HANDLE_T hwiNum);
775
797extern VOID LOS_HwiPreHookReg(HWI_PROC_HOOK intPreHook);
798
818extern VOID LOS_HwiPostHookReg(HWI_PROC_HOOK intPostHook);
819#endif
820
821#ifdef __cplusplus
822}
823#endif /* __cplusplus */
824
825#endif /* _LOS_HWI_H */
#define STATIC
Definition common_def.h:57
#define INLINE
Definition common_def.h:65
UINT16 HWI_PRIOR_T
Definition los_hwi.h:323
UINT32 LOS_HwiClear(HWI_HANDLE_T hwiNum)
clear interrupts.
void(* HWI_PROC_FUNC)(void)
Define the type of a hardware interrupt handling function.
Definition los_hwi.h:356
UINT32 LOS_HwiCreate(HWI_HANDLE_T hwiNum, HWI_PRIOR_T hwiPrio, HWI_MODE_T hwiMode, HWI_PROC_FUNC hwiHandler, HWI_IRQ_PARAM_S *irqParam)
Create a hardware interrupt.
void(* HWI_BOTTOM_HALF_FUNC)(void *)
Define the type of an interrupt bottom half function.
Definition los_hwi.h:376
UINT32 LOS_HwiRespCntGet(HWI_HANDLE_T hwiNum, UINT32 *respCount)
Get the number of interrupt responses.
UINT32 LOS_HwiSendIpi(HWI_HANDLE_T hwiNum, UINT32 cpuMask)
Send inter-core interrupts to designated cores.
UINT32 LOS_HwiDelete(HWI_HANDLE_T hwiNum, HWI_IRQ_PARAM_S *irqParam)
delete a hardware interrupt.
UINT32 LOS_HwiDisable(HWI_HANDLE_T hwiNum)
Disable interrupts.
UINT32 LOS_HwiEnable(HWI_HANDLE_T hwiNum)
Enable interrupts.
UINT32 LOS_HwiSetAffinity(HWI_HANDLE_T hwiNum, UINT32 cpuMask)
Interrupt response specified CPU processing.
UINT32 LOS_HwiSetPriority(HWI_HANDLE_T hwiNum, HWI_PRIOR_T priority)
Set interrupts priority.
struct tagIrqParam HWI_IRQ_PARAM_S
UINT16 HWI_MODE_T
Definition los_hwi.h:329
UINTPTR HWI_ARG_T
Definition los_hwi.h:336
UINT32 HWI_HANDLE_T
Definition los_hwi.h:317
UINT32 LOS_HwiTrigger(HWI_HANDLE_T hwiNum)
Trigger interrupts.
UINT32 LOS_HwiBhworkAdd(HWI_BOTTOM_HALF_FUNC bhHandler, void *data)
create a interrupt bottom half work.
#define LITE_OS_SEC_TEXT
Definition los_builddef.h:50
size_t IntActive(void)
unsigned short UINT16
Definition los_typedef.h:51
#define VOID
Definition los_typedef.h:88
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
Definition los_hwi.h:390
int swIrq
Definition los_hwi.h:391
const CHAR * pName
Definition los_hwi.h:393
void * pDevId
Definition los_hwi.h:392
Definition hal_uart_v151_regs_def.h:38