Compare commits

...

36 Commits

Author SHA1 Message Date
openharmony_ci
df9387c28f !725 fix: 修复系统时间比RTC时间过快的问题
Merge pull request !725 from zhushengle/tick_master
2022-06-25 09:41:52 +00:00
openharmony_ci
d08a3e3f13 !732 LOSCFG_PLATFORM_HWI_WITH_ARG开启后M核编译失败修改
Merge pull request !732 from wangchen/0623_hwi
2022-06-24 11:49:12 +00:00
openharmony_ci
48ff5189b8 !727 OsShellCmdFreeInfo打印换行修改
Merge pull request !727 from wangchen/0622_m
2022-06-24 10:37:52 +00:00
zhushengle
600283a96f fix: 修复系统时间比RTC时间过快的问题
1.标记在时间接口中更新base后在中断中不再更新base
2.优化tick计算

Close #I5DCRB

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: Ic3df09142519357353906d40e3fd3cdca5cac71d
2022-06-24 17:47:06 +08:00
openharmony_ci
a333e8f88e !734 删除osTimerNew接口中对传入的定时器类型的重复判断
Merge pull request !734 from Mr.W/dev
2022-06-24 06:41:02 +00:00
wangmeng
ce49331798 删除osTimerNew接口中对传入的定时器类型的重复判断
Signed-off-by: wangmeng <wangmeng90798@talkweb.com.cn>
2022-06-24 10:05:39 +08:00
wangchen
fc8c547b05 fix: LOSCFG_PLATFORM_HWI_WITH_ARG开启后M核编译失败修改
【背景】LOSCFG_PLATFORM_HWI_WITH_ARG开启后M核编译失败

【修改方案】
对涉及的函数指针进行强制转换

【影响】
对现有的产品编译不会有影响。
re #I4W4GM
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-06-23 11:43:29 +00:00
openharmony_ci
8cfadb9b4d !729 禁止导出符号被编译器优化掉
Merge pull request !729 from xuxinyu/master
2022-06-23 11:17:05 +00:00
openharmony_ci
2c5b750a46 !731 so 解析脚本单位表示错误
Merge pull request !731 from xuxinyu/FixdylinkSO_pares
2022-06-23 11:16:40 +00:00
x_xiny
3df936f1a1 禁止导出符号被编译器优化掉
re #I4XQC1

Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: I79a59e70ddaba746a50bd92aea647778c4e90a0c
2022-06-23 17:31:57 +08:00
x_xiny
6fa1fe5993 so 解析脚本单位表示错误
re #I4X3AL

Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: Idd6d3c171b785ebd332402d3f29ffb484e644545
2022-06-23 17:18:57 +08:00
openharmony_ci
8a05eb6e08 !722 修复liteos_m仓库中存在的一些拼写错误
Merge pull request !722 from Hongjin Li/dev
2022-06-23 04:10:35 +00:00
lihongjin
243fe55c68 style: Misspelling
Signed-off-by: lihongjin <lihongjin1@huawei.com>
Change-Id: Ie14607b483d31a6efdf17e40e9937fe4bc2484c2
2022-06-23 09:46:16 +08:00
openharmony_ci
a7341d81d1 !702 【OpenHarmony开源贡献者计划2022】更新readme中的目录结构
Merge pull request !702 from yjzhkh/master
2022-06-23 00:51:41 +00:00
wangchen
c8ce65f408 fix: OsShellCmdFreeInfo打印换行格式混用修改
【背景】OsShellCmdFreeInfo打印换行格式混用

【修改方案】
删除\r

【影响】
对现有的产品编译不会有影响。
re #I52MES
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-06-22 07:50:26 +00:00
openharmony_ci
c1e3856bbe !714 eat: normalize drivers framework component and repos
Merge pull request !714 from yuanbo/master
2022-06-17 06:40:26 +00:00
yuanbo
3a887c616a feat: normalize drivers framework component and repos
Signed-off-by: yuanbo <yuanbo@huawei.com>
2022-06-15 20:07:10 +08:00
openharmony_ci
3303cd7bc1 !709 feature: C库适配iar
Merge pull request !709 from xuxinyu/master
2022-06-14 11:57:16 +00:00
x_xiny
7c5a05f352 feature: C库适配iar
re #I5BUG3

Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: I84591c7593622de22a33f411b7011d17034c6d55
2022-06-14 15:46:29 +08:00
openharmony_ci
5df101eae5 !703 TCB结构体扩展宏添加分号
Merge pull request !703 from 方烨/master
2022-06-14 05:47:21 +00:00
fangye
128c3dffb5 TCB结构体扩展宏添加分号
Signed-off-by: fangye <fangye@talkweb.com.cn>
Change-Id: Ic31310a1da1842adb1b19a0afb1448aa0f4720ef
2022-06-14 11:31:18 +08:00
openharmony_ci
e8f3f9674c !708 fix:测试套问题修复
Merge pull request !708 from Zhaotianyu/0613test_fix
2022-06-13 11:10:51 +00:00
arvinzzz
5cfec18d24 fix: 测试套问题修复
CLOCK_REALTIME在musl与newlib中的定义值不一致,测试套中不能写死某一个值,要用CLOCK_REALTIME

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: Ie88eaf3af2ae938a7c02f7acf08526dcf333fb93
2022-06-13 16:44:59 +08:00
openharmony_ci
def41f8edd !701 内存水线shell命令
Merge pull request !701 from wangchen/0607_water
2022-06-10 06:00:05 +00:00
yangjinzhuang
3387c32b8a 更新readme
Signed-off-by: yangjinzhuang <yangjinzhuang@kaihongdigi.com>
2022-06-10 10:32:37 +08:00
wangchen
6881d3da46 fix: 内存水线shell命令
【背景】内存水线shell命令

【修改方案】
1,添加shell命令, 通过LOS_MemInfoGet获取水线
2, 增加task命令显示任务的alloc情况
影响范围:
【影响】
对现有的产品编译不会有影响。
re #I5B6VT
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-06-09 02:55:32 +00:00
openharmony_ci
e21e8753d1 !700 debugtools 自验问题修复
Merge pull request !700 from wangchen/0607_up
2022-06-07 10:40:24 +00:00
wangchen
397f24dd6f fix: debugtools 自验问题修复
【背景】debugtools 自验问题修复

【修改方案】
1,hwi打印可能存在负数,不能使用%u
2,LOS_SchedTraceStop函数可能被单独调用,导致重复释放

影响范围:
【影响】
对现有的产品编译不会有影响。
re #I5B668
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-06-07 10:17:32 +00:00
openharmony_ci
831d089652 !697 M核函数命名错误
Merge pull request !697 from wangchen/0601_up
2022-06-06 07:02:07 +00:00
wangchen
f5fa92feff fix: M核函数命名错误
【背景】OsRecyleFinishedTask拼写问题

【修改方案】
Recyle -> Recycle

影响范围:
【影响】
对现有的产品编译不会有影响。
re #I56JB1
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-06-01 06:48:13 +00:00
openharmony_ci
bed1d28df8 !689 M核添加维测, 调度信息dump
Merge pull request !689 from wangchen/0512_track
2022-05-28 08:48:37 +00:00
wangchen
efebc00f87 fix: M核添加维测接口
【背景】M核添加维测接口

【修改方案】
1, 添加任务栈dump接口
2, 添加中断dump接口
3, 添加任务调度流程dump
【影响】
对现有的产品编译不会有影响。
re #I55DJV
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-05-28 08:24:30 +00:00
openharmony_ci
28c1529e2f !695 开启cpup后启动挂死
Merge pull request !695 from wangchen/0526_up
2022-05-26 11:55:22 +00:00
wangchen
159d304275 fix: 开启cpup后启动挂死
【背景】开启cpup后启动挂死

【修改方案】
1, cpup开启后,task模块会在g_cpup初始化前赋值。
    因此需提前cpup模块的初始化。
【影响】
对现有的产品编译不会有影响。
re #I59DDE
Signed-off-by: wangchen <wangchen64@huawei.com>
https://gitee.com/openharmony/kernel_liteos_m/issues/I59DDE
2022-05-26 11:42:02 +00:00
openharmony_ci
18f65ae0b3 !694 修复RISCV32 newlib情况下FD_ISSET设置问题
Merge pull request !694 from 大仙/master
2022-05-24 11:08:44 +00:00
大仙
c6958aa181 修复SoftBusSocketFdIsset在M核RISCV32架构的newlib情况下设置的问题
fix #I52ACL

Signed-off-by: 大仙 <leicx@digitalchina.com>
2022-05-20 16:55:27 +08:00
73 changed files with 627 additions and 255 deletions

View File

