diff --git a/arch/arm/arm/src/los_hw_exc.S b/arch/arm/arm/src/los_hw_exc.S index 5dd00c78c1fbfe6453f0395fca6f9411e56526d4..8330d0dd250ec4e8aa458b37b035cb7fa76d7971 100755 --- a/arch/arm/arm/src/los_hw_exc.S +++ b/arch/arm/arm/src/los_hw_exc.S @@ -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 diff --git a/fs/vfs/vfs_cmd/vfs_shellcmd.c b/fs/vfs/vfs_cmd/vfs_shellcmd.c index 261913e91984f4efe173b379095f0ba230f031e8..0c95699ea140a9daef76f2446fc1b94c57eb0860 100644 --- a/fs/vfs/vfs_cmd/vfs_shellcmd.c +++ b/fs/vfs/vfs_cmd/vfs_shellcmd.c @@ -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); diff --git a/kernel/Kconfig b/kernel/Kconfig index 709adc90a4eb460b61be5751cc72119a85d7b2b5..19a05fb276394d415749aae0f20a26e91ad0e6e6 100755 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -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. diff --git a/kernel/common/los_config.c b/kernel/common/los_config.c index 91875330b5ed5aa268dd4a3b658ed3ebfb2c2bcb..348e441ed2b34257ffe4f59e6649fde503929fcd 100755 --- a/kernel/common/los_config.c +++ b/kernel/common/los_config.c @@ -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 diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index a313137265516d2d002ff26cf6c4ff4539f4843a..c2166fcf73572a97bc9776a413436cceb710bbb7 100755 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -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 #################################