组件解耦修改---支持内核态dynload和net关闭

This commit is contained in:
zhangfanfan2 2021-03-13 19:05:12 +08:00 committed by Gitee
parent 856a44ac95
commit 36eb117140
4 changed files with 11 additions and 1 deletions

View File

@ -55,7 +55,9 @@
#include "los_vm_phys.h" #include "los_vm_phys.h"
#include "los_vm_fault.h" #include "los_vm_fault.h"
#include "los_vm_common.h" #include "los_vm_common.h"
#ifdef LOSCFG_KERNEL_DYNLOAD
#include "los_load_elf.h" #include "los_load_elf.h"
#endif
#include "arm.h" #include "arm.h"
#include "los_bitmap.h" #include "los_bitmap.h"
#include "los_process_pri.h" #include "los_process_pri.h"
@ -283,9 +285,11 @@ STATIC VADDR_T OsGetTextRegionBase(LosVmMapRegion *region, LosProcessCB *runProc
} while (!strcmp(curFilep->f_path, lastFilep->f_path)); } while (!strcmp(curFilep->f_path, lastFilep->f_path));
DONE: DONE:
#ifdef LOSCFG_KERNEL_DYNLOAD
if (curRegion->range.base == EXEC_MMAP_BASE) { if (curRegion->range.base == EXEC_MMAP_BASE) {
return 0; return 0;
} }
#endif
return curRegion->range.base; return curRegion->range.base;
} }

View File

@ -43,7 +43,9 @@
#include "sys/uio.h" #include "sys/uio.h"
#include "poll.h" #include "poll.h"
#include "sys/prctl.h" #include "sys/prctl.h"
#ifdef LOSCFG_KERNEL_DYNLOAD
#include "los_exec_elf.h" #include "los_exec_elf.h"
#endif
#include "los_syscall.h" #include "los_syscall.h"
#include "dirent.h" #include "dirent.h"
#include "user_copy.h" #include "user_copy.h"
@ -380,10 +382,12 @@ OUT:
return ret; return ret;
} }
#ifdef LOSCFG_KERNEL_DYNLOAD
int SysExecve(const char *fileName, char *const *argv, char *const *envp) int SysExecve(const char *fileName, char *const *argv, char *const *envp)
{ {
return LOS_DoExecveFile(fileName, argv, envp); return LOS_DoExecveFile(fileName, argv, envp);
} }
#endif
int SysChdir(const char *path) int SysChdir(const char *path)
{ {

View File

@ -35,6 +35,7 @@
#include "los_typedef.h" #include "los_typedef.h"
#include "los_task.h" #include "los_task.h"
#include "los_mux.h" #include "los_mux.h"
#include "los_signal.h"
#include "fs/fs.h" #include "fs/fs.h"
#include "syscall.h" #include "syscall.h"
#ifdef LOSCFG_KERNEL_DYNLOAD #ifdef LOSCFG_KERNEL_DYNLOAD
@ -52,6 +53,7 @@
#ifdef LOSCFG_FS_VFS #ifdef LOSCFG_FS_VFS
#include "sys/socket.h" #include "sys/socket.h"
#include "dirent.h" #include "dirent.h"
#include "fs/fs.h"
#endif #endif
/* process */ /* process */

View File

@ -37,10 +37,10 @@
#include "los_signal.h" #include "los_signal.h"
#include "los_syscall.h" #include "los_syscall.h"
#include "los_vm_map.h" #include "los_vm_map.h"
#include "lwip/sockets.h"
#include "user_copy.h" #include "user_copy.h"
#ifdef LOSCFG_NET_LWIP_SACK #ifdef LOSCFG_NET_LWIP_SACK
#include "lwip/sockets.h"
#define SOCKET_U2K(s) \ #define SOCKET_U2K(s) \
do { \ do { \