commit
d0e0bb5934
|
@ -331,7 +331,7 @@ ssize_t read(int fd, void *buf, size_t nbyte)
|
|||
errno = EINVAL;
|
||||
return FS_FAILURE;
|
||||
}
|
||||
if (nbyte > 1024) {
|
||||
if (nbyte > 1024) { /* 1024, max random_size */
|
||||
nbyte = 1024; /* hks_generate_random: random_size must <= 1024 */
|
||||
}
|
||||
struct hks_blob key = {HKS_BLOB_TYPE_RAW, (uint8_t *)buf, nbyte};
|
||||
|
|
|
@ -47,11 +47,9 @@
|
|||
#include "lwip/icmp.h"
|
||||
#include "los_config.h"
|
||||
#include <string.h>
|
||||
#include "lwip/api_shell.h"
|
||||
|
||||
#include "shcmd.h"
|
||||
#include "shell.h"
|
||||
#include "los_timer_pri.h"
|
||||
#include "los_debug.h"
|
||||
#include "los_task.h"
|
||||
|
||||
|
@ -317,8 +315,7 @@ static int ping_kill = 0;
|
|||
|
||||
static void lwip_ping_usage(void)
|
||||
{
|
||||
PRINTK("Usage:"\
|
||||
"\n ping [ip]\n"
|
||||
PRINTK("Usage:\n ping [ip]\n");
|
||||
}
|
||||
|
||||
LWIP_STATIC int OsPingFunc(u32_t *parg)
|
||||
|
@ -332,11 +329,11 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
|||
u32_t iecho_len;
|
||||
s16_t ip_hlen;
|
||||
u32_t forever;
|
||||
u32_t i = 0;
|
||||
u32_t i;
|
||||
u32_t succ_cnt = 0;
|
||||
u32_t failed_cnt = 0;
|
||||
struct timespec start, end;
|
||||
long timout_ms = 0;
|
||||
long timout_ms;
|
||||
struct pollfd pfd;
|
||||
long rtt;
|
||||
int ret = 0;
|
||||
|
|
|
@ -64,7 +64,7 @@ char *GetCmdName(const char *cmdline, unsigned int len)
|
|||
{
|
||||
unsigned int loop;
|
||||
const char *tmpStr = NULL;
|
||||
bool quotes = FALSE;
|
||||
BOOL quotes = FALSE;
|
||||
char *cmdName = NULL;
|
||||
if (cmdline == NULL) {
|
||||
return NULL;
|
||||
|
@ -114,12 +114,10 @@ int ShellCmdExec(const char *msgName, const char *cmdString)
|
|||
}
|
||||
|
||||
uintRet = ShellMsgTypeGet(&cmdParsed, msgName);
|
||||
|
||||
if (uintRet != LOS_OK) {
|
||||
PRINTK("%s:command not found\n", msgName);
|
||||
return -EFAULT;
|
||||
} else {
|
||||
|
||||
(void)OsCmdExec(&cmdParsed, (char *)cmdString);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -88,11 +88,11 @@ static char *StrNormalizePath(char *fullpath)
|
|||
while (*src != '\0') {
|
||||
if (*src == '.') {
|
||||
if (*(src + 1) == '/') {
|
||||
src += 2;
|
||||
src += 2; /* 2, sizeof "./" */
|
||||
continue;
|
||||
} else if (*(src + 1) == '.') {
|
||||
if ((*(src + 2) == '/') || (*(src + 2) == '\0')) {
|
||||
src += 2;
|
||||
if ((*(src + 2) == '/') || (*(src + 2) == '\0')) { /* 2, 2, offset to check */
|
||||
src += 2; /* 2, sizeof offset */
|
||||
} else {
|
||||
while ((*src != '\0') && (*src != '/')) {
|
||||
*dest++ = *src++;
|
||||
|
@ -174,7 +174,7 @@ static char *VfsNotAbsolutePath(const char *directory, const char *filename, cha
|
|||
/* 2: The position of the path character: / and the end character /0 */
|
||||
|
||||
if ((namelen > 1) && (filename[0] == '.') && (filename[1] == '/')) {
|
||||
filename += 2;
|
||||
filename += 2; /* 2, sizeof "./" */
|
||||
}
|
||||
|
||||
fullpath = (char *)malloc(strlen(directory) + namelen + 2);
|
||||
|
@ -184,8 +184,7 @@ static char *VfsNotAbsolutePath(const char *directory, const char *filename, cha
|
|||
return (char *)NULL;
|
||||
}
|
||||
|
||||
/* join path and file name */
|
||||
|
||||
/* 2, sizeof "./", join path and file name */
|
||||
ret = snprintf_s(fullpath, strlen(directory) + namelen + 2, strlen(directory) + namelen + 1,
|
||||
"%s/%s", directory, filename);
|
||||
if (ret < 0) {
|
||||
|
@ -213,7 +212,6 @@ static char *VfsNormalizeFullpath(const char *directory, const char *filename, c
|
|||
/* it's a absolute path, use it directly */
|
||||
|
||||
fullpath = strdup(filename); /* copy string */
|
||||
|
||||
if (fullpath == NULL) {
|
||||
*pathname = NULL;
|
||||
SetErrno(ENOMEM);
|
||||
|
@ -246,8 +244,7 @@ int VfsNormalizePath(const char *directory, const char *filename, char **pathnam
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* 2: The position of the path character: / and the end character /0 */
|
||||
|
||||
/* 2, The position of the path character: / and the end character /0 */
|
||||
if ((filename[0] != '/') && (strlen(directory) + namelen + 2 > TEMP_PATH_MAX)) {
|
||||
return -ENAMETOOLONG;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ declare_args() {
|
|||
enable_ohos_kernel_liteos_m_exchook = true
|
||||
enable_ohos_kernel_liteos_m_kal = true
|
||||
enable_ohos_kernel_liteos_m_fs = true
|
||||
enable_ohos_kernel_liteos_m_shell = false
|
||||
enable_ohos_kernel_liteos_m_shell = true
|
||||
enable_ohos_kernel_liteos_m_backtrace = true
|
||||
enable_ohos_kernel_liteos_m_test = false
|
||||
enable_ohos_kernel_liteos_m_pm = true
|
||||
|
|
|
@ -231,3 +231,23 @@ int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stackSize)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sched_get_priority_min(int policy)
|
||||
{
|
||||
if (policy != SCHED_RR) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return LOS_TASK_PRIORITY_LOWEST;
|
||||
}
|
||||
|
||||
int sched_get_priority_max(int policy)
|
||||
{
|
||||
if (policy != SCHED_RR) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return LOS_TASK_PRIORITY_HIGHEST;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "los_swtmr.h"
|
||||
#include "los_tick.h"
|
||||
#include "los_context.h"
|
||||
#include "los_interrupt.h"
|
||||
|
||||
/* accumulative time delta from discontinuous modify */
|
||||
STATIC struct timespec g_accDeltaFromSet;
|
||||
|
|
|
@ -61,7 +61,7 @@ static_library("kernel") {
|
|||
} else if ("$board_cpu" == "cortex-m7") {
|
||||
deps = [ "arch/arm/cortex-m7/gcc/:arch" ]
|
||||
} else if ("$board_cpu" == "cortex-m33") {
|
||||
deps = [ "arch/arm/cortex-m33/gcc/:arch" ]
|
||||
deps = [ "arch/arm/cortex-m33/gcc/TZ:arch" ]
|
||||
} else if ("$board_cpu" == "") {
|
||||
if ("$board_arch" == "rv32imac" || "$board_arch" == "rv32imafdc") {
|
||||
deps = [ "arch/risc-v/riscv32/gcc:arch" ]
|
||||
|
|
|
@ -545,7 +545,7 @@ VOID HalExcHardFault(VOID);
|
|||
VOID HalExcMemFault(VOID);
|
||||
VOID HalExcBusFault(VOID);
|
||||
VOID HalExcUsageFault(VOID);
|
||||
VOID HalExcSvcCall(VOID);
|
||||
VOID HalSVCHandler(VOID);
|
||||
VOID HalHwiInit();
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
.global HalExcMemFault
|
||||
.global HalExcBusFault
|
||||
.global HalExcUsageFault
|
||||
.global HalExcSvcCall
|
||||
.global HalSVCHandler
|
||||
|
||||
.extern HalExcHandleEntry
|
||||
.extern g_uwExcTbl
|
||||
|
@ -148,9 +148,9 @@ osHFExcCommonBMU:
|
|||
B osExcDispatch
|
||||
.fnend
|
||||
|
||||
.type HalExcSvcCall, %function
|
||||
.global HalExcSvcCall
|
||||
HalExcSvcCall:
|
||||
.type HalSVCHandler, %function
|
||||
.global HalSVCHandler
|
||||
HalSVCHandler:
|
||||
.fnstart
|
||||
.cantunwind
|
||||
TST LR, #0x4
|
||||
|
|
|
@ -497,7 +497,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit()
|
|||
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[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;
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ static_library("arch") {
|
|||
]
|
||||
|
||||
include_dirs = [
|
||||
"./non_secure",
|
||||
"./secure",
|
||||
"../../../../../../kernel/arch/include",
|
||||
"../../../../../../kernel/arch/include",
|
||||
"../../../../../../kernel/include",
|
||||
|
|
|
@ -545,7 +545,7 @@ VOID HalExcHardFault(VOID);
|
|||
VOID HalExcMemFault(VOID);
|
||||
VOID HalExcBusFault(VOID);
|
||||
VOID HalExcUsageFault(VOID);
|
||||
VOID HalExcSvcCall(VOID);
|
||||
VOID HalSVCHandler(VOID);
|
||||
VOID HalHwiInit();
|
||||
|
||||
|
||||
|
|
|
@ -48,8 +48,6 @@
|
|||
.type HalStartFirstTask, %function
|
||||
.global HalStartFirstTask
|
||||
HalStartFirstTask:
|
||||
.fnstart
|
||||
.cantunwind
|
||||
MOV R0, #2
|
||||
MSR CONTROL, R0
|
||||
|
||||
|
@ -77,7 +75,6 @@ __DisabledFPU1:
|
|||
MSR PSP, R12
|
||||
CPSIE I
|
||||
BX R3
|
||||
.fnend
|
||||
|
||||
.type HalIntLock, %function
|
||||
.global HalIntLock
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
.global HalExcMemFault
|
||||
.global HalExcBusFault
|
||||
.global HalExcUsageFault
|
||||
.global HalExcSvcCall
|
||||
|
||||
.extern HalExcHandleEntry
|
||||
.extern g_uwExcTbl
|
||||
|
@ -148,21 +147,6 @@ osHFExcCommonBMU:
|
|||
B osExcDispatch
|
||||
.fnend
|
||||
|
||||
.type HalExcSvcCall, %function
|
||||
.global HalExcSvcCall
|
||||
HalExcSvcCall:
|
||||
.fnstart
|
||||
.cantunwind
|
||||
TST LR, #0x4
|
||||
ITE EQ
|
||||
MRSEQ R0, MSP
|
||||
MRSNE R0, PSP
|
||||
LDR R1, [R0,#24]
|
||||
LDRB R0, [R1,#-2]
|
||||
MOV R1, #0
|
||||
B osExcDispatch
|
||||
.fnend
|
||||
|
||||
.type HalExcBusFault, %function
|
||||
.global HalExcBusFault
|
||||
HalExcBusFault:
|
||||
|
|
|
@ -497,7 +497,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit()
|
|||
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[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;
|
||||
|
||||
|
|
|
@ -63,5 +63,3 @@ extern VOID HalSecureContextSaveAsm(OsSecureContext *secureContext);
|
|||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ HalSecureContextSaveAsm:
|
|||
MOV R0, #0
|
||||
MSR PSPLIM, R0 /* No PSPLIM for the current task. */
|
||||
MSR PSP, R0 /* No secure stack for the current task. */
|
||||
.fnend
|
||||
|
||||
__ThreadMode:
|
||||
BX LR
|
||||
.fnend
|
|
@ -29,7 +29,6 @@
|
|||
extern VOID HalHwiInit(VOID);
|
||||
|
||||
#define INITIAL_MSTATUS ( MSTATUS_MPP | MSTATUS_MPIE | MSTATUS_FS_INITIAL)
|
||||
|
||||
#define ALIGN_DOWN(size, align) ((size) & ~((align) - 1))
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue