!98 内核支持syscall关闭

Merge pull request !98 from zhangfanfan2/master
This commit is contained in:
openharmony_ci 2021-03-27 09:58:48 +08:00 committed by Gitee
commit 23c2c270b8
5 changed files with 18 additions and 3 deletions

View File

@ -189,6 +189,7 @@ _osExceptSwiHdl:
MRS R3, SPSR
MOV R4, LR
#ifdef LOSCFG_KERNEL_SYSCALL
AND R1, R3, #CPSR_MASK_MODE @ Interrupted mode
CMP R1, #CPSR_USER_MODE @ User mode
BNE OsKernelSVCHandler @ Branch if not user mode
@ -222,6 +223,7 @@ _osExceptSwiHdl:
LDMFD SP!, {PC}^ @ Return to user
OsKernelSVCHandler:
#endif
ADD R0, SP, #(4 * 16)
MOV R5, R0
STMFD R0!, {R4} @ Store PC

View File

@ -1386,6 +1386,7 @@ int checkNum(const char *arg)
return 0;
}
#ifdef LOSCFG_KERNEL_SYSCALL
int osShellCmdSu(int argc, const char **argv)
{
unsigned int su_uid;
@ -1415,7 +1416,7 @@ int osShellCmdSu(int argc, const char **argv)
SysSetGroupID(su_gid);
return 0;
}
#endif
int osShellCmdChmod(int argc, const char **argv)
{
@ -1569,8 +1570,10 @@ SHELLCMD_ENTRY(touch_shellcmd, CMD_TYPE_EX, "touch", XARGS, (CmdCallBackFunc)osS
#if (defined(LOSCFG_FS_FAT))
SHELLCMD_ENTRY(sync_shellcmd, CMD_TYPE_EX, "sync", XARGS, (CmdCallBackFunc)osShellCmdSync);
#endif
#ifdef LOSCFG_KERNEL_SYSCALL
SHELLCMD_ENTRY(su_shellcmd, CMD_TYPE_EX, "su", XARGS, (CmdCallBackFunc)osShellCmdSu);
#endif
#endif
SHELLCMD_ENTRY(ls_shellcmd, CMD_TYPE_EX, "ls", XARGS, (CmdCallBackFunc)osShellCmdLs);
SHELLCMD_ENTRY(pwd_shellcmd, CMD_TYPE_EX, "pwd", XARGS, (CmdCallBackFunc)osShellCmdPwd);
SHELLCMD_ENTRY(cd_shellcmd, CMD_TYPE_EX, "cd", XARGS, (CmdCallBackFunc)osShellCmdCd);

View File

@ -33,6 +33,12 @@ config KERNEL_SCHED_STATISTICS
help
This option will enable schedulder statistics.
config KERNEL_SYSCALL
bool "Enable Syscall"
default y
help
This option will enable syscall.
config KERNEL_EXTKERNEL
bool "Enable Extend Kernel"
default y
@ -65,7 +71,7 @@ config CPUP_INCLUDE_IRQ
config KERNEL_DYNLOAD
bool "Enable Dynamic Load Feature"
default y
depends on KERNEL_EXTKERNEL
depends on KERNEL_EXTKERNEL && KERNEL_SYSCALL
help
If you wish to build LiteOS with support for dynamic load.
@ -79,7 +85,7 @@ config ASLR
config KERNEL_VDSO
bool "Enable VDSO Feature"
default n
depends on KERNEL_EXTKERNEL
depends on KERNEL_EXTKERNEL && KERNEL_SYSCALL
help
If you wish to speed up some system calls.

View File

@ -277,7 +277,9 @@ LITE_OS_SEC_TEXT_INIT INT32 OsMain(VOID)
return ret;
}
#ifdef LOSCFG_KERNEL_SYSCALL
SyscallHandleInit();
#endif
/*
* CPUP should be inited before first task creation which depends on the semaphore

View File

@ -488,8 +488,10 @@ ifeq ($(LOSCFG_NULL_ADDRESS_PROTECT), y)
LITEOS_CMACRO += -DLOSCFG_NULL_ADDRESS_PROTECT
endif
ifeq ($(LOSCFG_KERNEL_SYSCALL), y)
LITEOS_BASELIB += -lsyscall
LIB_SUBDIRS += syscall
endif
LIB_SUBDIRS += kernel/user
############################# Tools && Debug Option End #################################