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

View File

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

View File

@ -33,6 +33,12 @@ config KERNEL_SCHED_STATISTICS
help help
This option will enable schedulder statistics. This option will enable schedulder statistics.
config KERNEL_SYSCALL
bool "Enable Syscall"
default y
help
This option will enable syscall.
config KERNEL_EXTKERNEL config KERNEL_EXTKERNEL
bool "Enable Extend Kernel" bool "Enable Extend Kernel"
default y default y
@ -65,7 +71,7 @@ config CPUP_INCLUDE_IRQ
config KERNEL_DYNLOAD config KERNEL_DYNLOAD
bool "Enable Dynamic Load Feature" bool "Enable Dynamic Load Feature"
default y default y
depends on KERNEL_EXTKERNEL depends on KERNEL_EXTKERNEL && KERNEL_SYSCALL
help help
If you wish to build LiteOS with support for dynamic load. If you wish to build LiteOS with support for dynamic load.
@ -79,7 +85,7 @@ config ASLR
config KERNEL_VDSO config KERNEL_VDSO
bool "Enable VDSO Feature" bool "Enable VDSO Feature"
default n default n
depends on KERNEL_EXTKERNEL depends on KERNEL_EXTKERNEL && KERNEL_SYSCALL
help help
If you wish to speed up some system calls. 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; return ret;
} }
#ifdef LOSCFG_KERNEL_SYSCALL
SyscallHandleInit(); SyscallHandleInit();
#endif
/* /*
* CPUP should be inited before first task creation which depends on the semaphore * 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 LITEOS_CMACRO += -DLOSCFG_NULL_ADDRESS_PROTECT
endif endif
ifeq ($(LOSCFG_KERNEL_SYSCALL), y)
LITEOS_BASELIB += -lsyscall LITEOS_BASELIB += -lsyscall
LIB_SUBDIRS += syscall LIB_SUBDIRS += syscall
endif
LIB_SUBDIRS += kernel/user LIB_SUBDIRS += kernel/user
############################# Tools && Debug Option End ################################# ############################# Tools && Debug Option End #################################