Compare commits
18 Commits
master
...
OpenHarmon
Author | SHA1 | Date |
---|---|---|
|
6997bcf648 | |
|
b65216740a | |
|
2d8e86ede0 | |
|
f750154f44 | |
|
6b26b1d825 | |
|
384bd910f4 | |
|
f5fe0b0217 | |
|
7d2fd01c2d | |
|
8cf05b45ec | |
|
6a53e1f3eb | |
|
c0bc99ca18 | |
|
fe6f342e8f | |
|
fc3349403c | |
|
2d7bf3b7d8 | |
|
7e4681fefb | |
|
c24363bc50 | |
|
74def19245 | |
|
c4ffb4fb6e |
4
Kconfig
4
Kconfig
|
@ -369,7 +369,7 @@ config KERNEL_LMK
|
|||
default n
|
||||
depends on KERNEL_EXTKERNEL
|
||||
help
|
||||
Configuration item for low momery killer tailoring.
|
||||
Configuration item for low memory killer tailoring.
|
||||
If you wish to build LiteOS with support for low memory killer.
|
||||
|
||||
config KERNEL_LMK_DEBUG
|
||||
|
@ -574,7 +574,7 @@ config MEM_LEAKCHECK
|
|||
depends on DEBUG_VERSION && MEM_DEBUG
|
||||
select KERNEL_BACKTRACE
|
||||
help
|
||||
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the infomations of mem node.
|
||||
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the informations of mem node.
|
||||
config BASE_MEM_NODE_INTEGRITY_CHECK
|
||||
bool "Enable integrity check or not"
|
||||
default n
|
||||
|
|
|
@ -85,11 +85,11 @@ Before setting up the environment for a development board, you must set up the b
|
|||
|
||||
For details about how to obtain the source code, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/get-code/sourcecode-acquire.md). This document assumes that the clone directory is `~/openHarmony` after the complete OpenHarmony repository code is obtained.
|
||||
|
||||
### Example projects that are already supported
|
||||
### Example projects
|
||||
|
||||
Qemu simulator: `arm_mps2_an386、esp32、riscv32_virt、SmartL_E802`, For details about how to compile and run, see [qemu guide](https://gitee.com/openharmony/device_qemu)
|
||||
Qemu simulator: `arm_mps2_an386、esp32、riscv32_virt、SmartL_E802`. For details about how to compile and run, see [qemu guide](https://gitee.com/openharmony/device_qemu).
|
||||
|
||||
Bestechnic: `bes2600`, For details about how to compile and run, see [Bestechnic developer guide](https://gitee.com/openharmony/device_soc_bestechnic)
|
||||
Bestechnic: `bes2600`. For details about how to compile and run, see [Bestechnic developer guide](https://gitee.com/openharmony/device_soc_bestechnic).
|
||||
|
||||
### Community Porting Project Links
|
||||
|
||||
|
@ -131,4 +131,4 @@ How to contribute a chip based on Liteos-M kernel:
|
|||
|
||||
[Kernel Subsystem](https://gitee.com/openharmony/docs/blob/HEAD/en/readme/kernel-subsystem.md)
|
||||
|
||||
**kernel\_liteos\_m**
|
||||
[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/master/README.md)
|
||||
|
|
|
@ -131,5 +131,5 @@ LiteOS-M内核移植的具体开发板的工程由社区开发者提供,可以
|
|||
|
||||
[内核子系统](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/readme/%E5%86%85%E6%A0%B8%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
|
||||
|
||||
**kernel\_liteos\_m**
|
||||
[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/master/README_zh.md)
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
|||
LITE_OS_SEC_TEXT_INIT VOID *ArchTskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack)
|
||||
{
|
||||
TaskContext *context = (TaskContext *)((UINTPTR)topStack + stackSize - sizeof(TaskContext));
|
||||
LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID);
|
||||
|
||||
context->r0 = taskID;
|
||||
context->r1 = 0x01010101L;
|
||||
|
|
|
@ -163,7 +163,6 @@ inline UINT32 ArchIsIntActive(VOID)
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
|
||||
|
|
|
@ -190,7 +190,7 @@ _hwiActiveCheck
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
; exc occured in IRQ
|
||||
; exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -228,19 +228,19 @@ _hwiActiveCheckNext
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
; exc occured in Task or Init or exc
|
||||
; exc occurred in Task or Init or exc
|
||||
; reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 ; OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP ; if exc occured in Init then branch
|
||||
BEQ _ExcInMSP ; if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED ;auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
; exc occured in Task
|
||||
; exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -40,14 +40,12 @@
|
|||
#include "los_memory.h"
|
||||
#include "los_membox.h"
|
||||
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
#ifdef __ICCARM__
|
||||
#pragma location = ".data.vector"
|
||||
#elif defined(__CC_ARM) || defined(__GNUC__)
|
||||
#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
LITE_OS_SEC_VEC
|
||||
#endif
|
||||
/* *
|
||||
|
@ -198,7 +196,6 @@ inline UINT32 ArchIsIntActive(VOID)
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
|
||||
|
@ -602,7 +599,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
|
|
@ -263,7 +263,7 @@ _hwiActiveCheck:
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
// exc occured in IRQ
|
||||
// exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -316,19 +316,19 @@ _hwiActiveCheckNext:
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
// exc occured in Task or Init or exc
|
||||
// exc occurred in Task or Init or exc
|
||||
// reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 // OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP // if exc occured in Init then branch
|
||||
BEQ _ExcInMSP // if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED //auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
// exc occured in Task
|
||||
// exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 // add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -41,10 +41,8 @@
|
|||
#include "los_membox.h"
|
||||
|
||||
#define DEF_HANDLER_START_INDEX 2
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
|
@ -189,7 +187,6 @@ inline UINT32 ArchIsIntActive(VOID)
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
|
||||
|
@ -593,7 +590,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
|
|
@ -247,7 +247,7 @@ _hwiActiveCheck:
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
// exc occured in IRQ
|
||||
// exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -300,19 +300,19 @@ _hwiActiveCheckNext:
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
// exc occured in Task or Init or exc
|
||||
// exc occurred in Task or Init or exc
|
||||
// reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 // OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP // if exc occured in Init then branch
|
||||
BEQ _ExcInMSP // if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED //auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
// exc occured in Task
|
||||
// exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 // add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -41,11 +41,8 @@
|
|||
#include "los_membox.h"
|
||||
|
||||
#define DEF_HANDLER_START_INDEX 2
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
* Hardware interrupt form mapping handling function array.
|
||||
|
@ -593,7 +590,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
|
|
@ -56,8 +56,8 @@ FLAG_ADDR_VALID EQU 0x10000
|
|||
FLAG_HWI_ACTIVE EQU 0x20000
|
||||
FLAG_NO_FLOAT EQU 0x10000000
|
||||
|
||||
OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Regeister
|
||||
OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Regeister
|
||||
OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Register
|
||||
OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Register
|
||||
OS_NVIC_BFAR EQU 0xE000ED38
|
||||
OS_NVIC_MMAR EQU 0xE000ED34
|
||||
OS_NVIC_ACT_BASE EQU 0xE000E300
|
||||
|
@ -190,7 +190,7 @@ _hwiActiveCheck
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
; exc occured in IRQ
|
||||
; exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -228,19 +228,19 @@ _hwiActiveCheckNext
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
; exc occured in Task or Init or exc
|
||||
; exc occurred in Task or Init or exc
|
||||
; reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 ; OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP ; if exc occured in Init then branch
|
||||
BEQ _ExcInMSP ; if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED ;auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
; exc occured in Task
|
||||
; exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ UINT32 g_intCount = 0;
|
|||
|
||||
/*lint -restore*/
|
||||
#pragma location = ".data.vector"
|
||||
#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
* hardware interrupt form mapping handling function array.
|
||||
|
|
|
@ -55,8 +55,8 @@ FLAG_ADDR_VALID EQU 0x10000
|
|||
FLAG_HWI_ACTIVE EQU 0x20000
|
||||
FLAG_NO_FLOAT EQU 0x10000000
|
||||
|
||||
OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Regeister
|
||||
OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Regeister
|
||||
OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Register
|
||||
OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Register
|
||||
OS_NVIC_BFAR EQU 0xE000ED38
|
||||
OS_NVIC_MMAR EQU 0xE000ED34
|
||||
OS_NVIC_ACT_BASE EQU 0xE000E300
|
||||
|
@ -179,7 +179,7 @@ _hwiActiveCheck
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
; exc occured in IRQ
|
||||
; exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -217,19 +217,19 @@ _hwiActiveCheckNext
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
; exc occured in Task or Init or exc
|
||||
; exc occurred in Task or Init or exc
|
||||
; reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 ; OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP ; if exc occured in Init then branch
|
||||
BEQ _ExcInMSP ; if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED ;auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
; exc occured in Task
|
||||
; exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ UINT32 g_intCount = 0;
|
|||
|
||||
/*lint -restore*/
|
||||
#pragma location = ".data.vector"
|
||||
#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
* hardware interrupt form mapping handling function array.
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "los_config.h"
|
||||
#include "los_list.h"
|
||||
|
||||
#pragma data_alignment=0x4
|
||||
#pragma data_alignment = 0x4
|
||||
STATIC UINT8 g_secureHeap[LOSCFG_SECURE_HEAP_SIZE] = {0};
|
||||
STATIC LOS_DL_LIST g_secureHeapFreeList = {NULL, NULL};
|
||||
|
||||
|
|
|
@ -263,7 +263,7 @@ _hwiActiveCheck:
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
// exc occured in IRQ
|
||||
// exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -316,19 +316,19 @@ _hwiActiveCheckNext:
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
// exc occured in Task or Init or exc
|
||||
// exc occurred in Task or Init or exc
|
||||
// reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 // OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP // if exc occured in Init then branch
|
||||
BEQ _ExcInMSP // if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED //auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
// exc occured in Task
|
||||
// exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 // add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -40,11 +40,8 @@
|
|||
#include "los_memory.h"
|
||||
#include "los_membox.h"
|
||||
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
* Hardware interrupt form mapping handling function array.
|
||||
|
@ -193,7 +190,6 @@ inline UINT32 ArchIsIntActive(VOID)
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
|
||||
|
@ -607,7 +603,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
|
|
@ -190,7 +190,7 @@ _hwiActiveCheck
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
; exc occured in IRQ
|
||||
; exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -228,19 +228,19 @@ _hwiActiveCheckNext
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
; exc occured in Task or Init or exc
|
||||
; exc occurred in Task or Init or exc
|
||||
; reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 ; OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP ; if exc occured in Init then branch
|
||||
BEQ _ExcInMSP ; if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED ;auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
; exc occured in Task
|
||||
; exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -41,13 +41,11 @@
|
|||
#include "los_memory.h"
|
||||
#include "los_membox.h"
|
||||
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
#ifdef __ICCARM__
|
||||
#pragma location = ".data.vector"
|
||||
#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
#elif defined(__CC_ARM) || defined(__GNUC__)
|
||||
LITE_OS_SEC_VEC
|
||||
#endif
|
||||
|
@ -603,7 +601,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
|
|
@ -260,7 +260,7 @@ _hwiActiveCheck:
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
// exc occured in IRQ
|
||||
// exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -313,19 +313,19 @@ _hwiActiveCheckNext:
|
|||
AND R2, R2, R3
|
||||
CMP R2, #0
|
||||
BNE _ExcInMSP
|
||||
// exc occured in Task or Init or exc
|
||||
// exc occurred in Task or Init or exc
|
||||
// reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 // OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP // if exc occured in Init then branch
|
||||
BEQ _ExcInMSP // if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED //auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
// exc occured in Task
|
||||
// exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 // add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -40,10 +40,8 @@
|
|||
#include "los_membox.h"
|
||||
|
||||
#define DEF_HANDLER_START_INDEX 2
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
|
@ -193,7 +191,6 @@ inline UINT32 ArchIsIntActive(VOID)
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
|
||||
|
|
|
@ -263,7 +263,7 @@ _hwiActiveCheck:
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
// exc occured in IRQ
|
||||
// exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -316,19 +316,19 @@ _hwiActiveCheckNext:
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
// exc occured in Task or Init or exc
|
||||
// exc occurred in Task or Init or exc
|
||||
// reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 // OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP // if exc occured in Init then branch
|
||||
BEQ _ExcInMSP // if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED //auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
// exc occured in Task
|
||||
// exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 // add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -40,11 +40,8 @@
|
|||
#include "los_memory.h"
|
||||
#include "los_membox.h"
|
||||
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
* Hardware interrupt form mapping handling function array.
|
||||
|
@ -188,7 +185,6 @@ inline UINT32 ArchIsIntActive(VOID)
|
|||
Output : None
|
||||
Return : None
|
||||
**************************************************************************** */
|
||||
/*lint -e529*/
|
||||
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
|
||||
{
|
||||
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
|
||||
|
@ -592,7 +588,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
|
|
@ -190,7 +190,7 @@ _hwiActiveCheck
|
|||
CMP R3, #0
|
||||
BEQ _hwiActiveCheckNext
|
||||
|
||||
; exc occured in IRQ
|
||||
; exc occurred in IRQ
|
||||
ORR R0, R0, #FLAG_HWI_ACTIVE
|
||||
RBIT R2, R3
|
||||
CLZ R2, R2
|
||||
|
@ -228,19 +228,19 @@ _hwiActiveCheckNext
|
|||
AND R2, R2,R3
|
||||
CMP R2,#0
|
||||
BNE _ExcInMSP
|
||||
; exc occured in Task or Init or exc
|
||||
; exc occurred in Task or Init or exc
|
||||
; reserved for register info from task stack
|
||||
|
||||
LDR R2, =g_taskScheduled
|
||||
LDR R2, [R2]
|
||||
TST R2, #1 ; OS_FLG_BGD_ACTIVE
|
||||
BEQ _ExcInMSP ; if exc occured in Init then branch
|
||||
BEQ _ExcInMSP ; if exc occurred in Init then branch
|
||||
|
||||
|
||||
CMP LR, #0xFFFFFFED ;auto push floating registers
|
||||
BNE _NoFloatInPsp
|
||||
|
||||
; exc occured in Task
|
||||
; exc occurred in Task
|
||||
MOV R2, R13
|
||||
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
|
||||
|
||||
|
|
|
@ -41,12 +41,10 @@
|
|||
#include "los_memory.h"
|
||||
#include "los_membox.h"
|
||||
|
||||
/*lint -save -e40 -e522 -e533*/
|
||||
UINT32 g_intCount = 0;
|
||||
|
||||
/*lint -restore*/
|
||||
#pragma location = ".data.vector"
|
||||
#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
|
||||
/* *
|
||||
* @ingroup los_hwi
|
||||
* Hardware interrupt form mapping handling function array.
|
||||
|
@ -599,7 +597,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
|||
|
||||
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
|
||||
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
|
||||
|
||||
|
||||
/* Enable DIV 0 and unaligned exception */
|
||||
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ exc_entry:
|
|||
csrr a0, mcause
|
||||
mv a1, sp
|
||||
/*
|
||||
* TODO: Call the exception handler function
|
||||
* By default, the function template is provided in
|
||||
* system_Device.c, you can adjust it as you want
|
||||
*/
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
* Based on the types of the four 8-bit arithmetic operations, the SIMD 8-bit add/subtract instructions
|
||||
* can be classified into 2 main categories: Addition (four 8-bit addition), and Subtraction (four 8-bit
|
||||
* subtraction).
|
||||
* Based on the way of how an overflow condition is handled for singed or unsigned operation, the
|
||||
* Based on the way of how an overflow condition is handled for signed or unsigned operation, the
|
||||
* SIMD 8-bit add/subtract instructions can be classified into 5 groups: Wrap-around (dropping
|
||||
* overflow), Signed Halving (keeping overflow by dropping 1 LSB bit), Unsigned Halving, Signed
|
||||
* Saturation (clipping overflow), and Unsigned Saturation.
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#define _LOS_ARCH_ATOMIC_H
|
||||
|
||||
#include "los_compiler.h"
|
||||
#include "los_interrupt.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
|
|
@ -332,7 +332,7 @@ VOID HalExcEntry(const LosExcContext *excBufAddr)
|
|||
ExcInfoDisplay(excBufAddr);
|
||||
|
||||
if (LOS_TaskIsRunning()) {
|
||||
PRINTK("----------------All Task infomation ------------\n");
|
||||
PRINTK("----------------All Task information ------------\n");
|
||||
OsGetAllTskInfo();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ extern "C" {
|
|||
#define CODE_SECTION_NAME ".text"
|
||||
/* The default C stack section name is CSTACK */
|
||||
#define CSTACK_SECTION_NAME "CSTACK"
|
||||
#pragma section=CODE_SECTION_NAME
|
||||
#pragma section=CSTACK_SECTION_NAME
|
||||
#pragma section = CODE_SECTION_NAME
|
||||
#pragma section = CSTACK_SECTION_NAME
|
||||
|
||||
/* Default only one code section. In fact, there may be more than one.
|
||||
You can define more than one and redefine the OsStackDataIsCodeAddr function
|
||||
|
|
|
@ -82,7 +82,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit()
|
|||
|
||||
/*****************************************************************************
|
||||
Function : OsTskCycleStart
|
||||
Description: start task to get cycles count in current task begining
|
||||
Description: start task to get cycles count in current task beginning
|
||||
Input : None
|
||||
Return : None
|
||||
*****************************************************************************/
|
||||
|
|
|
@ -73,8 +73,8 @@ const SymInfo symTableEnd __attribute__((section(".table.end"))) = {
|
|||
.name = "end",
|
||||
.addr = 0
|
||||
};
|
||||
#pragma section=".TABLE.START"
|
||||
#pragma section=".table.end"
|
||||
#pragma section = ".TABLE.START"
|
||||
#pragma section = ".table.end"
|
||||
#elif defined(__CLANG_ARM) || defined(__GNUC__)
|
||||
/**
|
||||
* Place instructions below in rodata segment of .ld linker file:
|
||||
|
@ -796,13 +796,13 @@ VOID *LOS_SoLoad(const CHAR *fileName, VOID *pool)
|
|||
return dso;
|
||||
|
||||
ERR2:
|
||||
LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
|
||||
(VOID)LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
|
||||
ERR1:
|
||||
close(dso->fd);
|
||||
(VOID)LOS_MuxPost(g_dynlinkMux);
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo->elfPhdr);
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, dso);
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo->elfPhdr);
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -902,9 +902,12 @@ INT32 LOS_SoUnload(VOID *handle)
|
|||
LOS_ListDelete(&dso->dsoNode);
|
||||
(VOID)LOS_MuxPost(g_dynlinkMux);
|
||||
|
||||
LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, dso);
|
||||
(VOID)LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
|
||||
if (dso->dlInfo != NULL) {
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo->elfPhdr);
|
||||
}
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso);
|
||||
|
||||
return LOS_OK;
|
||||
ERR:
|
||||
|
|
|
@ -169,7 +169,7 @@ VOID *LOS_SoLoad(const CHAR *fileName, VOID *pool);
|
|||
VOID *LOS_FindSym(VOID *handle, const CHAR *name);
|
||||
|
||||
/*
|
||||
* @brief Decrement the reference count on the loaded shared library refered to by handle.
|
||||
* @brief Decrement the reference count on the loaded shared library referred to by handle.
|
||||
* If the reference count drops to zero, then the library is unloaded.
|
||||
*
|
||||
* This function validates that the handle is valid.
|
||||
|
|
|
@ -55,7 +55,7 @@ STATIC ExcInfoArray g_excArray[OS_EXC_TYPE_MAX];
|
|||
|
||||
STATIC UINT32 OsExcSaveIntStatus(UINT32 type, VOID *arg)
|
||||
{
|
||||
UINT32 ret;
|
||||
errno_t ret;
|
||||
UINTPTR excContentEnd = (UINTPTR)MAX_INT_INFO_SIZE + (UINTPTR)g_excContent;
|
||||
|
||||
(VOID)arg;
|
||||
|
@ -92,6 +92,9 @@ STATIC UINT32 OsExcSaveIntStatus(UINT32 type, VOID *arg)
|
|||
/* save IRQ Priority reg group */
|
||||
ret = memcpy_s(g_excContent, excContentEnd - (UINTPTR)g_excContent,
|
||||
(const VOID *)OS_NVIC_PRI_BASE, OS_NVIC_INT_PRI_SIZE);
|
||||
if (ret != EOK) {
|
||||
return LOS_NOK;
|
||||
}
|
||||
g_excContent = (UINT8 *)g_excContent + OS_NVIC_INT_PRI_SIZE;
|
||||
|
||||
/* save Exception Priority reg group */
|
||||
|
@ -294,5 +297,3 @@ VOID OsExcMsgDumpInit(VOID)
|
|||
(VOID)LOS_RegExcHook(EXC_INTERRUPT, (ExcHookFn)OsExcMsgDump);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -336,19 +336,19 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
|
|||
if (target == NULL || fileSystemType == NULL || data == NULL) {
|
||||
errno = EFAULT;
|
||||
ret = VFS_ERROR;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (strcmp(fileSystemType, "littlefs") != 0) {
|
||||
errno = ENODEV;
|
||||
ret = VFS_ERROR;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(target, &fileOpInfo)) {
|
||||
errno = EBUSY;
|
||||
ret = VFS_ERROR;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
// select free mount resource
|
||||
|
@ -356,7 +356,7 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
|
|||
if (fileOpInfo == NULL) {
|
||||
errno = ENODEV;
|
||||
ret = VFS_ERROR;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
ret = lfs_mount(&(fileOpInfo->lfsInfo), (struct lfs_config*)data);
|
||||
|
@ -372,7 +372,7 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
|
|||
ret = VFS_ERROR;
|
||||
}
|
||||
|
||||
errout:
|
||||
ERROUT:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -483,23 +483,23 @@ DIR *LfsOpendir(const char *dirName)
|
|||
|
||||
if (dirName == NULL) {
|
||||
errno = EFAULT;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(dirName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (CheckDirIsOpen(dirName)) {
|
||||
errno = EBUSY;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
FileDirInfo *dirInfo = GetFreeDir(dirName);
|
||||
if (dirInfo == NULL) {
|
||||
errno = ENFILE;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
ret = lfs_dir_open(&(fileOpInfo->lfsInfo), (lfs_dir_t *)(&(dirInfo->dir)), dirName);
|
||||
|
@ -507,14 +507,14 @@ DIR *LfsOpendir(const char *dirName)
|
|||
if (ret != 0) {
|
||||
FreeDirInfo(dirName);
|
||||
errno = LittlefsErrno(ret);
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
dirInfo->lfsHandle = &(fileOpInfo->lfsInfo);
|
||||
|
||||
return (DIR *)dirInfo;
|
||||
|
||||
errout:
|
||||
ERROUT:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -584,23 +584,23 @@ int LfsOpen(const char *pathName, int openFlag, ...)
|
|||
|
||||
if (pathName == NULL) {
|
||||
errno = EFAULT;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (CheckPathIsMounted(pathName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
|
||||
errno = ENOENT;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
// if file is already open, return invalid fd
|
||||
if (CheckFileIsOpen(pathName)) {
|
||||
errno = EBUSY;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
LittleFsHandleStruct *fsHandle = LfsAllocFd(pathName, &fd);
|
||||
if (fd == INVALID_FD) {
|
||||
errno = ENFILE;
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
int lfsOpenFlag = ConvertFlagToLfsOpenFlag(openFlag);
|
||||
|
@ -608,13 +608,13 @@ int LfsOpen(const char *pathName, int openFlag, ...)
|
|||
if (err != 0) {
|
||||
LfsFreeFd(fd);
|
||||
errno = LittlefsErrno(err);
|
||||
goto errout;
|
||||
goto ERROUT;
|
||||
}
|
||||
|
||||
g_handle[fd].lfsHandle = &(fileOpInfo->lfsInfo);
|
||||
return fd;
|
||||
|
||||
errout:
|
||||
ERROUT:
|
||||
return INVALID_FD;
|
||||
}
|
||||
|
||||
|
|
|
@ -269,6 +269,10 @@ int LOS_Open(const char *path, int oflag, ...)
|
|||
}
|
||||
|
||||
size_t pathLen = strlen(path) + 1;
|
||||
if ((unsigned)pathLen > PATH_MAX) {
|
||||
errno = EINVAL;
|
||||
return FS_FAILURE;
|
||||
}
|
||||
char *canonicalPath = (char *)malloc(pathLen);
|
||||
if (!canonicalPath) {
|
||||
errno = ENOMEM;
|
||||
|
|
|
@ -54,7 +54,7 @@ void __DLIB_TLS_MEMORY *__iar_dlib_perthread_access(void _DLIB_TLS_MEMORY *symbp
|
|||
}
|
||||
|
||||
#else /* IAR version 8 or above. */
|
||||
#pragma section="__iar_tls$$DATA"
|
||||
#pragma section = "__iar_tls$$DATA"
|
||||
void *__aeabi_read_tp(void)
|
||||
{
|
||||
if (!LOS_TaskIsRunning()) {
|
||||
|
@ -211,4 +211,4 @@ void __iar_file_Mtxunlock(__iar_Rmtx *m)
|
|||
if (LOS_TaskIsRunning()) {
|
||||
(void)LOS_MuxPost(muxInfo->muxID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ typedef struct {
|
|||
* @param lmkNode [IN] The LosLmkOpsNode node to be registered.
|
||||
*
|
||||
* @retval LOS_OK The LosLmkOpsNode node is registered successfully.
|
||||
* @retval LOS_ERRNO_LMK_INVALID_PARAMETER The paramter is invalid.
|
||||
* @retval LOS_ERRNO_LMK_INVALID_PARAMETER The parameter is invalid.
|
||||
* @retval LOS_ERRNO_LMK_ALREADY_REGISTERED The LosLmkOpsNode node already registered.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_lmk.h: the header file that contains the API declaration.</li></ul>
|
||||
|
|
|
@ -182,11 +182,12 @@ VOID LOS_LmsCheckPoolDel(const VOID *pool)
|
|||
LmsMemListNode *delNode = OsLmsGetPoolNode(pool);
|
||||
if (delNode == NULL) {
|
||||
PRINT_ERR("[LMS]pool %p is not on lms checklist !\n", pool);
|
||||
goto Release;
|
||||
goto REALEASE;
|
||||
}
|
||||
delNode->used = LMS_POOL_UNUSED;
|
||||
LOS_ListDelete(&(delNode->node));
|
||||
Release:
|
||||
|
||||
REALEASE:
|
||||
LMS_UNLOCK(intSave);
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
|||
u16_t *a16 = (u16_t *)addr->addr;
|
||||
int squash_pos = ipv6_blocks;
|
||||
int i;
|
||||
const char *sc = cp;
|
||||
const unsigned char *sc = (const unsigned char *)cp;
|
||||
const char *ss = cp-1;
|
||||
|
||||
for (; ; sc++) {
|
||||
|
|
|
@ -217,19 +217,11 @@ void lwip_ifconfig_show_internal(void *arg)
|
|||
sys_sem_signal(&ifconfig_cmd->cb_completed);
|
||||
}
|
||||
|
||||
/*lint -e838 -e438*/
|
||||
u32_t lwip_ifconfig(int argc, const char **argv)
|
||||
{
|
||||
static struct ifconfig_option ifconfig_cmd;
|
||||
err_t ret;
|
||||
|
||||
#if LWIP_STATS
|
||||
u32_t stat_err_cnt;
|
||||
u32_t stat_drop_cnt;
|
||||
u32_t stat_rx_or_tx_cnt;
|
||||
u32_t stat_rx_or_tx_bytes;
|
||||
#endif
|
||||
|
||||
(void)memset_s(&ifconfig_cmd, sizeof(ifconfig_cmd), 0, sizeof(ifconfig_cmd));
|
||||
if (sys_sem_new(&ifconfig_cmd.cb_completed, 0) != ERR_OK) {
|
||||
PRINTK("%s: sys_sem_new fail\n", __FUNCTION__);
|
||||
|
@ -252,7 +244,6 @@ u32_t lwip_ifconfig(int argc, const char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
/*lint +e838 +e438*/
|
||||
|
||||
#if LWIP_DNS
|
||||
#ifndef LWIP_TESTBED
|
||||
|
@ -278,7 +269,7 @@ struct hostent *gethostnameinfo(const char *host, char *tmphstbuf, size_t hstbuf
|
|||
LWIP_STATIC unsigned int get_hostip(const char *hname)
|
||||
{
|
||||
unsigned int ip = 0;
|
||||
int ret;
|
||||
errno_t ret;
|
||||
const size_t hstbuflen = 1024;
|
||||
char *tmphstbuf = NULL;
|
||||
|
||||
|
@ -291,8 +282,8 @@ LWIP_STATIC unsigned int get_hostip(const char *hname)
|
|||
free(tmphstbuf);
|
||||
return 0;
|
||||
}
|
||||
ret = memcpy_s(&ip, sizeof(ip), pent->h_addr, 4);
|
||||
if (ret != 0) {
|
||||
ret = memcpy_s(&ip, sizeof(ip), pent->h_addr, sizeof(pent->h_addr));
|
||||
if (ret != EOK) {
|
||||
free(tmphstbuf);
|
||||
return 0;
|
||||
}
|
||||
|
@ -419,7 +410,7 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
|||
/* Accessing ip header and icmp header */
|
||||
iphdr_resp = pbuf_resp->payload;
|
||||
|
||||
ip_hlen = (IPH_HL(iphdr_resp) << 2);
|
||||
ip_hlen = (IPH_HL(iphdr_resp) << 2); /* 2: offset */
|
||||
if (pbuf_header(pbuf_resp, -ip_hlen)) {
|
||||
/* this failure will never happen, but failure handle is written just to be in safe side */
|
||||
PRINTK("Ping : memory management failure\n");
|
||||
|
@ -437,7 +428,8 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
|||
((ICMPH_TYPE(iecho_resp) == ICMP_ECHO) && (iphdr_resp->src.addr == to.sin_addr.s_addr))) {
|
||||
/* second type timeout event */
|
||||
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &end);
|
||||
timout_ms = ((end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000);
|
||||
timout_ms = ((end.tv_sec - start.tv_sec) * OS_SYS_MS_PER_SECOND + \
|
||||
(end.tv_nsec - start.tv_nsec) / OS_SYS_NS_PER_MS);
|
||||
timout_ms = LWIP_SHELL_CMD_PING_TIMEOUT - timout_ms;
|
||||
} else {
|
||||
timout_ms = 0;
|
||||
|
@ -454,7 +446,8 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
|||
}
|
||||
/* capture the end time to calculate round trip time */
|
||||
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &end);
|
||||
rtt = ((end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000);
|
||||
rtt = ((end.tv_sec - start.tv_sec) * OS_SYS_MS_PER_SECOND + \
|
||||
(end.tv_nsec - start.tv_nsec) / OS_SYS_NS_PER_MS);
|
||||
|
||||
if (iphdr_resp->src.addr == to.sin_addr.s_addr) {
|
||||
switch (ICMPH_TYPE(iecho_resp)) {
|
||||
|
@ -470,12 +463,12 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
|||
/* delay 1s for every successful ping */
|
||||
intrvl = interval;
|
||||
do {
|
||||
if (intrvl < 1000) {
|
||||
if (intrvl < 1000) { /* 1000: 1000ms = 1s */
|
||||
sys_msleep(intrvl);
|
||||
break;
|
||||
}
|
||||
intrvl -= 1000;
|
||||
sys_msleep(1000);
|
||||
intrvl -= 1000; /* 1000: 1000ms = 1s */
|
||||
sys_msleep(1000); /* 1000: 1000ms = 1s */
|
||||
if (ping_kill == 1)
|
||||
break;
|
||||
} while (intrvl > 0);
|
||||
|
@ -497,7 +490,7 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
|||
PRINTK("\nPing: parameter problem ...");
|
||||
break;
|
||||
default:
|
||||
PRINTK("\nPing: unknow error ...");
|
||||
PRINTK("\nPing: unknown error ...");
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
|
@ -527,7 +520,7 @@ static void ping_cmd(u32_t *parg)
|
|||
if (ret < 0) {
|
||||
PRINTK("Ping cmd failed due to some errors\n");
|
||||
}
|
||||
|
||||
free(parg);
|
||||
ping_taskid = -1;
|
||||
}
|
||||
|
||||
|
@ -565,7 +558,7 @@ u32_t OsShellPing(int argc, const char **argv)
|
|||
return LOS_NOK;
|
||||
}
|
||||
|
||||
parg = (u32_t *)malloc(4 * sizeof(int));
|
||||
parg = (u32_t *)malloc(4 * sizeof(int)); /* 4: number of args */
|
||||
if (parg == NULL) {
|
||||
return LOS_NOK;
|
||||
}
|
||||
|
@ -584,12 +577,11 @@ u32_t OsShellPing(int argc, const char **argv)
|
|||
stPingTask.pfnTaskEntry = (TSK_ENTRY_FUNC)ping_cmd;
|
||||
stPingTask.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
|
||||
stPingTask.pcName = "ping_task";
|
||||
stPingTask.usTaskPrio = 8; /* higher than shell */
|
||||
stPingTask.usTaskPrio = 8; /* 8: higher than shell */
|
||||
stPingTask.uwResved = LOS_TASK_STATUS_DETACHED;
|
||||
stPingTask.uwArg = (UINTPTR)parg;
|
||||
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
|
||||
if (ret != LOS_OK) {
|
||||
free(parg);
|
||||
PRINTK("ping_task create failed 0x%08x.\n", ret);
|
||||
count = LWIP_SHELL_CMD_PING_RETRY_TIMES;
|
||||
} else {
|
||||
|
@ -605,6 +597,8 @@ u32_t OsShellPing(int argc, const char **argv)
|
|||
PRINTK("Ping cmd failed due some errors\n");
|
||||
}
|
||||
|
||||
free(parg);
|
||||
|
||||
return LOS_OK;
|
||||
ping_error:
|
||||
lwip_ping_usage();
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
#include <lwip/snmp.h>
|
||||
#include <lwip/etharp.h>
|
||||
#include <lwip/sockets.h>
|
||||
#include <lwip/snmp.h>
|
||||
#include <lwip/etharp.h>
|
||||
#include <lwip/ethip6.h>
|
||||
|
||||
#define LWIP_NETIF_HOSTNAME_DEFAULT "default"
|
||||
|
|
|
@ -33,11 +33,9 @@
|
|||
#include <lwip/sys.h>
|
||||
#include <lwip/debug.h>
|
||||
#include <los_task.h>
|
||||
#include <los_tick.h>
|
||||
#include <los_queue.h>
|
||||
#include <los_sem.h>
|
||||
#include <los_mux.h>
|
||||
#include <los_tick.h>
|
||||
#include <los_config.h>
|
||||
|
||||
#ifndef LOSCFG_KERNEL_SMP
|
||||
|
@ -151,7 +149,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size)
|
|||
}
|
||||
|
||||
CHAR qName[] = "lwIP";
|
||||
UINT32 ret = LOS_QueueCreate(qName, (UINT16)size, mbox, 0, sizeof(void *));
|
||||
UINT32 ret = LOS_QueueCreate(qName, (UINT16)size, (UINT32 *)mbox, 0, sizeof(void *));
|
||||
switch (ret) {
|
||||
case LOS_OK:
|
||||
return ERR_OK;
|
||||
|
@ -202,6 +200,8 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg)
|
|||
|
||||
err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg)
|
||||
{
|
||||
(void)mbox;
|
||||
(void)msg;
|
||||
return ERR_ARG;
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ err_t sys_sem_new(sys_sem_t *sem, u8_t count)
|
|||
return ERR_ARG;
|
||||
}
|
||||
|
||||
UINT32 ret = LOS_SemCreate(count, sem);
|
||||
UINT32 ret = LOS_SemCreate(count, (UINT32 *)(sem));
|
||||
if (ret != LOS_OK) {
|
||||
return ERR_ARG;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex)
|
|||
return ERR_ARG;
|
||||
}
|
||||
|
||||
UINT32 ret = LOS_MuxCreate(mutex);
|
||||
UINT32 ret = LOS_MuxCreate((UINT32 *)mutex);
|
||||
if (ret != LOS_OK) {
|
||||
return ERR_ARG;
|
||||
}
|
||||
|
|
|
@ -217,7 +217,6 @@ static void ParsePackageIpUdp(struct netif *netif, struct pbuf *btBuf)
|
|||
ICUNIT_ASSERT_EQUAL(dataLen, strlen(MSG), 4);
|
||||
LogPrintln("=================================");
|
||||
|
||||
// 回应udp报文
|
||||
ReplayUdpTask();
|
||||
}
|
||||
|
||||
|
@ -229,7 +228,6 @@ static void ParsePackageEthernet(struct netif *netif, struct pbuf *p)
|
|||
ethhdr = (struct eth_hdr *)p->payload;
|
||||
u16_t type = ethhdr->type;
|
||||
|
||||
LogPrintln("ParsePackageEthernet type is %d", type);
|
||||
switch (type) {
|
||||
#if LWIP_IPV4 && LWIP_ARP
|
||||
/* IP packet? */
|
||||
|
@ -322,7 +320,6 @@ static void UdpTestNetifTask(void *p)
|
|||
struct ifreq nif;
|
||||
int ret;
|
||||
|
||||
// 注册网卡
|
||||
btProxyNf = CreateBtNetIf();
|
||||
|
||||
/* socket creation */
|
||||
|
@ -335,7 +332,6 @@ static void UdpTestNetifTask(void *p)
|
|||
ret = bind(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr));
|
||||
LWIP_ASSERT("socket invalid param.", ret == 0);
|
||||
|
||||
/* 指定网卡接口 */
|
||||
char *inface = NETIF_NAME_BT;
|
||||
(void)strcpy_s(nif.ifr_name, sizeof(nif.ifr_name), inface);
|
||||
if (setsockopt(sfd, SOL_SOCKET, SO_BINDTODEVICE, (char *)&nif, sizeof(nif)) < 0) {
|
||||
|
@ -393,7 +389,6 @@ static void ArpPackageProc(struct netif *netif, struct pbuf *p)
|
|||
return;
|
||||
}
|
||||
|
||||
// 回应arp报文
|
||||
ReplayArpTask();
|
||||
}
|
||||
|
||||
|
@ -446,4 +441,4 @@ static void ReplayArpTask()
|
|||
ret = sys_thread_new("replay_arp", ReplayArp, NULL,
|
||||
STACK_TEST_SIZE, TCPIP_THREAD_PRIO);
|
||||
ICUNIT_ASSERT_NOT_EQUAL(ret, -1, 23);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ STATIC VOID OsPmTickTimerStart(LosPmCB *pm)
|
|||
}
|
||||
|
||||
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
|
||||
if (tickTimer->timerStop != NULL) {
|
||||
if ((tickTimer->timerStop != NULL) && (pm->enterSleepTime != 0)) {
|
||||
/* Restore the main CPU frequency */
|
||||
sleepTime = tickTimer->timerCycleGet();
|
||||
tickTimer->timerStop();
|
||||
|
@ -123,8 +123,9 @@ STATIC VOID OsPmTickTimerStart(LosPmCB *pm)
|
|||
STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
|
||||
{
|
||||
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
|
||||
UINT64 sleepCycle;
|
||||
UINT64 realSleepTime = OsSchedGetNextExpireTime(OsGetCurrSchedTimeCycle());
|
||||
UINT64 sleepCycle, realSleepTime;
|
||||
UINT64 currTime = OsGetCurrSchedTimeCycle();
|
||||
UINT64 expireTime = OsSchedGetNextExpireTime(currTime);
|
||||
#endif
|
||||
LosPmTickTimer *tickTimer = pm->tickTimer;
|
||||
|
||||
|
@ -134,10 +135,9 @@ STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
|
|||
|
||||
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
|
||||
if (tickTimer->timerStart != NULL) {
|
||||
if (realSleepTime == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
LOS_ASSERT(expireTime > currTime);
|
||||
|
||||
realSleepTime = expireTime - currTime;
|
||||
sleepCycle = OS_SYS_CYCLE_TO_NS(realSleepTime, g_sysClock);
|
||||
sleepCycle = OS_SYS_NS_TO_CYCLE(sleepCycle, tickTimer->freq);
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ typedef enum {
|
|||
|
||||
/*
|
||||
* Hook for user-defined debug function
|
||||
* Unify differnt module's func for registration
|
||||
* Unify different module's func for registration
|
||||
*/
|
||||
typedef UINT32 (*CmdCallBackFunc)(UINT32 argc, const CHAR **argv);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ STATIC INLINE VOID SetErrno(INT32 errcode)
|
|||
STATIC INLINE VOID SetErr(INT32 errcode, const CHAR *errMessage)
|
||||
{
|
||||
SetErrno(errcode);
|
||||
PRINTK(errMessage);
|
||||
PRINTK("%s", errMessage);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -69,10 +69,10 @@ CmdModInfo *OsCmdInfoGet(VOID)
|
|||
}
|
||||
|
||||
/*
|
||||
* Description: Pass in the string and clear useless space ,which inlcude:
|
||||
* Description: Pass in the string and clear useless space ,which include:
|
||||
* 1) The overmatch space which is not be marked by Quote's area
|
||||
* Squeeze the overmatch space into one space
|
||||
* 2) Clear all space before first vaild charatctor
|
||||
* 2) Clear all space before first vaild character
|
||||
* Input: cmdKey : Pass in the buff string, which is ready to be operated
|
||||
* cmdOut : Pass out the buffer string ,which has already been operated
|
||||
* size : cmdKey length
|
||||
|
@ -98,6 +98,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
|
|||
PRINTK("malloc failure in %s[%d]", __FUNCTION__, __LINE__);
|
||||
return (UINT32)OS_ERROR;
|
||||
}
|
||||
(VOID)memset_s(output, len + 1, 0, len + 1);
|
||||
/* Backup the 'output' start address */
|
||||
outputBak = output;
|
||||
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invaild charactor */
|
||||
|
@ -110,7 +111,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
|
|||
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
|
||||
/* 2) Current charactor is a space */
|
||||
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
|
||||
/* 4) Invaild charactor, such as single quotes */
|
||||
/* 4) Invalid charactor, such as single quotes */
|
||||
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ CHAR *GetCmdName(const CHAR *cmdline, UINT32 len)
|
|||
continue;
|
||||
}
|
||||
/* If detected a space which the quotes matching status is false */
|
||||
/* which said has detected the first space for seperator, finish this scan operation */
|
||||
/* which said has detected the first space for separator, finish this scan operation */
|
||||
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -203,14 +203,14 @@ STATIC CHAR *VfsNormalizeFullpath(const CHAR *directory, const CHAR *filename, C
|
|||
CHAR *fullpath = NULL;
|
||||
|
||||
if (filename[0] != '/') {
|
||||
/* not a absolute path */
|
||||
/* not an absolute path */
|
||||
|
||||
fullpath = VfsNotAbsolutePath(directory, filename, pathname, namelen);
|
||||
if (fullpath == NULL) {
|
||||
return (CHAR *)NULL;
|
||||
}
|
||||
} else {
|
||||
/* it's a absolute path, use it directly */
|
||||
/* it's an absolute path, use it directly */
|
||||
|
||||
fullpath = strdup(filename); /* copy string */
|
||||
if (fullpath == NULL) {
|
||||
|
|
|
@ -130,7 +130,7 @@ STATIC CHAR *OsLsGetFullpath(const CHAR *path, struct dirent *pdirent)
|
|||
goto exit_with_nomem;
|
||||
}
|
||||
|
||||
ret = snprintf_s(fullpath, pathLen, pathLen, "%s/%s", path, pdirent->d_name);
|
||||
ret = snprintf_s(fullpath, pathLen, pathLen - 1, "%s/%s", path, pdirent->d_name);
|
||||
if (ret < 0) {
|
||||
free(fullpath);
|
||||
return NULL;
|
||||
|
@ -209,6 +209,7 @@ VOID OsLs(const CHAR *pathname)
|
|||
}
|
||||
} while (pdirent != NULL);
|
||||
|
||||
free(path);
|
||||
(VOID)closedir(d);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ STATIC VOID OsTraceSetFrame(TraceEventFrame *frame, UINT32 eventType, UINTPTR id
|
|||
#if (LOSCFG_TRACE_FRAME_CORE_MSG == 1)
|
||||
frame->core.cpuId = ArchCurrCpuid();
|
||||
frame->core.hwiActive = OS_INT_ACTIVE ? TRUE : FALSE;
|
||||
frame->core.taskLockCnt = MIN(OsPercpuGet()->taskLockCnt, 0xF); /* taskLockCnt is 4 bits, max vaule = 0xF */
|
||||
frame->core.taskLockCnt = MIN(OsPercpuGet()->taskLockCnt, 0xF); /* taskLockCnt is 4 bits, max value = 0xF */
|
||||
frame->core.paramCount = paramCount;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ typedef struct {
|
|||
|
||||
/**
|
||||
* @ingroup los_trace
|
||||
* struct to store the event infomation
|
||||
* struct to store the event information
|
||||
*/
|
||||
typedef struct {
|
||||
UINT32 eventType; /**< event type */
|
||||
|
@ -304,9 +304,9 @@ extern TRACE_EVENT_HOOK g_traceEventHook;
|
|||
* <li>The first param is treat as key, keep at least this param if you want trace this event.</li>
|
||||
* <li>All parameters were treated as UINTPTR.</li>
|
||||
* </ul>
|
||||
* eg. Trace a event as:
|
||||
* eg. Trace an event as:
|
||||
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId, taskStatus, oldPrio, newPrio
|
||||
* eg. Not Trace a event as:
|
||||
* eg. Not Trace an event as:
|
||||
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio)
|
||||
* eg. Trace only you need parmas as:
|
||||
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId
|
||||
|
|
|
@ -96,7 +96,7 @@ typedef struct {
|
|||
|
||||
/**
|
||||
* @ingroup los_trace
|
||||
* struct to store the event infomation
|
||||
* struct to store the event information
|
||||
*/
|
||||
typedef struct {
|
||||
UINT32 cmd; /* trace start or stop cmd */
|
||||
|
|
|
@ -134,7 +134,7 @@ VOID OsTraceDataSend(UINT8 type, UINT16 len, UINT8 *data)
|
|||
UINT32 intSave;
|
||||
UINT8 outBuf[LOSCFG_TRACE_TLV_BUF_SIZE] = {0};
|
||||
|
||||
if ((type > TRACE_MSG_MAX) || (len > LOSCFG_TRACE_TLV_BUF_SIZE)) {
|
||||
if ((type >= TRACE_MSG_MAX) || (len > LOSCFG_TRACE_TLV_BUF_SIZE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ STATIC VOID OsTraceInfoEventData(VOID)
|
|||
UINT32 taskLockCnt = frame->core.taskLockCnt;
|
||||
#if (LOSCFG_KERNEL_SMP == 1)
|
||||
/*
|
||||
* For smp systems, TRACE_LOCK will requst taskLock, and this counter
|
||||
* For smp systems, TRACE_LOCK will request taskLock, and this counter
|
||||
* will increase by 1 in that case.
|
||||
*/
|
||||
taskLockCnt -= 1;
|
||||
|
|
|
@ -1634,7 +1634,7 @@ uint32_t osMemoryPoolGetSpace(osMemoryPoolId_t mp_id)
|
|||
if ((mp->status & MEM_POOL_VALID) != MEM_POOL_VALID) {
|
||||
space = 0;
|
||||
} else {
|
||||
space = mp->poolInfo.uwBlkCnt - mp->poolInfo.uwBlkCnt;
|
||||
space = mp->poolInfo.uwBlkNum - mp->poolInfo.uwBlkCnt;
|
||||
}
|
||||
LOS_IntRestore(intSave);
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
#ifndef _ADAPT_SYS_PRCTL_H
|
||||
#define _ADAPT_SYS_PRCTL_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
|
@ -31,6 +28,9 @@
|
|||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _ADAPT_SYS_PRCTL_H
|
||||
#define _ADAPT_SYS_PRCTL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
int _isatty(int file)
|
||||
{
|
||||
return file <= 2;
|
||||
return (int)(file <= 2); // 2: stderr
|
||||
}
|
||||
|
||||
int _kill(int i, int j)
|
||||
|
@ -52,7 +52,7 @@ int _getpid(void)
|
|||
|
||||
void _exit(int status)
|
||||
{
|
||||
write(1, "exit\n", 5);
|
||||
write(1, "exit\n", 5); // 1: stdout; 5: string length
|
||||
(VOID)pthread_exit(&status);
|
||||
while (1) {
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ STATIC size_t PipeRingbufferRead(struct PipeDev *dev, VOID *buf, size_t len)
|
|||
}
|
||||
}
|
||||
nbytes = (nbytes > len) ? len : nbytes;
|
||||
(VOID)memcpy_s((char *)buf, len, dev->ringBuffer + dev->readIndex, nbytes);
|
||||
(VOID)memcpy_s(buf, len, dev->ringBuffer + dev->readIndex, nbytes);
|
||||
dev->readIndex += nbytes;
|
||||
if (dev->readIndex >= dev->bufferSize) {
|
||||
dev->readIndex = 0;
|
||||
|
@ -184,7 +184,7 @@ STATIC size_t PipeRingbufferRead(struct PipeDev *dev, VOID *buf, size_t len)
|
|||
return nbytes;
|
||||
}
|
||||
|
||||
STATIC size_t PipeRingbufferWrite(struct PipeDev *dev, VOID *buf, size_t len)
|
||||
STATIC size_t PipeRingbufferWrite(struct PipeDev *dev, const VOID *buf, size_t len)
|
||||
{
|
||||
size_t nbytes;
|
||||
|
||||
|
@ -220,7 +220,6 @@ STATIC INT32 PipeDevRegister(CHAR *devName, UINT32 len)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
struct PipeDev *devTemp = NULL;
|
||||
struct PipeDev *dev = LOS_MemAlloc(OS_SYS_MEM_ADDR, sizeof(struct PipeDev));
|
||||
if (dev == NULL) {
|
||||
ret = -ENOMEM;
|
||||
|
@ -230,7 +229,7 @@ STATIC INT32 PipeDevRegister(CHAR *devName, UINT32 len)
|
|||
(VOID)snprintf_s(dev->devName, PIPE_DEV_NAME_MAX, PIPE_DEV_NAME_MAX - 1, "%s%d", PIPE_DEV_PATH, num);
|
||||
(VOID)memcpy_s(devName, len, dev->devName, strlen(dev->devName));
|
||||
|
||||
devTemp = PipeDevFind(dev->devName);
|
||||
struct PipeDev *devTemp = PipeDevFind(dev->devName);
|
||||
if (devTemp != NULL) {
|
||||
ret = -EEXIST;
|
||||
goto ERROR;
|
||||
|
@ -389,22 +388,15 @@ INT32 PipeOpen(const CHAR *path, INT32 openFlag, INT32 minFd)
|
|||
dev->ringBuffer = LOS_MemAlloc(OS_SYS_MEM_ADDR, PIPE_DEV_BUF_SIZE);
|
||||
if (dev->ringBuffer == NULL) {
|
||||
PIPE_DEV_UNLOCK(dev->mutex);
|
||||
PipeDevFdFree(fd);
|
||||
errno = ENOMEM;
|
||||
goto ERROR;
|
||||
return -1;
|
||||
}
|
||||
dev->bufferSize = PIPE_DEV_BUF_SIZE;
|
||||
}
|
||||
PIPE_DEV_UNLOCK(dev->mutex);
|
||||
|
||||
return (fd + minFd);
|
||||
ERROR:
|
||||
if (dev->ringBuffer != NULL) {
|
||||
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dev->ringBuffer);
|
||||
dev->ringBuffer = NULL;
|
||||
}
|
||||
|
||||
PipeDevFdFree(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
STATIC INLINE struct PipeFdDev *PipeFdDevGet(INT32 fd)
|
||||
|
@ -448,9 +440,7 @@ INT32 PipeClose(INT32 fd)
|
|||
PIPE_DEV_LOCK(dev->mutex);
|
||||
if (openFlag == O_RDONLY) {
|
||||
dev->readerCnt--;
|
||||
}
|
||||
|
||||
if (openFlag == O_WRONLY) {
|
||||
} else if (openFlag == O_WRONLY) {
|
||||
dev->writerCnt--;
|
||||
}
|
||||
|
||||
|
@ -676,8 +666,19 @@ int pipe(int filedes[2])
|
|||
return -1;
|
||||
}
|
||||
|
||||
struct PipeDev *dev = PipeDevFind(devName);
|
||||
filedes[0] = open(devName, O_RDONLY);
|
||||
if (filedes[0] < 0) {
|
||||
(VOID)PipeDevUnregister(dev);
|
||||
return -1;
|
||||
}
|
||||
|
||||
filedes[1] = open(devName, O_WRONLY);
|
||||
if (filedes[1] < 0) {
|
||||
(VOID)PipeDevUnregister(dev);
|
||||
(VOID)close(filedes[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -128,6 +128,10 @@ VOID PollNotify(struct PollWaitQueue *waitQueue, PollEvent event)
|
|||
UINT32 intSave;
|
||||
struct PollWaitNode *waitNode = NULL;
|
||||
|
||||
if (waitQueue == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
intSave = LOS_IntLock();
|
||||
LOS_DL_LIST_FOR_EACH_ENTRY(waitNode, &waitQueue->queue, struct PollWaitNode, node) {
|
||||
if (!event || (event & waitNode->table->event)) {
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "los_compiler.h"
|
||||
#include "los_mux.h"
|
||||
#include "errno.h"
|
||||
#include "los_mux.h"
|
||||
#include "los_debug.h"
|
||||
#include "los_hook.h"
|
||||
#include "los_sched.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue