From b5ae9e25c6ec605c1805ea9be986a725cf88dc5d Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Tue, 28 Feb 2023 11:07:14 +0800 Subject: [PATCH] feature: fix liteos_a_newlib_kernel compiler error & libc update Signed-off-by: arvinzzz Change-Id: I4a8c2cfb2ba044f000026f738c6da1781cb7db35 --- kernel/base/container/los_container.c | 3 ++- kernel/base/container/los_mnt_container.c | 2 +- kernel/base/container/los_net_container.c | 3 ++- kernel/base/container/los_user_container.c | 2 +- kernel/base/container/los_uts_container.c | 3 +-- kernel/base/core/los_info.c | 9 ++++++++- kernel/extended/plimit/los_devicelimit.c | 2 +- kernel/extended/plimit/los_ipclimit.c | 2 +- kernel/extended/plimit/los_memlimit.c | 2 +- kernel/extended/plimit/los_plimits.c | 2 +- kernel/extended/plimit/los_processlimit.c | 2 +- kernel/extended/plimit/los_schedlimit.c | 2 +- 12 files changed, 21 insertions(+), 13 deletions(-) diff --git a/kernel/base/container/los_container.c b/kernel/base/container/los_container.c index 8a06f6fb..9bb59ba9 100644 --- a/kernel/base/container/los_container.c +++ b/kernel/base/container/los_container.c @@ -27,10 +27,11 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef LOSCFG_KERNEL_CONTAINER #include "los_container_pri.h" #include "los_process_pri.h" #include "internal.h" -#ifdef LOSCFG_KERNEL_CONTAINER STATIC Container g_rootContainer; STATIC ContainerLimit g_containerLimit; diff --git a/kernel/base/container/los_mnt_container.c b/kernel/base/container/los_mnt_container.c index 976feaeb..efa88836 100644 --- a/kernel/base/container/los_mnt_container.c +++ b/kernel/base/container/los_mnt_container.c @@ -28,6 +28,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_MNT_CONTAINER #include #include "los_mnt_container_pri.h" #include "los_container_pri.h" @@ -36,7 +37,6 @@ #include "vnode.h" #include "internal.h" -#ifdef LOSCFG_MNT_CONTAINER STATIC UINT32 g_currentMntContainerNum; LIST_HEAD *GetContainerMntList(VOID) diff --git a/kernel/base/container/los_net_container.c b/kernel/base/container/los_net_container.c index aefe350b..96dca1f3 100644 --- a/kernel/base/container/los_net_container.c +++ b/kernel/base/container/los_net_container.c @@ -27,13 +27,14 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef LOSCFG_NET_CONTAINER #include #include "los_net_container_pri.h" #include "los_config.h" #include "los_memory.h" #include "los_process_pri.h" -#ifdef LOSCFG_NET_CONTAINER STATIC UINT32 g_currentNetContainerNum = 0; STATIC NetContainer *g_rootNetContainer = NULL; diff --git a/kernel/base/container/los_user_container.c b/kernel/base/container/los_user_container.c index e118e4fe..8ca9c258 100644 --- a/kernel/base/container/los_user_container.c +++ b/kernel/base/container/los_user_container.c @@ -28,6 +28,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_USER_CONTAINER #include "los_user_container_pri.h" #include "errno.h" #include "ctype.h" @@ -47,7 +48,6 @@ #define OCT 8 #define DEC 10 -#ifdef LOSCFG_USER_CONTAINER UINT32 g_currentUserContainerNum = 0; UINT32 OsCreateUserContainer(Credentials *newCredentials, UserContainer *parentUserContainer) diff --git a/kernel/base/container/los_uts_container.c b/kernel/base/container/los_uts_container.c index 736e8ea9..ee483928 100644 --- a/kernel/base/container/los_uts_container.c +++ b/kernel/base/container/los_uts_container.c @@ -28,12 +28,11 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_UTS_CONTAINER #include "internal.h" #include "los_uts_container_pri.h" #include "los_process_pri.h" -#ifdef LOSCFG_UTS_CONTAINER - STATIC UINT32 g_currentUtsContainerNum; STATIC UINT32 InitUtsContainer(struct utsname *name) diff --git a/kernel/base/core/los_info.c b/kernel/base/core/los_info.c index 5ff4206b..f03bac81 100644 --- a/kernel/base/core/los_info.c +++ b/kernel/base/core/los_info.c @@ -109,6 +109,7 @@ STATIC VOID GetProcessInfo(ProcessInfo *pcbInfo, const LosProcessCB *processCB) (VOID)memcpy_s(pcbInfo->name, OS_PCB_NAME_LEN, processCB->processName, OS_PCB_NAME_LEN); } +#ifdef LOSCFG_KERNEL_VM STATIC VOID GetProcessMemInfo(ProcessInfo *pcbInfo, const LosProcessCB *processCB, LosVmSpace *vmSpace) { /* Process memory usage statistics, idle task defaults to 0 */ @@ -130,6 +131,7 @@ STATIC VOID GetProcessMemInfo(ProcessInfo *pcbInfo, const LosProcessCB *processC } } } +#endif STATIC VOID GetThreadInfo(ProcessThreadInfo *threadInfo, LosProcessCB *processCB) { @@ -182,7 +184,9 @@ UINT32 OsGetProcessThreadInfo(UINT32 pid, ProcessThreadInfo *threadInfo) return LOS_NOK; } +#ifdef LOSCFG_KERNEL_VM GetProcessMemInfo(&threadInfo->processInfo, processCB, processCB->vmSpace); +#endif SCHEDULER_LOCK(intSave); GetProcessInfo(&threadInfo->processInfo, processCB); @@ -210,11 +214,14 @@ STATIC VOID ProcessMemUsageGet(ProcessInfo *pcbArray) pcbInfo->status = OS_PROCESS_FLAG_UNUSED; continue; } - +#ifdef LOSCFG_KERNEL_VM LosVmSpace *vmSpace = processCB->vmSpace; +#endif SCHEDULER_UNLOCK(intSave); +#ifdef LOSCFG_KERNEL_VM GetProcessMemInfo(pcbInfo, processCB, vmSpace); +#endif } } diff --git a/kernel/extended/plimit/los_devicelimit.c b/kernel/extended/plimit/los_devicelimit.c index b0bda55e..a4a6446e 100644 --- a/kernel/extended/plimit/los_devicelimit.c +++ b/kernel/extended/plimit/los_devicelimit.c @@ -28,12 +28,12 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_KERNEL_DEV_PLIMIT #include "los_seq_buf.h" #include "los_bitmap.h" #include "los_process_pri.h" #include "los_devicelimit.h" -#ifdef LOSCFG_KERNEL_DEV_PLIMIT #define TYPE_CHAR_LEN (1) #define DEVICE_NAME_PREFIX_SPACE (1) #define DEVICE_ACCESS_MAXLEN (3) diff --git a/kernel/extended/plimit/los_ipclimit.c b/kernel/extended/plimit/los_ipclimit.c index 78df3f79..746d0452 100644 --- a/kernel/extended/plimit/los_ipclimit.c +++ b/kernel/extended/plimit/los_ipclimit.c @@ -28,10 +28,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_KERNEL_IPC_PLIMIT #include "los_ipclimit.h" #include "los_process_pri.h" -#ifdef LOSCFG_KERNEL_IPC_PLIMIT STATIC ProcIPCLimit *g_rootIPCLimit = NULL; #define PLIMIT_IPC_SHM_LIMIT_MAX 0xFFFFFFFF diff --git a/kernel/extended/plimit/los_memlimit.c b/kernel/extended/plimit/los_memlimit.c index f69064e4..4a034274 100644 --- a/kernel/extended/plimit/los_memlimit.c +++ b/kernel/extended/plimit/los_memlimit.c @@ -28,6 +28,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_KERNEL_MEM_PLIMIT #include #include #include "los_config.h" @@ -35,7 +36,6 @@ #include "los_process_pri.h" #include "los_plimits.h" -#ifdef LOSCFG_KERNEL_MEM_PLIMIT STATIC ProcMemLimiter *g_procMemLimiter = NULL; VOID OsMemLimiterInit(UINTPTR limite) diff --git a/kernel/extended/plimit/los_plimits.c b/kernel/extended/plimit/los_plimits.c index 93acd506..50299eb7 100644 --- a/kernel/extended/plimit/los_plimits.c +++ b/kernel/extended/plimit/los_plimits.c @@ -28,12 +28,12 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_KERNEL_PLIMITS #include "los_base.h" #include "los_process_pri.h" #include "hal_timer.h" #include "los_plimits.h" -#ifdef LOSCFG_KERNEL_PLIMITS typedef struct PlimiteOperations { VOID (*LimiterInit)(UINTPTR); VOID *(*LimiterAlloc)(VOID); diff --git a/kernel/extended/plimit/los_processlimit.c b/kernel/extended/plimit/los_processlimit.c index 5e8a8054..a335b19b 100644 --- a/kernel/extended/plimit/los_processlimit.c +++ b/kernel/extended/plimit/los_processlimit.c @@ -28,6 +28,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_KERNEL_PLIMITS #include "los_config.h" #include "los_process_pri.h" #include "los_process.h" @@ -35,7 +36,6 @@ #include "los_task_pri.h" #include "los_processlimit.h" -#ifdef LOSCFG_KERNEL_PLIMITS STATIC PidLimit *g_rootPidLimit = NULL; VOID PidLimiterInit(UINTPTR limit) diff --git a/kernel/extended/plimit/los_schedlimit.c b/kernel/extended/plimit/los_schedlimit.c index dbba6bb9..ef25f48d 100644 --- a/kernel/extended/plimit/los_schedlimit.c +++ b/kernel/extended/plimit/los_schedlimit.c @@ -28,10 +28,10 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef LOSCFG_KERNEL_SCHED_PLIMIT #include "los_schedlimit.h" #include "los_process_pri.h" -#ifdef LOSCFG_KERNEL_SCHED_PLIMIT STATIC ProcSchedLimiter *g_procSchedLimit = NULL; VOID OsSchedLimitInit(UINTPTR limit) -- GitLab