@@ -1,5 +1,5 @@
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2020-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:
@@ -82,11 +82,10 @@ config("stdinc_config") {
"-isystem",
std_include,
]
cflags += [ "-nostdinc" ]
asmflags = cflags
if (defined(LOSCFG_LIBC_NEWLIB)) {
cflags -= [ "-nostdinc" ]
if (defined(LOSCFG_LIBC_MUSL)) {
cflags += [ "-nostdinc" ]
}
asmflags = cflags
}
config("ssp_config") {

View File

@@ -581,7 +581,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 informations 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 information of mem node.
config BASE_MEM_NODE_INTEGRITY_CHECK
bool "Enable integrity check or not"
default n
@@ -597,6 +597,11 @@ config VM_OVERLAP_CHECK
depends on DEBUG_VERSION && MEM_DEBUG
help
Answer Y to enable vm overlap check.
config TASK_MEM_USED
bool "Enable show task mem used or not"
default n
depends on DEBUG_VERSION && MEM_DEBUG
endmenu

View File

@@ -26,6 +26,7 @@ OpenHarmony LiteOS-M内核是面向IoT领域构建的轻量级物联网操作系
│ │ ├── cortex-m3 # cortex-m3架构代码
│ │ ├── cortex-m33 # cortex-m33架构代码
│ │ ├── cortex-m4 # cortex-m4架构代码
│ │ ├── cortex-m55 # cortex-m55架构代码
│ │ ├── cortex-m7 # cortex-m7架构代码
│ │ └── include # arm架构公共头文件目录
│ ├── csky # csky架构代码

View File

@@ -622,19 +622,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -618,14 +618,14 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = OsTickHandler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)OsTickHandler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -618,14 +618,14 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = OsTickHandler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)OsTickHandler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -623,19 +623,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -623,19 +623,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -626,19 +626,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -624,19 +624,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -626,14 +626,14 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = OsTickHandler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalSVCHandler;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)OsTickHandler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -611,19 +611,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -620,19 +620,19 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
UINT32 index;
g_hwiForm[0] = 0; /* [0] Top of Stack */
g_hwiForm[1] = Reset_Handler; /* [1] reset */
g_hwiForm[1] = (HWI_PROC_FUNC)Reset_Handler; /* [1] reset */
for (index = 2; index < OS_VECTOR_CNT; index++) { /* 2: The starting position of the interrupt */
g_hwiForm[index] = (HWI_PROC_FUNC)HalHwiDefaultHandler;
}
/* Exception handler register */
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = SysTick_Handler;
g_hwiForm[NonMaskableInt_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcNMI;
g_hwiForm[HARDFAULT_IRQN + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcHardFault;
g_hwiForm[MemoryManagement_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcMemFault;
g_hwiForm[BusFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcBusFault;
g_hwiForm[UsageFault_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcUsageFault;
g_hwiForm[SVCall_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalExcSvcCall;
g_hwiForm[PendSV_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)HalPendSV;
g_hwiForm[SysTick_IRQn + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)SysTick_Handler;
/* Interrupt vector table location */
SCB->VTOR = (UINT32)(UINTPTR)g_hwiForm;

View File

@@ -51,7 +51,7 @@ extern "C" {
/**
* @ingroup los_hwi
* Count of Nuclei interrupt vector maxium, which is configurable.
* Count of Nuclei interrupt vector maximum, which is configurable.
*/
#define OS_RISCV_CUSTOM_IRQ_VECTOR_CNT SOC_INT_MAX

View File

@@ -193,15 +193,15 @@ VOID HalDisplayTaskInfo(VOID)
/* ****************************************************************************
Function : HalUnalignedAccessFix
Description : Unaligned acess fixes are not supported by default
Description : Unaligned access fixes are not supported by default
Input : None
Output : None
Return : None
**************************************************************************** */
WEAK UINT32 HalUnalignedAccessFix(UINTPTR mcause, UINTPTR mepc, UINTPTR mtval, VOID *sp)
{
/* Unaligned acess fixes are not supported by default */
PRINTK("Unaligned acess fixes are not support by default!\r\n");
/* Unaligned access fixes are not supported by default */
PRINTK("Unaligned access fixes are not support by default!\r\n");
return LOS_NOK;
}

View File

@@ -62,9 +62,9 @@
* - ZEm(data): Zero-Extend data to m-bit.
* - ABS(x): Calculate the absolute value of `x`.
* - CONCAT(x,y): Concatinate `x` and `y` to form a value.
* - u<: Unsinged less than comparison.
* - u<=: Unsinged less than & equal comparison.
* - u>: Unsinged greater than comparison.
* - u<: Unsigned less than comparison.
* - u<=: Unsigned less than & equal comparison.
* - u>: Unsigned greater than comparison.
* - s*: Signed multiplication.
* - u*: Unsigned multiplication.
*
@@ -2641,7 +2641,7 @@ __STATIC_FORCEINLINE long __RV_KHMTT(unsigned int a, unsigned int b)
/* ===== Inline Function Start for 3.38.1. KMABB ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMABB (SIMD Saturating Signed Multiply Bottom Halfs & Add)
* \brief KMABB (SIMD Saturating Signed Multiply Bottom Halves & Add)
* \details
* **Type**: SIMD
*
@@ -2704,7 +2704,7 @@ __STATIC_FORCEINLINE long __RV_KMABB(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.38.2. KMABT ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMABT (SIMD Saturating Signed Multiply Bottom & Top Halfs & Add)
* \brief KMABT (SIMD Saturating Signed Multiply Bottom & Top Halves & Add)
* \details
* **Type**: SIMD
*
@@ -2767,7 +2767,7 @@ __STATIC_FORCEINLINE long __RV_KMABT(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.38.3. KMATT ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMATT (SIMD Saturating Signed Multiply Top Halfs & Add)
* \brief KMATT (SIMD Saturating Signed Multiply Top Halves & Add)
* \details
* **Type**: SIMD
*
@@ -2830,7 +2830,7 @@ __STATIC_FORCEINLINE long __RV_KMATT(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.39.1. KMADA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMADA (SIMD Saturating Signed Multiply Two Halfs and Two Adds)
* \brief KMADA (SIMD Saturating Signed Multiply Two Halves and Two Adds)
* \details
* **Type**: SIMD
*
@@ -2894,7 +2894,7 @@ __STATIC_FORCEINLINE long __RV_KMADA(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.39.2. KMAXDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMAXDA (SIMD Saturating Signed Crossed Multiply Two Halfs and Two Adds)
* \brief KMAXDA (SIMD Saturating Signed Crossed Multiply Two Halves and Two Adds)
* \details
* **Type**: SIMD
*
@@ -2958,7 +2958,7 @@ __STATIC_FORCEINLINE long __RV_KMAXDA(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.40.1. KMADS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMADS (SIMD Saturating Signed Multiply Two Halfs & Subtract & Add)
* \brief KMADS (SIMD Saturating Signed Multiply Two Halves & Subtract & Add)
* \details
* **Type**: SIMD
*
@@ -3030,7 +3030,7 @@ __STATIC_FORCEINLINE long __RV_KMADS(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.40.2. KMADRS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMADRS (SIMD Saturating Signed Multiply Two Halfs & Reverse Subtract & Add)
* \brief KMADRS (SIMD Saturating Signed Multiply Two Halves & Reverse Subtract & Add)
* \details
* **Type**: SIMD
*
@@ -3102,7 +3102,7 @@ __STATIC_FORCEINLINE long __RV_KMADRS(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.40.3. KMAXDS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMAXDS (SIMD Saturating Signed Crossed Multiply Two Halfs & Subtract & Add)
* \brief KMAXDS (SIMD Saturating Signed Crossed Multiply Two Halves & Subtract & Add)
* \details
* **Type**: SIMD
*
@@ -3242,7 +3242,7 @@ __STATIC_FORCEINLINE long long __RV_KMAR64(long long t, long a, long b)
/* ===== Inline Function Start for 3.42.1. KMDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMDA (SIMD Signed Multiply Two Halfs and Add)
* \brief KMDA (SIMD Signed Multiply Two Halves and Add)
* \details
* **Type**: SIMD
*
@@ -3293,7 +3293,7 @@ __STATIC_FORCEINLINE long __RV_KMDA(unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.42.2. KMXDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMXDA (SIMD Signed Crossed Multiply Two Halfs and Add)
* \brief KMXDA (SIMD Signed Crossed Multiply Two Halves and Add)
* \details
* **Type**: SIMD
*
@@ -4330,7 +4330,7 @@ __STATIC_FORCEINLINE long __RV_KMMWT2_U(long a, unsigned long b)
/* ===== Inline Function Start for 3.51.1. KMSDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMSDA (SIMD Saturating Signed Multiply Two Halfs & Add & Subtract)
* \brief KMSDA (SIMD Saturating Signed Multiply Two Halves & Add & Subtract)
* \details
* **Type**: SIMD
*
@@ -4392,7 +4392,7 @@ __STATIC_FORCEINLINE long __RV_KMSDA(long t, unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.51.2. KMSXDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief KMSXDA (SIMD Saturating Signed Crossed Multiply Two Halfs & Add & Subtract)
* \brief KMSXDA (SIMD Saturating Signed Crossed Multiply Two Halves & Add & Subtract)
* \details
* **Type**: SIMD
*
@@ -5558,7 +5558,7 @@ __STATIC_FORCEINLINE long __RV_KSUBH(int a, int b)
* **Description**:\n
* The signed lower 32-bit content of Rs2 is subtracted from the signed lower 32-bit
* content of Rs1. And the result is saturated to the 32-bit signed integer range of [-2^31, 2^31-1] and then
* sign-extened and written to Rd. If saturation happens, this instruction sets the OV flag.
* sign-extended and written to Rd. If saturation happens, this instruction sets the OV flag.
*
* **Operations**:\n
* ~~~
@@ -7337,7 +7337,7 @@ __STATIC_FORCEINLINE unsigned long __RV_SLL16(unsigned long a, unsigned int b)
/* ===== Inline Function Start for 3.104. SMAL ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMAL (Signed Multiply Halfs & Add 64-bit)
* \brief SMAL (Signed Multiply Halves & Add 64-bit)
* \details
* **Type**: Partial-SIMD
*
@@ -7397,7 +7397,7 @@ __STATIC_FORCEINLINE long long __RV_SMAL(long long a, unsigned long b)
/* ===== Inline Function Start for 3.105.1. SMALBB ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALBB (Signed Multiply Bottom Halfs & Add 64-bit)
* \brief SMALBB (Signed Multiply Bottom Halves & Add 64-bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -7561,7 +7561,7 @@ __STATIC_FORCEINLINE long long __RV_SMALBT(long long t, unsigned long a, unsigne
/* ===== Inline Function Start for 3.105.3. SMALTT ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALTT (Signed Multiply Top Halfs & Add 64-bit)
* \brief SMALTT (Signed Multiply Top Halves & Add 64-bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -7643,7 +7643,7 @@ __STATIC_FORCEINLINE long long __RV_SMALTT(long long t, unsigned long a, unsigne
/* ===== Inline Function Start for 3.106.1. SMALDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALDA (Signed Multiply Two Halfs and Two Adds 64-bit)
* \brief SMALDA (Signed Multiply Two Halves and Two Adds 64-bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -7727,7 +7727,7 @@ __STATIC_FORCEINLINE long long __RV_SMALDA(long long t, unsigned long a, unsigne
/* ===== Inline Function Start for 3.106.2. SMALXDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALXDA (Signed Crossed Multiply Two Halfs and Two Adds 64-bit)
* \brief SMALXDA (Signed Crossed Multiply Two Halves and Two Adds 64-bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -7811,7 +7811,7 @@ __STATIC_FORCEINLINE long long __RV_SMALXDA(long long t, unsigned long a, unsign
/* ===== Inline Function Start for 3.107.1. SMALDS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALDS (Signed Multiply Two Halfs & Subtract & Add 64-bit)
* \brief SMALDS (Signed Multiply Two Halves & Subtract & Add 64-bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -7902,7 +7902,7 @@ __STATIC_FORCEINLINE long long __RV_SMALDS(long long t, unsigned long a, unsigne
/* ===== Inline Function Start for 3.107.2. SMALDRS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALDRS (Signed Multiply Two Halfs & Reverse Subtract & Add 64- bit)
* \brief SMALDRS (Signed Multiply Two Halves & Reverse Subtract & Add 64- bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -7993,7 +7993,7 @@ __STATIC_FORCEINLINE long long __RV_SMALDRS(long long t, unsigned long a, unsign
/* ===== Inline Function Start for 3.107.3. SMALXDS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMALXDS (Signed Crossed Multiply Two Halfs & Subtract & Add 64- bit)
* \brief SMALXDS (Signed Crossed Multiply Two Halves & Subtract & Add 64- bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -8459,7 +8459,7 @@ __STATIC_FORCEINLINE long __RV_SMTT16(unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.114.1. SMDS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief SMDS (SIMD Signed Multiply Two Halfs and Subtract)
* \brief SMDS (SIMD Signed Multiply Two Halves and Subtract)
* \details
* **Type**: SIMD
*
@@ -8518,7 +8518,7 @@ __STATIC_FORCEINLINE long __RV_SMDS(unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.114.2. SMDRS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief SMDRS (SIMD Signed Multiply Two Halfs and Reverse Subtract)
* \brief SMDRS (SIMD Signed Multiply Two Halves and Reverse Subtract)
* \details
* **Type**: SIMD
*
@@ -8577,7 +8577,7 @@ __STATIC_FORCEINLINE long __RV_SMDRS(unsigned long a, unsigned long b)
/* ===== Inline Function Start for 3.114.3. SMXDS ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_32B_ADDSUB
* \brief SMXDS (SIMD Signed Crossed Multiply Two Halfs and Subtract)
* \brief SMXDS (SIMD Signed Crossed Multiply Two Halves and Subtract)
* \details
* **Type**: SIMD
*
@@ -9016,7 +9016,7 @@ __STATIC_FORCEINLINE long __RV_SMMWT_U(long a, unsigned long b)
/* ===== Inline Function Start for 3.120.1. SMSLDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMSLDA (Signed Multiply Two Halfs & Add & Subtract 64-bit)
* \brief SMSLDA (Signed Multiply Two Halves & Add & Subtract 64-bit)
* \details
* **Type**: DSP (64-bit Profile)
*
@@ -9098,7 +9098,7 @@ __STATIC_FORCEINLINE long long __RV_SMSLDA(long long t, unsigned long a, unsigne
/* ===== Inline Function Start for 3.120.2. SMSLXDA ===== */
/**
* \ingroup NMSIS_Core_DSP_Intrinsic_SIGNED_16B_MULT_64B_ADDSUB
* \brief SMSLXDA (Signed Crossed Multiply Two Halfs & Add & Subtract 64- bit)
* \brief SMSLXDA (Signed Crossed Multiply Two Halves & Add & Subtract 64- bit)
* \details
* **Type**: DSP (64-bit Profile)
*

View File

@@ -282,7 +282,7 @@ __STATIC_FORCEINLINE uint32_t __ECLIC_GetCfgNlbits(void)
* This function gets the hardware version information from CLICINFO register.
* \return hardware version number in CLICINFO register.
* \remarks
* - This function gets harware version information from CLICINFO register.
* - This function gets hardware version information from CLICINFO register.
* - Bit 20:17 for architecture version, bit 16:13 for implementation version.
* \sa
* - \ref ECLIC_GetInfoNum

View File

@@ -81,7 +81,7 @@
* \details
* * We can save power by disable FPU Unit.
* * When FPU Unit is disabled, any access to FPU related CSR registers
* and FPU instructions will cause illegal Instuction Exception.
* and FPU instructions will cause illegal Instruction Exception.
* */
#define __disable_FPU() __RV_CSR_CLEAR(CSR_MSTATUS, MSTATUS_FS)

View File

@@ -282,7 +282,7 @@ __STATIC_FORCEINLINE void SysTimer_SoftwareReset(void)
* \details Initializes the System Timer and its non-vector interrupt, and starts the System Tick Timer.
*
* In our default implementation, the timer counter will be set to zero, and it will start a timer compare non-vector interrupt
* when it matchs the ticks user set, during the timer interrupt user should reload the system tick using \ref SysTick_Reload function
* when it matches the ticks user set, during the timer interrupt user should reload the system tick using \ref SysTick_Reload function
* or similar function written by user, so it can produce period timer interrupt.
* \param [in] ticks Number of ticks between two interrupts.
* \return 0 Function succeeded.

View File

@@ -325,7 +325,7 @@
* \brief NMSIS Core CSR Register Definitions
* \details
*
* The following macros are used for CSR Register Defintions.
* The following macros are used for CSR Register Definitions.
* @{
*/
/* === Standard RISC-V CSR Registers === */

View File

@@ -47,7 +47,7 @@
* - Neural Network Support Functions
*
* The library has separate functions for operating on different weight and activation data
* types including 8-bit integers (q7_t) and 16-bit integers (q15_t). The descrition of the
* types including 8-bit integers (q7_t) and 16-bit integers (q15_t). The description of the
* kernels are included in the function description. The implementation details are also
* described in this paper [1].
*
@@ -119,7 +119,7 @@ extern "C"
/**
* @brief Basic Q7 convolution function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -156,8 +156,8 @@ extern "C"
/**
* @brief Basic Q7 convolution function (non-sqaure shape)
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in_x input tensor dimention x
* @param[in] dim_im_in_y input tensor dimention y
* @param[in] dim_im_in_x input tensor dimension x
* @param[in] dim_im_in_y input tensor dimension y
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -202,7 +202,7 @@ extern "C"
/**
* @brief Basic Q15 convolution function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -239,7 +239,7 @@ extern "C"
/**
* @brief Fast Q7 convolution function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -257,7 +257,7 @@ extern "C"
* <code>RISCV_MATH_SIZE_MISMATCH</code> or <code>RISCV_MATH_SUCCESS</code> based on the outcome of size checking.
*
* This function is the version with full list of optimization tricks, but with
* some contraints:
* some constraints:
* ch_im_in is multiple of 4
* ch_im_out is multiple of 2
*/
@@ -281,8 +281,8 @@ extern "C"
/**
* @brief Fast Q7 convolution function (non-sqaure shape)
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in_x input tensor dimention x
* @param[in] dim_im_in_y input tensor dimention y
* @param[in] dim_im_in_x input tensor dimension x
* @param[in] dim_im_in_y input tensor dimension y
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -304,7 +304,7 @@ extern "C"
* <code>RISCV_MATH_SIZE_MISMATCH</code> or <code>RISCV_MATH_SUCCESS</code> based on the outcome of size checking.
*
* This function is the version with full list of optimization tricks, but with
* some contraints:
* some constraints:
* ch_im_in is multiple of 4
* ch_im_out is multiple of 2
*/
@@ -333,8 +333,8 @@ extern "C"
/**
* @brief Fast Q7 version of 1x1 convolution (non-sqaure shape)
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in_x input tensor dimention x
* @param[in] dim_im_in_y input tensor dimention y
* @param[in] dim_im_in_x input tensor dimension x
* @param[in] dim_im_in_y input tensor dimension y
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -360,7 +360,7 @@ extern "C"
* second half of MobileNets after depthwise separable convolution.
*
* This function is the version with full list of optimization tricks, but with
* some contraints:
* some constraints:
* ch_im_in is multiple of 4
* ch_im_out is multiple of 2
*/
@@ -388,7 +388,7 @@ extern "C"
/**
* @brief Q7 version of convolution for RGB image
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -429,7 +429,7 @@ extern "C"
/**
* @brief Fast Q15 convolution function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -447,7 +447,7 @@ extern "C"
* <code>RISCV_MATH_SIZE_MISMATCH</code> or <code>RISCV_MATH_SUCCESS</code> based on the outcome of size checking.
*
* This function is the version with full list of optimization tricks, but with
* some contraints:
* some constraints:
* ch_im_in is multiple of 2
* ch_im_out is multiple of 2
*/
@@ -471,8 +471,8 @@ extern "C"
/**
* @brief Fast Q15 convolution function (non-sqaure shape)
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in_x input tensor dimention x
* @param[in] dim_im_in_y input tensor dimention y
* @param[in] dim_im_in_x input tensor dimension x
* @param[in] dim_im_in_y input tensor dimension y
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -505,7 +505,7 @@ extern "C"
*
* ch_im_in is multiple of 2
*
* ch_im_out is multipe of 2
* ch_im_out is multiple of 2
*
*/
@@ -534,7 +534,7 @@ extern "C"
/**
* @brief Q7 depthwise separable convolution function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -552,7 +552,7 @@ extern "C"
* <code>RISCV_MATH_SIZE_MISMATCH</code> or <code>RISCV_MATH_SUCCESS</code> based on the outcome of size checking.
*
* This function is the version with full list of optimization tricks, but with
* some contraints:
* some constraints:
* ch_im_in is multiple of 2
* ch_im_out is multiple of 2
*/
@@ -576,8 +576,8 @@ extern "C"
/**
* @brief Q7 depthwise separable convolution function (non-square shape)
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in_x input tensor dimention x
* @param[in] dim_im_in_y input tensor dimention y
* @param[in] dim_im_in_x input tensor dimension x
* @param[in] dim_im_in_y input tensor dimension y
* @param[in] ch_im_in number of input tensor channels
* @param[in] wt pointer to kernel weights
* @param[in] ch_im_out number of filters, i.e., output tensor channels
@@ -599,7 +599,7 @@ extern "C"
* <code>RISCV_MATH_SIZE_MISMATCH</code> or <code>RISCV_MATH_SUCCESS</code> based on the outcome of size checking.
*
* This function is the version with full list of optimization tricks, but with
* some contraints:
* some constraints:
* ch_im_in is multiple of 2
* ch_im_out is multiple of 2
*/
@@ -986,7 +986,7 @@ extern "C"
/**
* @brief Q7 max pooling function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] dim_kernel filter kernel size
* @param[in] padding padding sizes
@@ -1011,7 +1011,7 @@ extern "C"
/**
* @brief Q7 average pooling function
* @param[in] Im_in pointer to input tensor
* @param[in] dim_im_in input tensor dimention
* @param[in] dim_im_in input tensor dimension
* @param[in] ch_im_in number of input tensor channels
* @param[in] dim_kernel filter kernel size
* @param[in] padding padding sizes
@@ -1043,7 +1043,7 @@ extern "C"
/**
* @brief Q7 softmax function
* @param[in] vec_in pointer to input vector
* @param[in] dim_vec input vector dimention
* @param[in] dim_vec input vector dimension
* @param[out] p_out pointer to output vector
* @return none.
*
@@ -1054,7 +1054,7 @@ extern "C"
/**
* @brief Q15 softmax function
* @param[in] vec_in pointer to input vector
* @param[in] dim_vec input vector dimention
* @param[in] dim_vec input vector dimension
* @param[out] p_out pointer to output vector
* @return none.
*
@@ -1081,7 +1081,7 @@ extern "C"
* @param[in] dilation_x Dilation along width. Not used and intended for future enhancement.
* @param[in] dilation_y Dilation along height. Not used and intended for future enhancement.
* @param[in] bias Pointer to optional bias values. If no bias is
* availble, NULL is expected
* available, NULL is expected
* @param[in] input_offset Input tensor zero offset
* @param[in] filter_offset Kernel tensor zero offset
* @param[in] output_offset Output tensor zero offset

View File

@@ -117,7 +117,24 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupGuardCreator(VOID)
return LOS_OK;
}
#endif
/*****************************************************************************
Function : OsCpupDaemonInit
Description: initialization of CPUP Daemon
Input : None
Return : LOS_OK or Error Information
*****************************************************************************/
LITE_OS_SEC_TEXT_INIT UINT32 OsCpupDaemonInit()
{
#if (LOSCFG_BASE_CORE_SWTMR == 1)
(VOID)OsCpupGuardCreator();
g_irqCpupInitFlg = 1;
#endif
return LOS_OK;
}
#endif
/*****************************************************************************
Function : OsCpupInit
Description: initialization of CPUP
@@ -127,32 +144,25 @@ Return : LOS_OK or Error Information
LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit()
{
UINT32 size;
CHAR *cpupMem = NULL;
size = g_taskMaxNum * sizeof(OsCpupCB);
g_cpup = (OsCpupCB *)LOS_MemAlloc(m_aucSysMem0, size);
if (g_cpup == NULL) {
return LOS_ERRNO_CPUP_NO_MEMORY;
}
// Ignore the return code when matching CSEC rule 6.6(3).
(VOID)memset_s(g_cpup, size, 0, size);
g_cpupInitFlg = 1;
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
size = LOSCFG_PLATFORM_HWI_LIMIT * sizeof(OsIrqCpupCB);
g_irqCpup = (OsIrqCpupCB *)LOS_MemAlloc(m_aucSysMem0, size);
if (g_irqCpup == NULL) {
size += LOSCFG_PLATFORM_HWI_LIMIT * sizeof(OsIrqCpupCB);
#endif
cpupMem = LOS_MemAlloc(m_aucSysMem0, size);
if (cpupMem == NULL) {
return LOS_ERRNO_CPUP_NO_MEMORY;
}
(VOID)memset_s(cpupMem, size, 0, size);
(VOID)memset_s(g_irqCpup, size, 0, size);
#if (LOSCFG_BASE_CORE_SWTMR == 1)
(VOID)OsCpupGuardCreator();
g_irqCpupInitFlg = 1;
g_cpup = (OsCpupCB *)cpupMem;
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
g_irqCpup = (OsIrqCpupCB *)(cpupMem + g_taskMaxNum * sizeof(OsCpupCB));
#endif
#endif
g_cpupInitFlg = 1;
return LOS_OK;
}

View File

@@ -171,6 +171,7 @@ typedef struct {
*/
extern UINT32 OsCpupInit(VOID);
extern UINT32 OsCpupDaemonInit(VOID);
/**
* @ingroup los_cpup
* @brief Start task to get cycles count in current task ending.

View File

@@ -33,6 +33,7 @@ module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [
"los_hwidump.c",
"los_schedtrace.c",
"los_stackdump.c",
]
configs += [ "$LITEOSTOPDIR:warn_config" ]

View File

@@ -40,17 +40,46 @@ extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
/* StackDump print format */
#define PRINT_PER_ROW 4
/* Shell Callback */
/* SchedTrace records number */
#define TRACE_NUM 200
/* sched trace info, users can add their own */
typedef struct {
UINT32 newTaskID;
CHAR newTaskName[LOS_TASK_NAMELEN];
UINT32 runTaskID;
CHAR runTaskName[LOS_TASK_NAMELEN];
} SchedTraceInfo;
/* SchedTrace record callback */
typedef void (*SchedTraceRecordCB)(LosTaskCB *newTask, LosTaskCB *runTask);
/* SchedTrace show callback, buf is overwrite ringbuf, max amount of storage is TRACE_NUM */
typedef void (*SchedTraceShowCB)(SchedTraceInfo *ringBuf, UINT32 count);
/* Shell callback */
extern UINT32 OsShellCmdStackDump(INT32 argc, const CHAR **argv);
extern UINT32 OsShellCmdHwiDump(INT32 argc, const CHAR **argv);
extern UINT32 OsShellCmdSchedTrace(INT32 argc, const CHAR **argv);
/* other module Callback */
/* Other module callback */
extern VOID OsSchedTraceRecord(LosTaskCB *newTask, LosTaskCB *runTask);
/* External Interface */
/* External interface */
/* dump stack by task id, can be called at any time */
extern VOID LOS_TaskStackDump(UINT32 taskID);
/* register sched trace handle, If not registered, the default fun will be used */
extern VOID LOS_SchedTraceHandleRegister(SchedTraceRecordCB recordCB, SchedTraceShowCB showCB);
/* start sched trace, will alloc buf, and start write to buf when sched */
extern VOID LOS_SchedTraceStart(VOID);
/* stop sched trace, will stop record and free buf */
extern VOID LOS_SchedTraceStop(VOID);
#ifdef __cplusplus
#if __cplusplus
}

View File

@@ -84,7 +84,7 @@ STATIC VOID ShellCmdHwiInfoShow(OsIrqCpupCB *irqData, CPUP_INFO_S *hwiCpup1s,
}
irqName = OsGetHwiFormName(i);
PRINTK(" %10u:%11u%11llu%10llu%9u.%-2u%9u.%-2u %-12s\n", i - OS_SYS_VECTOR_CNT, count, cycles, timeMax,
PRINTK(" %10d:%11u%11llu%10llu%9u.%-2u%9u.%-2u %-12s\n", i - OS_SYS_VECTOR_CNT, count, cycles, timeMax,
hwiCpup1s[i].uwUsage / CPUP_PRECISION_MULT, hwiCpup1s[i].uwUsage % CPUP_PRECISION_MULT,
hwiCpup10s[i].uwUsage / CPUP_PRECISION_MULT, hwiCpup10s[i].uwUsage % CPUP_PRECISION_MULT,
(irqName != NULL) ? irqName : NULL);

View File

@@ -0,0 +1,164 @@
/*
* Copyright (c) 2022-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:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "los_debugtools.h"
#include "securec.h"
#include "los_debug.h"
#include "los_memory.h"
#include "los_arch.h"
#if (LOSCFG_DEBUG_TOOLS == 1)
STATIC BOOL g_startTrace = FALSE;
STATIC SchedTraceInfo *g_traceRingBuf = NULL;
STATIC UINT32 g_schedCount = 0;
STATIC SchedTraceRecordCB g_recordCB = NULL;
STATIC SchedTraceShowCB g_showCB = NULL;
STATIC VOID DefaultShowFormat(SchedTraceInfo *buf, UINT32 count)
{
INT32 i;
UINT32 cycle = count / TRACE_NUM;
UINT32 point = count % TRACE_NUM;
PRINTK ("sched %u time, last %u is:\r\n", count, TRACE_NUM);
PRINTK("RunTaskID RunTaskName NewTaskID NewTaskName \r\n");
if (cycle > 0) {
for (i = point; i < TRACE_NUM; i++) {
PRINTK("%4u %20s, %4u %20s\n",
g_traceRingBuf[i].runTaskID, g_traceRingBuf[i].runTaskName,
g_traceRingBuf[i].newTaskID, g_traceRingBuf[i].newTaskName);
}
}
for (i = 0; i < point; i++) {
PRINTK("%4u %20s, %4u %20s\n",
g_traceRingBuf[i].runTaskID, g_traceRingBuf[i].runTaskName,
g_traceRingBuf[i].newTaskID, g_traceRingBuf[i].newTaskName);
}
PRINTK("\r\n");
}
STATIC VOID DefaultRecordHandle(LosTaskCB *newTask, LosTaskCB *runTask)
{
UINT32 point = g_schedCount % TRACE_NUM;
g_traceRingBuf[point].newTaskID = newTask->taskID;
(VOID)memcpy_s(g_traceRingBuf[point].newTaskName, LOS_TASK_NAMELEN, newTask->taskName, LOS_TASK_NAMELEN);
g_traceRingBuf[point].runTaskID = runTask->taskID;
(VOID)memcpy_s(g_traceRingBuf[point].runTaskName, LOS_TASK_NAMELEN, runTask->taskName, LOS_TASK_NAMELEN);
g_schedCount++;
}
STATIC VOID ShowFormat(SchedTraceInfo *buf, UINT32 count)
{
if (count == 0) {
PRINT_ERR("none shed happened\n");
return;
}
if (g_showCB != NULL) {
g_showCB(buf, count);
}
}
VOID OsSchedTraceRecord(LosTaskCB *newTask, LosTaskCB *runTask)
{
if (g_startTrace == FALSE) {
return;
}
if (g_recordCB != NULL) {
g_recordCB(newTask, runTask);
}
}
VOID LOS_SchedTraceStart(VOID)
{
if (g_recordCB == NULL) {
g_recordCB = DefaultRecordHandle;
}
g_traceRingBuf = (SchedTraceInfo *)LOS_MemAlloc(OS_SYS_MEM_ADDR, TRACE_NUM * sizeof(SchedTraceInfo));
if (g_traceRingBuf == NULL) {
PRINT_ERR("alloc failed for dump\n");
return;
}
(VOID)memset_s(g_traceRingBuf, TRACE_NUM * sizeof(SchedTraceInfo), 0, TRACE_NUM * sizeof(SchedTraceInfo));
g_startTrace = TRUE;
}
VOID LOS_SchedTraceStop(VOID)
{
if (g_showCB == NULL) {
g_showCB = DefaultShowFormat;
}
g_startTrace = FALSE;
ShowFormat(g_traceRingBuf, g_schedCount);
g_schedCount = 0;
if (g_traceRingBuf != NULL) {
(VOID)LOS_MemFree(OS_SYS_MEM_ADDR, g_traceRingBuf);
g_traceRingBuf = NULL;
}
return;
}
VOID LOS_SchedTraceHandleRegister(SchedTraceRecordCB recordCB, SchedTraceShowCB showCB)
{
g_recordCB = recordCB;
g_showCB = showCB;
}
UINT32 OsShellCmdSchedTrace(INT32 argc, const CHAR **argv)
{
if (argc != 1) {
PRINT_ERR("\nUsage: st -h\n");
return LOS_NOK;
}
if (strcmp(argv[0], "-s") == 0) {
LOS_SchedTraceStart();
} else if (strcmp(argv[0], "-e") == 0) {
LOS_SchedTraceStop();
} else if (strcmp(argv[0], "-h") == 0) {
PRINTK("\nUsage: \nst -s , SchedTrace start\n");
PRINTK("st -e , SchedTrace end and show\n");
} else {
PRINTK("\nUsage: st -h\n");
return OS_ERROR;
}
return LOS_OK;
}
#endif /* LOSCFG_STACK_DUMP == 1 */

View File

@@ -134,7 +134,7 @@ typedef struct {
} SymInfo;
#define SYM_EXPORT(func) \
const SymInfo sym_##func __attribute__((section(".sym."#func))) = { \
const SymInfo sym_##func __attribute__((__used__, section(".sym."#func))) = { \
.name = #func, \
.addr = (UINTPTR)func \
};
@@ -149,7 +149,7 @@ const SymInfo sym_##func __attribute__((section(".sym."#func))) = { \
* then the shared library will be loaded to the heap by pool.
*
* @note When the heap, pool, is not NULL, you should call LOS_MemInit() to initialize the
* pool before calling LOS_SoLoad(). By the way, the system will comsume a certain amount
* pool before calling LOS_SoLoad(). By the way, the system will consume a certain amount
* of memory to initialize the pool. LOS_SoLoad must not be called in interrupt callback.
*
* @return Return NULL if error. Return non-NULL if success.

View File

@@ -60,6 +60,6 @@ ${READELF} -l $1 | while read line; do
done
NEED_SIZE=`tail -n 1 ${TMP_FILE}`
echo "${NEED_SIZE} kb memory to reserve for $1!"
echo "${NEED_SIZE} bytes memory to reserve for $1!"
${RM} -f ${TMP_FILE}

View File

@@ -32,7 +32,7 @@
#include "los_compiler.h"
/* Using task extended field to realize IAR TLS function in target_config.h include this header file. */
#define LOSCFG_TASK_STRUCT_EXTENSION VOID *iarTlsArea;
#define LOSCFG_TASK_STRUCT_EXTENSION VOID *iarTlsArea
#if (__VER__ < 8000000)
#include <yvals.h>

View File

@@ -90,7 +90,7 @@ void sys_init(void)
u32_t sys_now(void)
{
/* Lwip docs mentioned like wraparound is not a problem in this funtion */
/* Lwip docs mentioned like wraparound is not a problem in this function */
return (u32_t)((LOS_TickCountGet() * OS_SYS_MS_PER_SECOND) /
LOSCFG_BASE_CORE_TICK_PER_SECOND);
}

View File

@@ -94,6 +94,7 @@ extern INT32 VfsNormalizePath(const CHAR *directory, const CHAR *filename, CHAR
extern INT32 OsShellCmdDate(INT32 argc, const CHAR **argv);
extern INT32 OsShellCmdDumpTask(INT32 argc, const CHAR **argv);
extern UINT32 OsShellCmdFree(INT32 argc, const CHAR **argv);
extern UINT32 OsShellCmdWaterLine(INT32 argc, const CHAR **argv);
extern UINT32 lwip_ifconfig(INT32 argc, const CHAR **argv);
extern UINT32 OsShellPing(INT32 argc, const CHAR **argv);
extern INT32 OsShellCmdTouch(INT32 argc, const CHAR **argv);

View File

@@ -51,6 +51,9 @@ CmdItem g_shellcmdAll[] = {
{CMD_TYPE_STD, "date", XARGS, (CmdCallBackFunc)OsShellCmdDate},
{CMD_TYPE_EX, "task", 1, (CmdCallBackFunc)OsShellCmdDumpTask},
{CMD_TYPE_EX, "free", XARGS, (CmdCallBackFunc)OsShellCmdFree},
#if (LOSCFG_MEM_WATERLINE == 1)
{CMD_TYPE_EX, "memusage", XARGS, (CmdCallBackFunc)OsShellCmdWaterLine},
#endif
#ifdef LWIP_SHELLCMD_ENABLE
{CMD_TYPE_EX, "ifconfig", XARGS, (CmdCallBackFunc)lwip_ifconfig},
{CMD_TYPE_EX, "ping", XARGS, (CmdCallBackFunc)OsShellPing},
@@ -69,6 +72,7 @@ CmdItem g_shellcmdAll[] = {
#if (LOSCFG_DEBUG_TOOLS == 1)
{CMD_TYPE_EX, "stack", 1, (CmdCallBackFunc)OsShellCmdStackDump},
{CMD_TYPE_EX, "hwi", 1, (CmdCallBackFunc)OsShellCmdHwiDump},
{CMD_TYPE_EX, "st", 1, (CmdCallBackFunc)OsShellCmdSchedTrace},
#endif
{CMD_TYPE_EX, "help", 0, (CmdCallBackFunc)OsShellCmdHelp},
};
@@ -82,7 +86,7 @@ CmdModInfo *OsCmdInfoGet(VOID)
* 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 character
* 2) Clear all space before first valid 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
@@ -111,7 +115,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
(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 */
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invalid charactor */
for (; *cmdKey != '\0'; cmdKey++) {
/* Detected a Double Quotes, switch the matching status */
if (*(cmdKey) == '\"') {

View File

@@ -49,7 +49,7 @@ LITE_OS_SEC_TEXT_MINOR STATIC UINT32 OsShellCmdFreeInfo(INT32 argc, const CHAR *
if ((argc == 0) ||
((argc == 1) && (strcmp(argv[0], "-k") == 0)) ||
((argc == 1) && (strcmp(argv[0], "-m") == 0))) {
PRINTK("\r\n total used free\n");
PRINTK("\n total used free\n");
}
if ((argc == 1) && (strcmp(argv[0], "-k") == 0)) {
@@ -79,3 +79,32 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdFree(INT32 argc, const CHAR *argv[])
return 0;
}
#if (LOSCFG_MEM_WATERLINE == 1)
LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdWaterLine(INT32 argc, const CHAR *argv[])
{
UINT32 ret;
LOS_MEM_POOL_STATUS poolStatus;
if (argc > 1) {
PRINTK("\nUsage: memusage or memusage [-k/-m]\n");
return OS_ERROR;
}
if (LOS_MemInfoGet(m_aucSysMem0, &poolStatus) != LOS_OK) {
return OS_ERROR;
}
if ((argc == 1) && (strcmp(argv[0], "-k") == 0)) {
PRINTK("Mem WaterLine: %-9u\n", MEM_SIZE_TO_KB(poolStatus.usageWaterLine));
} else if ((argc == 1) && (strcmp(argv[0], "-m") == 0)) {
PRINTK("Mem WaterLine: %-9u\n", MEM_SIZE_TO_MB(poolStatus.usageWaterLine));
} else if (argc == 0) {
PRINTK("Mem WaterLine: %-9u\n", poolStatus.usageWaterLine);
} else {
PRINTK("\nUsage: memusage or memusage [-k/-m]\n");
return OS_ERROR;
}
return 0;
}
#endif

View File

@@ -14,7 +14,7 @@ config TRACE_FRAME_CORE_MSG
depends on TRACE_MSG_EXTEND
config TRACE_FRAME_EVENT_COUNT
bool "Record event count, which indicate the sequence of happend events"
bool "Record event count, which indicate the sequence of happened events"
default n
depends on TRACE_MSG_EXTEND

View File

@@ -133,7 +133,7 @@ typedef enum {
/**
* @ingroup los_trace
* Trace event type which indicate the exactly happend events, user can define own module's event type like
* Trace event type which indicate the exactly happened events, user can define own module's event type like
* TRACE_#MODULE#_FLAG | NUMBER.
* 28 4
* 0 0 0 0 0 0 0 0 X X X X X X X X 0 0 0 0 0 0
@@ -241,7 +241,7 @@ typedef struct {
#endif
#if (LOSCFG_TRACE_FRAME_EVENT_COUNT == 1)
UINT32 eventCount; /**< the sequence of happend events */
UINT32 eventCount; /**< the sequence of happened events */
#endif
UINTPTR params[LOSCFG_TRACE_FRAME_MAX_PARAMS]; /**< event frame's params */
@@ -350,8 +350,8 @@ extern TRACE_EVENT_HOOK g_traceEventHook;
#define QUEUE_CREATE_PARAMS(queueId, queueSz, itemSz, queueAddr, memType) \
queueId, queueSz, itemSz, queueAddr, memType
#define QUEUE_DELETE_PARAMS(queueId, state, readable) queueId, state, readable
#define QUEUE_RW_PARAMS(queueId, queueSize, bufSize, operateType, readable, writeable, timeout) \
queueId, queueSize, bufSize, operateType, readable, writeable, timeout
#define QUEUE_RW_PARAMS(queueId, queueSize, bufSize, operateType, readable, writable, timeout) \
queueId, queueSize, bufSize, operateType, readable, writable, timeout
#define SEM_CREATE_PARAMS(semId, type, count) semId, type, count
#define SEM_DELETE_PARAMS(semId, delRetCode) semId, delRetCode

View File

@@ -4,7 +4,7 @@ config DRIVERS
help
Answer Y to enable LiteOS support driver.
source "../../drivers/adapter/khdf/liteos_m/Kconfig"
source "../../drivers/hdf_core/adapter/khdf/liteos_m/Kconfig"
# Device driver Kconfig import
osource "$(DEVICE_PATH)/drivers/Kconfig"

View File

@@ -692,11 +692,6 @@ osTimerId_t osTimerNew(osTimerFunc_t func, osTimerType_t type, void *argument, c
return NULL;
}
if (osTimerOnce == type) {
mode = LOS_SWTMR_MODE_NO_SELFDELETE;
} else {
mode = LOS_SWTMR_MODE_PERIOD;
}
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
if (LOS_SwtmrCreate(1, mode, (SWTMR_PROC_FUNC)func, &swtmrId, (UINT32)(UINTPTR)argument,
osTimerRousesAllow, osTimerAlignIgnore) != LOS_OK) {

View File

@@ -1,5 +1,5 @@
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2020-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:
@@ -32,6 +32,7 @@ import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
module_group(module_name) {
modules = [
"iccarm",
"musl",
"newlib",
]

View File

@@ -1,5 +1,5 @@
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2020-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:
@@ -41,4 +41,8 @@ config LIBC_NEWLIB
bool "newlibc"
rsource "newlib/Kconfig"
config LIBC_ICCARM
bool "iar libc"
rsource "iccarm/Kconfig"
endchoice

42
kal/libc/iccarm/BUILD.gn Normal file
View File

@@ -0,0 +1,42 @@
# Copyright (c) 2022-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:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_m/liteos.gni")
import("//third_party/musl/porting/liteos_m_iccarm/kernel/iccarm.gni")
module_switch = defined(LOSCFG_LIBC_ICCARM)
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
configs += [ "$LITEOSTOPDIR:warn_config" ]
deps = [ "//third_party/musl/porting/liteos_m_iccarm/kernel" ]
}
config("public") {
include_dirs = ICCARM_ADAPT_INCLUDE_DIRS
}

38
kal/libc/iccarm/Kconfig Normal file
View File

@@ -0,0 +1,38 @@
# Copyright (c) 2022-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:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if LIBC_ICCARM
config LIBC_ICCARM_FS
bool "Enable POSIX file system API support"
default y
depends on FS_VFS
help
This enables POSIX style file system related APIs.
endif # LIBC_ICCARM

View File

@@ -46,4 +46,11 @@
#include_next <sys/select.h>
#ifdef LOSCFG_ARCH_RISCV
#ifdef FD_ISSET(d, s)
#undef FD_ISSET(d, s)
#define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))
#endif
#endif
#endif //_ADAPT_SYS_SELECT_H

View File

@@ -45,7 +45,7 @@
#define PTHREAD_NAMELEN 16
#define PTHREAD_KEY_UNUSED 0
#define PTHREAD_KEY_USED 1
#define PTHREAD_TASK_INVAILD 0
#define PTHREAD_TASK_INVALID 0
typedef void (*PthreadKeyDtor)(void *);
typedef struct {
@@ -399,7 +399,7 @@ STATIC UINT32 DoPthreadCancel(LosTaskCB *task)
LOS_TaskLock();
pthreadData = (PthreadData *)(UINTPTR)task->arg;
pthreadData->canceled = 0;
if ((task->taskStatus == PTHREAD_TASK_INVAILD) || (LOS_TaskSuspend(task->taskID) != LOS_OK)) {
if ((task->taskStatus == PTHREAD_TASK_INVALID) || (LOS_TaskSuspend(task->taskID) != LOS_OK)) {
ret = LOS_NOK;
goto OUT;
}

View File

@@ -638,10 +638,8 @@ extern UINT8 *m_aucSysMem0;
/**
* @ingroup los_config
* Task extension field additional functions, such as IAR TLS.
* Please Use the LOSCFG_TASK_STRUCT_EXTENSION macro to define your task extended fields in target_config.h
*/
#ifndef LOSCFG_TASK_STRUCT_EXTENSION
#define LOSCFG_TASK_STRUCT_EXTENSION
#endif
#ifndef LOSCFG_TASK_CREATE_EXTENSION_HOOK
#define LOSCFG_TASK_CREATE_EXTENSION_HOOK(taskCB)
#endif

View File

@@ -238,7 +238,7 @@ extern VOID LOS_ShowBox(VOID *pool);
*
* @param boxMem [IN] Type #VOID* Pointer to the calculate membox.
* @param maxBlk [OUT] Type #UINT32* Record membox max block.
* @param blkCnt [OUT] Type #UINT32* Record membox block count alreay allocated.
* @param blkCnt [OUT] Type #UINT32* Record membox block count already allocated.
* @param blkSize [OUT] Type #UINT32* Record membox block size.
*
* @retval #LOS_OK The heap status calculate success.

View File

@@ -1500,7 +1500,9 @@ typedef struct {
#if (LOSCFG_KERNEL_SIGNAL == 1)
VOID *sig; /**< Task signal */
#endif
LOSCFG_TASK_STRUCT_EXTENSION /**< Task extension field */
#ifdef LOSCFG_TASK_STRUCT_EXTENSION
LOSCFG_TASK_STRUCT_EXTENSION; /**< Task extension field */
#endif
} LosTaskCB;
STATIC INLINE BOOL OsTaskIsExit(const LosTaskCB *taskCB)

View File

@@ -157,6 +157,10 @@ extern UINT32 g_sysClock;
#define OS_SYS_NS_TO_CYCLE(time, freq) (((time) / OS_SYS_NS_PER_SECOND) * (freq) + \
((time) % OS_SYS_NS_PER_SECOND) * (freq) / OS_SYS_NS_PER_SECOND)
#define OS_SYS_TICK_TO_CYCLE(ticks) (((UINT64)(ticks) * g_sysClock) / LOSCFG_BASE_CORE_TICK_PER_SECOND)
#define OS_SYS_CYCLE_TO_TICK(cycle) ((((UINT64)(cycle)) * LOSCFG_BASE_CORE_TICK_PER_SECOND) / g_sysClock)
/**
* @ingroup los_tick
* System time basic function error code: Null pointer.

View File

@@ -181,6 +181,14 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
OsTaskMonInit();
#endif
#if (LOSCFG_BASE_CORE_CPUP == 1)
ret = OsCpupInit();
if (ret != LOS_OK) {
PRINT_ERR("OsCpupInit error\n");
return ret;
}
#endif
#if (LOSCFG_BASE_IPC_SEM == 1)
ret = OsSemInit();
if (ret != LOS_OK) {
@@ -211,12 +219,12 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_KernelInit(VOID)
}
#endif
#if (LOSCFG_BASE_CORE_CPUP == 1)
ret = OsCpupInit();
if (ret != LOS_OK) {
PRINT_ERR("OsCpupInit error\n");
return ret;
}
#if (LOSCFG_CPUP_INCLUDE_IRQ == 1)
ret = OsCpupDaemonInit();
if (ret != LOS_OK) {
PRINT_ERR("OsCpupDaemonInit error\n");
return ret;
}
#endif
#if (LOSCFG_FS_VFS == 1)

View File

@@ -38,6 +38,9 @@
#if (LOSCFG_KERNEL_PM == 1)
#include "los_pm.h"
#endif
#if (LOSCFG_DEBUG_TOOLS == 1)
#include "los_debugtools.h"
#endif
#ifdef __cplusplus
#if __cplusplus
@@ -547,6 +550,9 @@ BOOL OsSchedTaskSwitch(VOID)
isTaskSwitch = TRUE;
OsHookCall(LOS_HOOK_TYPE_TASK_SWITCHEDIN);
#if (LOSCFG_DEBUG_TOOLS == 1)
OsSchedTraceRecord(newTask, runTask);
#endif
}
OsSchedTaskDeQueue(newTask);

View File

@@ -97,7 +97,7 @@ VOID OsAdd2SortLink(SortLinkList *node, UINT64 startTime, UINT32 waitTicks, Sort
}
intSave = LOS_IntLock();
SET_SORTLIST_VALUE(node, startTime + (UINT64)waitTicks * OS_CYCLE_PER_TICK);
SET_SORTLIST_VALUE(node, startTime + OS_SYS_TICK_TO_CYCLE(waitTicks));
OsAddNode2SortLink(sortLinkHead, node);
LOS_IntRestore(intSave);
}

View File

@@ -141,8 +141,8 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrTaskCreate(VOID)
STATIC UINT64 OsSwtmrCalcStartTime(UINT64 currTime, SWTMR_CTRL_S *swtmr, const SWTMR_CTRL_S *alignSwtmr)
{
UINT64 usedTime, startTime;
UINT64 alignEnd = (UINT64)alignSwtmr->uwInterval * OS_CYCLE_PER_TICK;
UINT64 swtmrTime = (UINT64)swtmr->uwInterval * OS_CYCLE_PER_TICK;
UINT64 alignEnd = OS_SYS_TICK_TO_CYCLE(alignSwtmr->uwInterval);
UINT64 swtmrTime = OS_SYS_TICK_TO_CYCLE(swtmr->uwInterval);
UINT64 remainTime = OsSortLinkGetRemainTime(currTime, &alignSwtmr->stSortList);
if (remainTime == 0) {
startTime = GET_SORTLIST_VALUE(&alignSwtmr->stSortList);
@@ -357,7 +357,7 @@ LITE_OS_SEC_TEXT UINT32 OsSwtmrGetNextTimeout(VOID)
UINT32 intSave = LOS_IntLock();
UINT64 time = OsSortLinkGetNextExpireTime(g_swtmrSortLinkList);
LOS_IntRestore(intSave);
time = time / OS_CYCLE_PER_TICK;
time = OS_SYS_CYCLE_TO_TICK(time);
if (time > OS_NULL_INT) {
time = OS_NULL_INT;
}
@@ -367,7 +367,7 @@ LITE_OS_SEC_TEXT UINT32 OsSwtmrGetNextTimeout(VOID)
LITE_OS_SEC_TEXT UINT32 OsSwtmrTimeGet(const SWTMR_CTRL_S *swtmr)
{
UINT64 time = OsSortLinkGetTargetExpireTime(OsGetCurrSchedTimeCycle(), &swtmr->stSortList);
time = time / OS_CYCLE_PER_TICK;
time = OS_SYS_CYCLE_TO_TICK(time);
if (time > OS_NULL_INT) {
time = OS_NULL_INT;
}

View File

@@ -157,7 +157,7 @@ STATIC VOID OsRecycleTaskResources(LosTaskCB *taskCB, UINTPTR *stackPtr)
}
}
STATIC VOID OsRecyleFinishedTask(VOID)
STATIC VOID OsRecycleFinishedTask(VOID)
{
LosTaskCB *taskCB = NULL;
UINT32 intSave;
@@ -197,7 +197,7 @@ UINT32 OsPmEnterHandlerSet(VOID (*func)(VOID))
LITE_OS_SEC_TEXT VOID OsIdleTask(VOID)
{
while (1) {
OsRecyleFinishedTask();
OsRecycleFinishedTask();
if (PmEnter != NULL) {
PmEnter();
@@ -307,18 +307,28 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskCpupInfo(CPUP_INFO_S **cpuLessOneSec,
LITE_OS_SEC_TEXT_MINOR VOID OsPrintAllTskInfoHeader(VOID)
{
PRINTK("\r\n TID Priority Status StackSize WaterLine StackPoint TopOfStack EventMask SemID");
#if (LOSCFG_TASK_MEM_USED == 1)
PRINTK(" AllocSize");
#endif
#if (LOSCFG_BASE_CORE_CPUP == 1)
PRINTK(" CPUUSE CPUUSE10s CPUUSE1s ");
#endif /* LOSCFG_BASE_CORE_CPUP */
PRINTK(" TaskEntry name\n");
PRINTK(" --- -------- -------- ");
PRINTK("--------- --------- ---------- ---------- --------- ------ ");
#if (LOSCFG_TASK_MEM_USED == 1)
PRINTK("--------- ");
#endif
#if (LOSCFG_BASE_CORE_CPUP == 1)
PRINTK("------- --------- -------- ");
#endif /* LOSCFG_BASE_CORE_CPUP */
PRINTK("---------- ----\n");
}
#if (LOSCFG_TASK_MEM_USED == 1)
STATIC UINT32 g_taskMemUsed[LOSCFG_BASE_CORE_TSK_LIMIT + 1];
#endif
/*****************************************************************************
Function : OsGetAllTskInfo
Description : Get all task info.
@@ -338,6 +348,11 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskInfo(VOID)
CPUP_INFO_S *cpuOneSec = (CPUP_INFO_S *)NULL;
#endif
#if (LOSCFG_TASK_MEM_USED == 1)
(VOID)memset_s(g_taskMemUsed, sizeof(UINT32) * g_taskMaxNum, 0, sizeof(UINT32) * g_taskMaxNum);
OsTaskMemUsed((VOID *)OS_SYS_MEM_ADDR, g_taskMemUsed, g_taskMaxNum);
#endif
#if (LOSCFG_BASE_CORE_CPUP == 1)
if (OsGetAllTskCpupInfo(&cpuLessOneSec, &cpuTenSec, &cpuOneSec) != LOS_OK) {
return OS_ERROR;
@@ -357,6 +372,9 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllTskInfo(VOID)
taskCB->taskID, taskCB->priority, OsConvertTskStatus(taskCB->taskStatus),
taskCB->stackSize, OsGetTaskWaterLine(taskCB->taskID),
(UINT32)(UINTPTR)taskCB->stackPointer, taskCB->topOfStack, taskCB->eventMask, semID);
#if (LOSCFG_TASK_MEM_USED == 1)
PRINTK("%#10x", g_taskMemUsed[loopNum]);
#endif
#if (LOSCFG_BASE_CORE_CPUP == 1)
PRINTK("%6u.%-2u%7u.%-2u%6u.%-2u ",
@@ -759,7 +777,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskCreateOnly(UINT32 *taskID, TSK_INIT_PARAM_S
return retVal;
}
OsRecyleFinishedTask();
OsRecycleFinishedTask();
intSave = LOS_IntLock();
if (LOS_ListEmpty(&g_losFreeTask)) {
@@ -1508,5 +1526,5 @@ LITE_OS_SEC_TEXT_MINOR VOID LOS_Msleep(UINT32 mSecs)
VOID LOS_TaskResRecycle(VOID)
{
OsRecyleFinishedTask();
OsRecycleFinishedTask();
}

View File

@@ -49,13 +49,17 @@ LITE_OS_SEC_BSS STATIC UINT64 g_tickTimerStartTime;
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
STATIC UINT64 g_tickTimerBase;
STATIC UINT64 g_oldTickTimerBase;
STATIC BOOL g_tickTimerBaseUpdate = FALSE;
LITE_OS_SEC_TEXT STATIC VOID OsUpdateSysTimeBase(VOID)
{
UINT32 period = 0;
(VOID)g_sysTickTimer->getCycle(&period);
g_tickTimerBase += period;
if (g_tickTimerBaseUpdate == FALSE) {
(VOID)g_sysTickTimer->getCycle(&period);
g_tickTimerBase += period;
}
g_tickTimerBaseUpdate = FALSE;
}
LITE_OS_SEC_TEXT VOID OsTickTimerBaseReset(UINT64 currTime)
@@ -96,6 +100,7 @@ LITE_OS_SEC_TEXT UINT64 LOS_SysCycleGet(VOID)
/* Turn the timer count */
g_tickTimerBase += period;
schedTime = g_tickTimerBase + time;
g_tickTimerBaseUpdate = TRUE;
}
LOS_ASSERT(schedTime >= g_oldTickTimerBase);
@@ -285,7 +290,7 @@ Return : current tick
*****************************************************************************/
LITE_OS_SEC_TEXT_MINOR UINT64 LOS_TickCountGet(VOID)
{
return (LOS_SysCycleGet() - g_tickTimerStartTime) / g_cyclesPerTick;
return OS_SYS_CYCLE_TO_TICK(LOS_SysCycleGet() - g_tickTimerStartTime);
}
/*****************************************************************************

View File

@@ -52,7 +52,7 @@ import("$root_out_dir/config.gni")
LITEOSTOPDIR = "//kernel/liteos_m"
LITEOSTHIRDPARTY = "//third_party"
HDFTOPDIR = "//drivers/adapter/khdf/liteos_m"
HDFTOPDIR = "//drivers/hdf_core/adapter/khdf/liteos_m"
ARCH = ""
if (defined(LOSCFG_ARCH_ARM_AARCH32)) {

View File

@@ -181,7 +181,7 @@ typedef enum EXCn {
#define __ICACHE_PRESENT 0 /*!< Set to 1 if I-Cache is present */
#define __DCACHE_PRESENT 0 /*!< Set to 1 if D-Cache is present */
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
#define __Vendor_EXCEPTION 0 /*!< Set to 1 if vendor exception hander is present */
#define __Vendor_EXCEPTION 0 /*!< Set to 1 if vendor exception handler is present */
/** @} */ /* End of group Configuration_of_CMSIS */

View File

@@ -84,7 +84,7 @@
#endif
#endif
/****************** C Compilers dependant keywords ****************************/
/****************** C Compilers dependent keywords ****************************/
/* In HS mode and when the DMA is used, all variables and data structures dealing
with the DMA during the transaction process should be 4-bytes aligned */
#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED

View File

@@ -195,7 +195,7 @@ typedef enum EXCn {
#define __ICACHE_PRESENT 0 /*!< Set to 1 if I-Cache is present */
#define __DCACHE_PRESENT 0 /*!< Set to 1 if D-Cache is present */
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
#define __Vendor_EXCEPTION 0 /*!< Set to 1 if vendor exception hander is present */
#define __Vendor_EXCEPTION 0 /*!< Set to 1 if vendor exception handler is present */
/** @} */ /* End of group Configuration_of_CMSIS */

View File

@@ -94,7 +94,7 @@ OF SUCH DAMAGE.
/* USARTx_CTL1 */
#define USART_CTL1_ADDR BITS(0,3) /*!< address of USART */
#define USART_CTL1_LBLEN BIT(5) /*!< LIN break frame length */
#define USART_CTL1_LBDIE BIT(6) /*!< LIN break detected interrupt eanble */
#define USART_CTL1_LBDIE BIT(6) /*!< LIN break detected interrupt enable */
#define USART_CTL1_CLEN BIT(8) /*!< CK length */
#define USART_CTL1_CPH BIT(9) /*!< CK phase */
#define USART_CTL1_CPL BIT(10) /*!< CK polarity */

View File

@@ -386,11 +386,11 @@ static uint32_t usbd_int_rxfifo (usb_core_driver *udev)
break;
case RSTAT_XFER_COMP:
/* trigger the OUT enpoint interrupt */
/* trigger the OUT endpoint interrupt */
break;
case RSTAT_SETUP_COMP:
/* trigger the OUT enpoint interrupt */
/* trigger the OUT endpoint interrupt */
break;
case RSTAT_SETUP_UPDT:

View File

@@ -56,7 +56,7 @@ void usbd_init (usb_core_driver *udev, usb_core_enum core, usb_class_core *class
/* device descriptor, class and user callbacks */
udev->dev.class_core = class_core;
/* configure USB capabilites */
/* configure USB capabilities */
usb_basic_init (&udev->bp, &udev->regs, core);
/* initailizes the USB core*/

View File

@@ -214,7 +214,7 @@ void usbh_core_task (usb_core_driver *pudev, usbh_host *puhost)
break;
case HOST_CLASS_ENUM:
/* process class standard contol requests state machine */
/* process class standard control requests state machine */
status = puhost->class_cb->class_requests(pudev, puhost);
if (USBH_OK == status) {

View File

@@ -182,7 +182,7 @@ ErrStatus can_init(uint32_t can_periph, can_parameter_struct* can_parameter_init
}else{
CAN_CTL(can_periph) &= ~CAN_CTL_TTC;
}
/* automatic bus-off managment */
/* automatic bus-off management */
if(ENABLE == can_parameter_init->auto_bus_off_recovery){
CAN_CTL(can_periph) |= CAN_CTL_ABOR;
}else{

View File

@@ -665,7 +665,7 @@ void dma_interrupt_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, ui
\param[in] channelx: specify which DMA channel
only one parameter can be selected which is shown as below:
\arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4)
\param[in] source: specify which interrupt to enbale
\param[in] source: specify which interrupt to enable
one or more parameters can be selected which are shown as below
\arg DMA_INT_FTF: channel full transfer finish interrupt
\arg DMA_INT_HTF: channel half transfer finish interrupt
@@ -689,7 +689,7 @@ void dma_interrupt_enable(uint32_t dma_periph, dma_channel_enum channelx, uint32
\param[in] channelx: specify which DMA channel
only one parameter can be selected which is shown as below:
\arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4)
\param[in] source: specify which interrupt to disbale
\param[in] source: specify which interrupt to disable
one or more parameters can be selected which are shown as below
\arg DMA_INT_FTF: channel full transfer finish interrupt
\arg DMA_INT_HTF: channel half transfer finish interrupt

View File

@@ -244,7 +244,7 @@ void rtc_interrupt_flag_clear(uint32_t flag)
/*!
\brief enable RTC interrupt
\param[in] interrupt: specify which interrupt to enbale
\param[in] interrupt: specify which interrupt to enable
one or more parameters can be selected which are shown as below:
\arg RTC_INT_SECOND: second interrupt
\arg RTC_INT_ALARM: alarm interrupt
@@ -259,7 +259,7 @@ void rtc_interrupt_enable(uint32_t interrupt)
/*!
\brief disable RTC interrupt
\param[in] interrupt: specify which interrupt to disbale
\param[in] interrupt: specify which interrupt to disable
one or more parameters can be selected which are shown as below:
\arg RTC_INT_SECOND: second interrupt
\arg RTC_INT_ALARM: alarm interrupt

View File

@@ -80,7 +80,7 @@ void spi_i2s_deinit(uint32_t spi_periph)
/*!
\brief initialize the parameters of SPI struct with the default values
\param[in] spi_struct: SPI parameter stuct
\param[in] spi_struct: SPI parameter struct
\param[out] none
\retval none
*/

View File

@@ -407,7 +407,7 @@ void timer_dma_enable(uint32_t timer_periph, uint16_t dma)
/*!
\brief disable the TIMER DMA
\param[in] timer_periph: TIMERxTIMERx(x=0..6)
\param[in] dma: specify which DMA to disbale
\param[in] dma: specify which DMA to disable
one or more parameters can be selected which are shown as below:
\arg TIMER_DMA_UPD: update DMA enable, TIMERx(x=0..6)
\arg TIMER_DMA_CH0D: channel 0 DMA enable, TIMERx(x=0..4)
@@ -1844,7 +1844,7 @@ void timer_interrupt_enable(uint32_t timer_periph, uint32_t interrupt)
/*!
\brief disable the TIMER interrupt
\param[in] timer_periph: TIMERx(x=0..6)
\param[in] interrupt: specify which interrupt to disbale
\param[in] interrupt: specify which interrupt to disable
one or more parameters can be selected which are shown as below:
\arg TIMER_INT_UP: update interrupt enable, TIMERx(x=0..6)
\arg TIMER_INT_CH0: channel 0 interrupt enable, TIMERx(x=0..4)

View File

@@ -300,7 +300,7 @@ extern UINT32 TaskUsedCountGet(VOID);
#define HWI_NUM_TEST 31 // csky_v2 only support one software interrupt number
#define LOS_KERNEL_MULTI_HWI_TEST 0 // csky_v2 not support multiple hwi number test case
#elif __XTENSA_LX6__
#define HWI_NUM_TEST 7 // xtensa_lx6 only suppport one software interrupt number
#define HWI_NUM_TEST 7 // xtensa_lx6 only support one software interrupt number
#define LOS_KERNEL_MULTI_HWI_TEST 0 // xtensa_lx6 not support multiple hwi number test case
#else
#define HWI_NUM_TEST HWI_NUM_INT7

View File

@@ -56,7 +56,7 @@ static VOID TaskF01(VOID)
ICUNIT_GOTO_STRING_EQUAL(g_taskInfo.acName, "Tsk049A", g_taskInfo.acName, EXIT1);
ICUNIT_GOTO_EQUAL(g_taskInfo.uwTaskID, g_testTaskID01, g_taskInfo.uwTaskID, EXIT1);
// 2, Assert that current task`s priority is equal to the priority was setted.
// 2, Assert that current task`s priority is equal to the priority was set.
ICUNIT_GOTO_EQUAL(g_taskInfo.usTaskPrio, TASK_PRIO_TEST - 2, g_taskInfo.usTaskPrio, EXIT1);
ICUNIT_GOTO_EQUAL(OS_TASK_STATUS_RUNNING & g_taskInfo.usTaskStatus, OS_TASK_STATUS_RUNNING,
OS_TASK_STATUS_RUNNING & g_taskInfo.usTaskStatus, EXIT1);

View File

@@ -853,13 +853,13 @@ LITE_TEST_CASE(PthreadFuncTestSuite, TestPthread013, Function | MediumTest | Lev
ret = pthread_condattr_getclock(&condattr, &clk);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ICUNIT_ASSERT_EQUAL(clk, 0, clk);
ICUNIT_ASSERT_EQUAL(clk, CLOCK_REALTIME, clk);
ret = pthread_condattr_setclock(&condattr, 0);
ret = pthread_condattr_setclock(&condattr, CLOCK_REALTIME);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = pthread_condattr_getclock(&condattr, &clk);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ICUNIT_ASSERT_EQUAL(clk, 0, clk);
ICUNIT_ASSERT_EQUAL(clk, CLOCK_REALTIME, clk);
struct timespec ts = {0};
ret = clock_getres(CLOCK_MONOTONIC, &ts);

View File

@@ -93,7 +93,7 @@ static BOOL MqueueFuncTestSuiteTearDown(void)
/**
* @tc.number : SUB_KERNEL_PTHREAD_OPERATION_001
* @tc.name : event operation for creat
* @tc.name : event operation for create
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE(MqueueFuncTestSuite, testMqueue001, Function | MediumTest | Level1)

View File

@@ -154,7 +154,7 @@ LITE_TEST_CASE(PosixSemaphoreFuncTestSuite, testIpcSem_Timedwait002, Function |
LOG("\n timeDiff %d", timeDiff);
TEST_ASSERT_LESS_THAN_INT(20, timeDiff);
// try get semphore again
// try get semaphore again
ts = GetDelayedTime(100);
LOG("\n ts %d, %d", ts.tv_sec, ts.tv_nsec);
ret = sem_timedwait((sem_t *)&sem, &ts);

View File

@@ -96,12 +96,12 @@ static int KeepRun(int msec)
clock_gettime(CLOCK_MONOTONIC, &time1);
LOG("KeepRun start : tv_sec=%ld, tv_nsec=%ld\n", time1.tv_sec, time1.tv_nsec);
int loop = 0;
int runned = 0;
while (runned < msec) {
int ran = 0;
while (ran < msec) {
++loop;
clock_gettime(CLOCK_MONOTONIC, &time2);
runned = (time2.tv_sec - time1.tv_sec) * MILLISECONDS_PER_SECOND;
runned += (time2.tv_nsec - time1.tv_nsec) / NANOSECONDS_PER_MILLISECOND;
ran = (time2.tv_sec - time1.tv_sec) * MILLISECONDS_PER_SECOND;
ran += (time2.tv_nsec - time1.tv_nsec) / NANOSECONDS_PER_MILLISECOND;
}
LOG("KeepRun end : tv_sec=%ld, tv_nsec=%ld\n", time2.tv_sec, time2.tv_nsec);