Compare commits
30 Commits
OpenHarmon
...
OpenHarmon
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1eb753cd25 | ||
|
|
19769f795b | ||
|
|
5b44332cff | ||
|
|
0d50fad855 | ||
|
|
a37c850d1b | ||
|
|
1eca7a502a | ||
|
|
80e24fa9db | ||
|
|
15bded54c9 | ||
|
|
2a0db42072 | ||
|
|
de82bf893a | ||
|
|
a0bb06189d | ||
|
|
a8513ae614 | ||
|
|
0c203c1e57 | ||
|
|
93658ba478 | ||
|
|
58aea01f5a | ||
|
|
d39ed70c65 | ||
|
|
3e6bab5158 | ||
|
|
672cff7ee5 | ||
|
|
3ad07bc40f | ||
|
|
1e8d5baf8c | ||
|
|
b744cfa164 | ||
|
|
51a24eaeb2 | ||
|
|
07fb6c150e | ||
|
|
7ceaf68832 | ||
|
|
309e7569f8 | ||
|
|
e42cb26b14 | ||
|
|
8ab4c9a6bc | ||
|
|
a40dc411b2 | ||
|
|
ebe33aa2f6 | ||
|
|
ece0e8ae06 |
@@ -37,7 +37,7 @@ LIBSOUT := $(OBJOUT)/libs
|
||||
IMGOUT := $(OUT)
|
||||
|
||||
# common flags config
|
||||
BASE_OPTS := -ffunction-sections -fdata-sections -fno-omit-frame-pointer -D_GNU_SOURCE \
|
||||
BASE_OPTS := -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-common -fno-strict-aliasing -D_GNU_SOURCE \
|
||||
$(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LLVM_EXTRA_OPTS) $(LITEOS_GCOV_OPTS)
|
||||
|
||||
CFLAGS := -std=c99 -fno-exceptions $(BASE_OPTS) $(LITEOS_COPTS_OPTMIZE)
|
||||
|
||||
@@ -65,7 +65,9 @@
|
||||
|
||||
.equ MPIDR_CPUID_MASK, 0xffU
|
||||
|
||||
.fpu vfpv4
|
||||
.fpu neon-vfpv4
|
||||
.syntax unified
|
||||
.arch armv7-a
|
||||
.arm
|
||||
|
||||
/* param0 is stack bottom, param1 is stack size, r12 hold cpu id */
|
||||
@@ -187,7 +189,7 @@ reloc_img_to_bottom_done:
|
||||
mov r0, r4
|
||||
mov r1, #0
|
||||
mov r2, #MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS
|
||||
bl memset
|
||||
bl memset_optimized /* optimized memset since r0 is 64-byte aligned */
|
||||
|
||||
PAGE_TABLE_SET SYS_MEM_BASE, KERNEL_VMM_BASE, KERNEL_VMM_SIZE, MMU_DESCRIPTOR_KERNEL_L1_PTE_FLAGS
|
||||
PAGE_TABLE_SET SYS_MEM_BASE, UNCACHED_VMM_BASE, UNCACHED_VMM_SIZE, MMU_INITIAL_MAP_NORMAL_NOCACHE
|
||||
@@ -463,6 +465,18 @@ _bootaddr_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
memset_optimized:
|
||||
mov r3, r0
|
||||
vdup.8 q0, r1
|
||||
vmov q1, q0
|
||||
vmov q2, q0
|
||||
vmov q3, q0
|
||||
memset_optimized_loop:
|
||||
subs r2, #64
|
||||
vstmia r3!, {d0 - d7}
|
||||
bge memset_optimized_loop
|
||||
bx lr
|
||||
|
||||
init_done:
|
||||
.long 0xDEADB00B
|
||||
|
||||
|
||||
@@ -65,7 +65,9 @@
|
||||
|
||||
.equ MPIDR_CPUID_MASK, 0xffU
|
||||
|
||||
.fpu vfpv4
|
||||
.fpu neon-vfpv4
|
||||
.syntax unified
|
||||
.arch armv7-a
|
||||
.arm
|
||||
|
||||
/* param0 is stack bottom, param1 is stack size, r11 hold cpu id */
|
||||
@@ -164,7 +166,7 @@ reloc_img_to_bottom_done:
|
||||
mov r0, r4
|
||||
mov r1, #0
|
||||
mov r2, #MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS
|
||||
bl memset
|
||||
bl memset_optimized /* optimized memset since r0 is 64-byte aligned */
|
||||
|
||||
|
||||
PAGE_TABLE_SET SYS_MEM_BASE, KERNEL_VMM_BASE, KERNEL_VMM_SIZE, MMU_DESCRIPTOR_KERNEL_L1_PTE_FLAGS
|
||||
@@ -431,6 +433,18 @@ _bootaddr_setup:
|
||||
|
||||
bx lr
|
||||
|
||||
memset_optimized:
|
||||
mov r3, r0
|
||||
vdup.8 q0, r1
|
||||
vmov q1, q0
|
||||
vmov q2, q0
|
||||
vmov q3, q0
|
||||
memset_optimized_loop:
|
||||
subs r2, #64
|
||||
vstmia r3!, {d0 - d7}
|
||||
bge memset_optimized_loop
|
||||
bx lr
|
||||
|
||||
init_done:
|
||||
.long 0xDEADB00B
|
||||
|
||||
|
||||
12
build.sh
12
build.sh
@@ -38,22 +38,22 @@ outdir="../..$3/test_info/gen/kernel/test"
|
||||
if [ "$5" = "tee" ]; then
|
||||
tee="_tee"
|
||||
fi
|
||||
productName="$(basename $7)"
|
||||
source="tools/build/config/${productName}_release.config"
|
||||
product_name="$(basename $7)"
|
||||
source="tools/build/config/${product_name}_release.config"
|
||||
if [ "$2" = "clang" ]; then
|
||||
if [ "$4" = "debug" ]; then
|
||||
config_file="${productName}_$2$tee.config"
|
||||
config_file="${product_name}_$2$tee.config"
|
||||
source="tools/build/config/debug/$config_file"
|
||||
else
|
||||
config_file="${productName}_$2_release$tee.config"
|
||||
config_file="${product_name}_$2_release$tee.config"
|
||||
source="tools/build/config/$config_file"
|
||||
fi
|
||||
elif [ "$2" = "gcc" ]; then
|
||||
if [ "$4" = "debug" ]; then
|
||||
config_file="${productName}_debug_shell$tee.config"
|
||||
config_file="${product_name}_debug_shell$tee.config"
|
||||
source="tools/build/config/$config_file"
|
||||
else
|
||||
config_file="${productName}_release$tee.config"
|
||||
config_file="${product_name}_release$tee.config"
|
||||
source="tools/build/config/$config_file"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -700,6 +700,8 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName);
|
||||
*
|
||||
*/
|
||||
INT32 los_get_diskid_byname(const CHAR *diskName);
|
||||
INT32 DiskEventRead(void);
|
||||
INT32 DiskEventInit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
||||
@@ -58,6 +58,10 @@ spinlock_t g_diskFatBlockSpinlock;
|
||||
|
||||
UINT32 g_usbMode = 0;
|
||||
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
static struct tagEvent g_diskInitEvent;
|
||||
#endif
|
||||
|
||||
#define MEM_ADDR_ALIGN_BYTE 64
|
||||
#define RWE_RW_RW 0755
|
||||
|
||||
@@ -1275,20 +1279,20 @@ static INT32 DiskDeinit(los_disk *disk)
|
||||
#endif
|
||||
|
||||
disk->dev = NULL;
|
||||
DISK_UNLOCK(&disk->disk_mutex);
|
||||
|
||||
(VOID)unregister_blockdriver(disk->disk_name);
|
||||
if (disk->disk_name != NULL) {
|
||||
LOS_MemFree(m_aucSysMem0, disk->disk_name);
|
||||
disk->disk_name = NULL;
|
||||
}
|
||||
DISK_UNLOCK(&disk->disk_mutex);
|
||||
disk->disk_status = STAT_UNUSED;
|
||||
ret = pthread_mutex_destroy(&disk->disk_mutex);
|
||||
if (ret != 0) {
|
||||
PRINT_ERR("%s %d, mutex destroy failed, ret = %d\n", __FUNCTION__, __LINE__, ret);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
disk->disk_status = STAT_UNUSED;
|
||||
|
||||
return ENOERR;
|
||||
}
|
||||
|
||||
@@ -1360,6 +1364,16 @@ INT32 los_disk_init(const CHAR *diskName, const struct block_operations *bops,
|
||||
} else {
|
||||
disk->type = OTHERS;
|
||||
}
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
ret = LOS_EventWrite(&g_diskInitEvent, 1);
|
||||
if (ret < 0) {
|
||||
PRINT_ERR("Disk initialization event write fail \n");
|
||||
(void)unregister_blockdriver(diskName);
|
||||
disk->disk_status = STAT_UNUSED;
|
||||
return VFS_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ENOERR;
|
||||
|
||||
DISK_BLKDRIVER_ERROR:
|
||||
@@ -1370,6 +1384,24 @@ DISK_FIND_ERROR:
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
INT32 DiskEventInit(void)
|
||||
{
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
return LOS_EventInit(&g_diskInitEvent);
|
||||
#else
|
||||
return LOS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
INT32 DiskEventRead(void)
|
||||
{
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
return LOS_EventRead(&g_diskInitEvent, 1, LOS_WAITMODE_OR, LOS_WAIT_FOREVER);
|
||||
#else
|
||||
return LOS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
INT32 los_disk_deinit(INT32 diskID)
|
||||
{
|
||||
los_disk *disk = get_disk(diskID);
|
||||
|
||||
@@ -838,6 +838,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
|
||||
return remove(pathname);
|
||||
}
|
||||
d = opendir(pathname);
|
||||
if (d == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
dirent = readdir(d);
|
||||
|
||||
@@ -44,6 +44,8 @@ extern "C" {
|
||||
|
||||
#if (LOSCFG_KERNEL_SMP_LOCKDEP == YES)
|
||||
|
||||
#define PRINT_BUF_SIZE 256
|
||||
|
||||
#define LOCKDEP_GET_NAME(lockDep, index) (((SPIN_LOCK_S *)((lockDep)->heldLocks[(index)].lockPtr))->name)
|
||||
#define LOCKDEP_GET_ADDR(lockDep, index) ((lockDep)->heldLocks[(index)].lockAddr)
|
||||
|
||||
@@ -107,6 +109,31 @@ WEAK VOID OsLockDepPanic(enum LockDepErrType errType)
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
STATIC VOID OsLockDepPrint(const CHAR *fmt, va_list ap)
|
||||
{
|
||||
UINT32 len;
|
||||
CHAR buf[PRINT_BUF_SIZE] = {0};
|
||||
|
||||
len = vsnprintf_s(buf, PRINT_BUF_SIZE, PRINT_BUF_SIZE - 1, fmt, ap);
|
||||
if ((len == -1) && (*buf == '\0')) {
|
||||
/* parameter is illegal or some features in fmt dont support */
|
||||
UartPuts("OsLockDepPrint is error\n", strlen("OsLockDepPrint is error\n") + 1, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
*(buf + len) = '\0';
|
||||
|
||||
UartPuts(buf, len, 0);
|
||||
}
|
||||
|
||||
STATIC VOID OsPrintLockDepInfo(const CHAR *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
OsLockDepPrint(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||
const VOID *requestAddr, enum LockDepErrType errType)
|
||||
{
|
||||
@@ -114,24 +141,24 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||
const LockDep *lockDep = &task->lockDep;
|
||||
const LosTaskCB *temp = task;
|
||||
|
||||
PrintExcInfo("lockdep check failed\n");
|
||||
PrintExcInfo("error type : %s\n", OsLockDepErrorStringGet(errType));
|
||||
PrintExcInfo("request addr : 0x%x\n", requestAddr);
|
||||
OsPrintLockDepInfo("lockdep check failed\n");
|
||||
OsPrintLockDepInfo("error type : %s\n", OsLockDepErrorStringGet(errType));
|
||||
OsPrintLockDepInfo("request addr : 0x%x\n", requestAddr);
|
||||
|
||||
while (1) {
|
||||
PrintExcInfo("task name : %s\n", temp->taskName);
|
||||
PrintExcInfo("task id : %u\n", temp->taskID);
|
||||
PrintExcInfo("cpu num : %u\n", temp->currCpu);
|
||||
PrintExcInfo("start dumping lockdep infomation\n");
|
||||
OsPrintLockDepInfo("task name : %s\n", temp->taskName);
|
||||
OsPrintLockDepInfo("task id : %u\n", temp->taskID);
|
||||
OsPrintLockDepInfo("cpu num : %u\n", temp->currCpu);
|
||||
OsPrintLockDepInfo("start dumping lockdep infomation\n");
|
||||
for (i = 0; i < lockDep->lockDepth; i++) {
|
||||
if (lockDep->heldLocks[i].lockPtr == lock) {
|
||||
PrintExcInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
||||
OsPrintLockDepInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
||||
LOCKDEP_GET_ADDR(lockDep, i));
|
||||
} else {
|
||||
PrintExcInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i));
|
||||
OsPrintLockDepInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i));
|
||||
}
|
||||
}
|
||||
PrintExcInfo("[%d] %s <-- now\n", i, lock->name);
|
||||
OsPrintLockDepInfo("[%d] %s <-- now\n", i, lock->name);
|
||||
|
||||
if (errType == LOCKDEP_ERR_DEAD_LOCK) {
|
||||
temp = lock->owner;
|
||||
@@ -144,7 +171,6 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||
}
|
||||
}
|
||||
|
||||
OsLockDepPanic(errType);
|
||||
}
|
||||
|
||||
STATIC BOOL OsLockDepCheckDependancy(const LosTaskCB *current, LosTaskCB *lockOwner)
|
||||
@@ -172,7 +198,7 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock)
|
||||
{
|
||||
UINT32 intSave;
|
||||
enum LockDepErrType checkResult = LOCKDEP_SUCEESS;
|
||||
VOID *requestAddr = (VOID *)__builtin_return_address(0);
|
||||
VOID *requestAddr = (VOID *)__builtin_return_address(1);
|
||||
LosTaskCB *current = OsCurrTaskGet();
|
||||
LockDep *lockDep = ¤t->lockDep;
|
||||
LosTaskCB *lockOwner = NULL;
|
||||
@@ -211,11 +237,12 @@ OUT:
|
||||
lockDep->waitLock = lock;
|
||||
lockDep->heldLocks[lockDep->lockDepth].lockAddr = requestAddr;
|
||||
lockDep->heldLocks[lockDep->lockDepth].waitTime = OsLockDepGetCycles(); /* start time */
|
||||
} else {
|
||||
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
||||
OsLockDepRelease(intSave);
|
||||
return;
|
||||
}
|
||||
|
||||
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
||||
OsLockDepRelease(intSave);
|
||||
OsLockDepPanic(checkResult);
|
||||
}
|
||||
|
||||
VOID OsLockDepRecord(SPIN_LOCK_S *lock)
|
||||
@@ -253,7 +280,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
||||
UINT32 intSave;
|
||||
INT32 depth;
|
||||
enum LockDepErrType checkResult = LOCKDEP_SUCEESS;
|
||||
VOID *requestAddr = (VOID *)__builtin_return_address(0);
|
||||
VOID *requestAddr = (VOID *)__builtin_return_address(1);
|
||||
LosTaskCB *current = OsCurrTaskGet();
|
||||
LosTaskCB *owner = NULL;
|
||||
LockDep *lockDep = NULL;
|
||||
@@ -265,7 +292,8 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
||||
if (owner == SPINLOCK_OWNER_INIT) {
|
||||
checkResult = LOCKDEP_ERR_UNLOCK_WITOUT_LOCK;
|
||||
OsLockDepDumpLock(current, lock, requestAddr, checkResult);
|
||||
goto OUT;
|
||||
OsLockDepRelease(intSave);
|
||||
OsLockDepPanic(checkResult);
|
||||
}
|
||||
|
||||
lockDep = &owner->lockDep;
|
||||
@@ -294,7 +322,6 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
||||
lock->cpuid = (UINT32)(-1);
|
||||
lock->owner = SPINLOCK_OWNER_INIT;
|
||||
|
||||
OUT:
|
||||
OsLockDepRelease(intSave);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ STATIC VOID ConsoleOutput(const CHAR *str, UINT32 len)
|
||||
|
||||
for (;;) {
|
||||
cnt = write(STDOUT_FILENO, str + writen, (size_t)toWrite);
|
||||
if ((cnt < 0) || (toWrite == cnt)) {
|
||||
if ((cnt < 0) || ((cnt == 0) && OS_INT_ACTIVE) || (toWrite == cnt)) {
|
||||
break;
|
||||
}
|
||||
writen += cnt;
|
||||
|
||||
@@ -246,6 +246,7 @@ STATIC INT32 GetArgs(CHAR **args)
|
||||
}
|
||||
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
(void)DiskEventRead();
|
||||
g_emmcDisk = GetMmcDisk(EMMC);
|
||||
if (g_emmcDisk == NULL) {
|
||||
PRINT_ERR("Get EMMC disk failed!\n");
|
||||
|
||||
@@ -37,7 +37,8 @@ VDSO_INCLUDE := -I $(LITEOSTOPDIR)/kernel/extended/vdso/include \
|
||||
-I $(LITEOSTOPDIR)/kernel/common \
|
||||
-I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include
|
||||
|
||||
VDSO_CCFLAGS := -nostdlib -fPIC $(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LITEOS_COPTS_OPTMIZE)
|
||||
VDSO_CCFLAGS := -nostdlib -fPIC -fno-common -fno-strict-aliasing \
|
||||
$(LITEOS_SSP) $(LITEOS_CORE_COPTS) $(WARNING_AS_ERROR) $(LITEOS_COPTS_OPTMIZE)
|
||||
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
|
||||
VDSO_CCFLAGS += $(LLVM_EXTRA_OPTS) --sysroot=$(LITEOSTOPDIR)/../../prebuilts/lite/sysroot/
|
||||
endif
|
||||
|
||||
50
net/lwip-2.1/porting/src/sockets.c
Executable file → Normal file
50
net/lwip-2.1/porting/src/sockets.c
Executable file → Normal file
@@ -1468,6 +1468,51 @@ static err_t lwip_do_ioctl_impl(struct tcpip_api_call_data *call)
|
||||
|
||||
#include "los_vm_map.h"
|
||||
#include "user_copy.h"
|
||||
static int do_ioctl_SIOCGIFCONF(int sockfd, long cmd, void *argp)
|
||||
{
|
||||
int nbytes;
|
||||
struct ifconf ifc;
|
||||
char *buf_bak = NULL;
|
||||
int ret;
|
||||
|
||||
if (LOS_ArchCopyFromUser(&ifc, argp, sizeof(struct ifconf)) != 0) {
|
||||
set_errno(EFAULT);
|
||||
return -1;
|
||||
}
|
||||
nbytes = ifc.ifc_len;
|
||||
if (nbytes < 0) {
|
||||
set_errno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
buf_bak = ifc.ifc_buf;
|
||||
if (!LOS_IsUserAddress((VADDR_T)(uintptr_t)buf_bak)) {
|
||||
set_errno(EFAULT);
|
||||
return -1;
|
||||
}
|
||||
ifc.ifc_buf = malloc(nbytes);
|
||||
if (ifc.ifc_buf == NULL) {
|
||||
set_errno(ENOMEM);
|
||||
return -1;
|
||||
}
|
||||
(void)memset_s(ifc.ifc_buf, nbytes, 0, nbytes);
|
||||
|
||||
ret = lwip_ioctl(sockfd, cmd, &ifc);
|
||||
if (ret == 0) {
|
||||
if (LOS_ArchCopyToUser(buf_bak, ifc.ifc_buf, nbytes) != 0) {
|
||||
set_errno(EFAULT);
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
|
||||
free(ifc.ifc_buf);
|
||||
ifc.ifc_buf = buf_bak;
|
||||
if (LOS_ArchCopyToUser(argp, &ifc, sizeof(struct ifconf)) != 0) {
|
||||
set_errno(EFAULT);
|
||||
ret = -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int socks_ioctl(int sockfd, long cmd, void *argp)
|
||||
{
|
||||
void *argpbak = argp;
|
||||
@@ -1483,11 +1528,12 @@ int socks_ioctl(int sockfd, long cmd, void *argp)
|
||||
case SIOCADDRT:
|
||||
nbytes = sizeof(struct rtentry);
|
||||
break;
|
||||
case SIOCGIFCONF:
|
||||
return do_ioctl_SIOCGIFCONF(sockfd, cmd, argp);
|
||||
case SIOCSIPV6DAD:
|
||||
case SIOCGIPV6DAD:
|
||||
case SIOCSIPV6DPCTD:
|
||||
case SIOCGIPV6DPCTD:
|
||||
case SIOCGIFCONF:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFADDR:
|
||||
case SIOCDIFADDR:
|
||||
@@ -1570,8 +1616,6 @@ int socks_close(int sockfd)
|
||||
SYS_ARCH_UNPROTECT(lev);
|
||||
done_socket(sock);
|
||||
return lwip_close(sockfd);
|
||||
} else {
|
||||
PRINTK("no close socket s_refcount = %d\n", sock->s_refcount);
|
||||
}
|
||||
|
||||
sock->s_refcount--;
|
||||
|
||||
@@ -157,6 +157,12 @@ INT32 OsShellDeinit(INT32 consoleId)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if defined(LOSCFG_PLATFORM_ROOTFS)
|
||||
if (consoleId == CONSOLE_SERIAL){
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
(VOID)LOS_TaskDelete(shellCB->shellEntryHandle);
|
||||
(VOID)LOS_EventWrite(&shellCB->shellEvent, CONSOLE_SHELL_KEY_EVENT);
|
||||
|
||||
|
||||
0
syscall/process_syscall.c
Executable file → Normal file
0
syscall/process_syscall.c
Executable file → Normal file
@@ -108,7 +108,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
|
||||
{
|
||||
int ret;
|
||||
struct itimerval svalue;
|
||||
struct itimerval sovalue;
|
||||
struct itimerval sovalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -136,7 +136,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
|
||||
int SysGetiTimer(int which, struct itimerval *value)
|
||||
{
|
||||
int ret;
|
||||
struct itimerval svalue;
|
||||
struct itimerval svalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -188,7 +188,7 @@ int SysTimerCreate(clockid_t clockID, struct sigevent *evp, timer_t *timerID)
|
||||
int SysTimerGettime(timer_t timerID, struct itimerspec *value)
|
||||
{
|
||||
int ret;
|
||||
struct itimerspec svalue;
|
||||
struct itimerspec svalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -212,7 +212,7 @@ int SysTimerSettime(timer_t timerID, int flags, const struct itimerspec *value,
|
||||
{
|
||||
int ret;
|
||||
struct itimerspec svalue;
|
||||
struct itimerspec soldValue;
|
||||
struct itimerspec soldValue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -284,7 +284,7 @@ int SysClockSettime(clockid_t clockID, const struct timespec *tp)
|
||||
int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec stp;
|
||||
struct timespec stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -307,7 +307,7 @@ int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
||||
int SysClockGetres(clockid_t clockID, struct timespec *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec stp;
|
||||
struct timespec stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -362,6 +362,11 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (rmtp && LOS_ArchCopyFromUser(&srmtp, rmtp, sizeof(struct timespec))) {
|
||||
errno = EFAULT;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
ret = nanosleep(&srqtp, rmtp ? &srmtp : NULL);
|
||||
if (ret < 0) {
|
||||
return -get_errno();
|
||||
@@ -378,7 +383,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
|
||||
clock_t SysTimes(struct tms *buf)
|
||||
{
|
||||
clock_t ret;
|
||||
struct tms sbuf;
|
||||
struct tms sbuf = { 0 };
|
||||
|
||||
if (buf == NULL) {
|
||||
errno = EFAULT;
|
||||
@@ -430,7 +435,7 @@ int SysClockGettime64(clockid_t clockID, struct timespec64 *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec t;
|
||||
struct timespec64 stp;
|
||||
struct timespec64 stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -457,7 +462,7 @@ int SysClockGetres64(clockid_t clockID, struct timespec64 *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec t;
|
||||
struct timespec64 stp;
|
||||
struct timespec64 stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -519,7 +524,7 @@ int SysTimerGettime64(timer_t timerID, struct itimerspec64 *value)
|
||||
{
|
||||
int ret;
|
||||
struct itimerspec val;
|
||||
struct itimerspec64 svalue;
|
||||
struct itimerspec64 svalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -578,6 +583,7 @@ int SysTimerSettime64(timer_t timerID, int flags, const struct itimerspec64 *val
|
||||
}
|
||||
|
||||
if (oldValue != NULL) {
|
||||
(void)memset_s(&soldValue, sizeof(struct itimerspec64), 0, sizeof(struct itimerspec64));
|
||||
soldValue.it_interval.tv_sec = oldVal.it_interval.tv_sec;
|
||||
soldValue.it_interval.tv_nsec = oldVal.it_interval.tv_nsec;
|
||||
soldValue.it_value.tv_sec = oldVal.it_value.tv_sec;
|
||||
|
||||
4
tools/build/mk/los_config.mk
Executable file → Normal file
4
tools/build/mk/los_config.mk
Executable file → Normal file
@@ -359,13 +359,13 @@ ifeq ($(LOSCFG_NET_LWIP_SACK_2_1), y)
|
||||
|
||||
LITEOS_CMACRO += $(LWIP_MACROS)
|
||||
else ifeq ($(LOSCFG_NET_LWIP_SACK_2_0), y)
|
||||
LWIPDIR := $(LITEOSTHIRDPARTY)/lwip_enhanced
|
||||
LWIPDIR := $(LITEOSTHIRDPARTY)/lwip_enhanced/src
|
||||
LITEOS_BASELIB += -llwip
|
||||
LIB_SUBDIRS += $(LWIPDIR)
|
||||
LITEOS_LWIP_SACK_INCLUDE += \
|
||||
-I $(LWIPDIR)/include \
|
||||
-I $(LITEOSTOPDIR)/net/mac
|
||||
LWIP_MACROS += -DLWIP_CONFIG_FILE=\"lwip/lwipopts.h\"
|
||||
LWIP_MACROS += -DLWIP_CONFIG_FILE=\"lwip/lwipopts.h\" -DLWIP_LITEOS_A_COMPAT
|
||||
LITEOS_CMACRO += $(LWIP_MACROS)
|
||||
else
|
||||
$(error "unknown lwip version")
|
||||
|
||||
Reference in New Issue
Block a user