summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-07-26 16:28:32 (GMT)
committer Hanhui <sylixos@gmail.com>2019-07-15 14:38:52 (GMT)
commit5d963a83f5a8ef7287b39d96ef6f0145608bb84a (patch)
tree3e14ed4ee3746855438b6478d3ae42a3b5f84e54
parentd7983b7d678b33c5373596e619892610dac1f8c1 (diff)
downloadAIC-OS-5d963a83f5a8ef7287b39d96ef6f0145608bb84a.zip
Fixed loader error output error.
-rw-r--r--SylixOS/arch/arm/mm/cache/armCacheCommonAsm.S12
-rw-r--r--SylixOS/include/arch/arm/asm/assembler.h24
-rw-r--r--SylixOS/kernel/include/k_kernel.h2
-rw-r--r--SylixOS/loader/src/loader.c6
-rw-r--r--SylixOS/mktemp/cl6x.mk5
-rw-r--r--SylixOS/vpmpdm/arch/c6x/libc.c17
6 files changed, 43 insertions, 23 deletions
diff --git a/SylixOS/arch/arm/mm/cache/armCacheCommonAsm.S b/SylixOS/arch/arm/mm/cache/armCacheCommonAsm.S
index 19f60c3..d169c49 100644
--- a/SylixOS/arch/arm/mm/cache/armCacheCommonAsm.S
+++ b/SylixOS/arch/arm/mm/cache/armCacheCommonAsm.S
@@ -189,17 +189,9 @@ FUNC_DEF(armDCacheInvalidate)
;/*********************************************************************************************************
; 将指定虚拟地址的 DCACHE 回写 R0=void *start; R1=void *end; R2=cache line size
-; MMU 初始化写页表映射关系时也会调用此函数, 此时 CACHE 并未使能, ARM1176 会卡死, 所以这里加入使能判断.
;*********************************************************************************************************/
FUNC_DEF(armDCacheFlush)
-#if __SYLIXOS_ARM_ARCH__ == 6
- MRC p15, 0, R3, c1, c0, 0
- AND R3, R3, #P15_R1_C
- CMP R3, #0
- BEQ dcache_not_en
-#endif
-
ARM_DSB()
ARM_ISB()
1:
@@ -209,10 +201,6 @@ FUNC_DEF(armDCacheFlush)
BCC 1b
ARM_DSB()
ARM_ISB()
-
-#if __SYLIXOS_ARM_ARCH__ == 6
-LINE_LABEL(dcache_not_en)
-#endif
BX LR
FUNC_END()
diff --git a/SylixOS/include/arch/arm/asm/assembler.h b/SylixOS/include/arch/arm/asm/assembler.h
index 1c7ec89..ac723cb 100644
--- a/SylixOS/include/arch/arm/asm/assembler.h
+++ b/SylixOS/include/arch/arm/asm/assembler.h
@@ -172,7 +172,7 @@ func
MOV Rm, Rm
/*********************************************************************************************************
- arm memory barrier
+ armv7 or later memory barrier
*********************************************************************************************************/
#if __SYLIXOS_ARM_ARCH__ >= 7
@@ -180,19 +180,27 @@ func
# define ARM_DSB() DSB
# define ARM_DMB() DMB
+/*********************************************************************************************************
+ armv6 memory barrier (warning: use R3 register)
+*********************************************************************************************************/
+
#elif __SYLIXOS_ARM_ARCH__ == 6
# define ARM_ISB() \
- MOV R0, #0; \
- MCR p15, 0, R0, c7, c5, 4;
+ MOV R3, #0; \
+ MCR p15, 0, R3, c7, c5, 4;
# define ARM_DSB() \
- MOV R0, #0; \
- MCR p15, 0, R0, c7, c10, 4;
+ MOV R3, #0; \
+ MCR p15, 0, R3, c7, c10, 4;
# define ARM_DMB() \
- MOV R0, #0; \
- MCR p15, 0, R0, c7, c10, 5;
-
+ MOV R3, #0; \
+ MCR p15, 0, R3, c7, c10, 5;
+
+/*********************************************************************************************************
+ armv4-5 memory barrier
+*********************************************************************************************************/
+
#else
# define ARM_ISB()
# define ARM_DSB()
diff --git a/SylixOS/kernel/include/k_kernel.h b/SylixOS/kernel/include/k_kernel.h
index 1cc890a..e559eda 100644
--- a/SylixOS/kernel/include/k_kernel.h
+++ b/SylixOS/kernel/include/k_kernel.h
@@ -51,7 +51,7 @@
#define __SYLIXOS_MAJOR_VER 1
#define __SYLIXOS_MINOR_VER 10
-#define __SYLIXOS_PATCH_VER 4
+#define __SYLIXOS_PATCH_VER 5
#define __SYLIXOS_PATCH_PAD 0
/*********************************************************************************************************
diff --git a/SylixOS/loader/src/loader.c b/SylixOS/loader/src/loader.c
index 1629822..50d1f3c 100644
--- a/SylixOS/loader/src/loader.c
+++ b/SylixOS/loader/src/loader.c
@@ -401,8 +401,10 @@ LW_LD_EXEC_MODULE *moduleLoadSub (LW_LD_EXEC_MODULE *pmodule, CPCHAR pcLibName,
*/
if (ERROR_NONE != moduleGetLibPath(pcLibName, cLibPath, MAX_FILENAME_LENGTH, "LD_LIBRARY_PATH", &statFile)) {
if (ERROR_NONE != moduleGetLibPath(pcLibName, cLibPath, MAX_FILENAME_LENGTH, "PATH", &statFile)) {
- fprintf(stderr, "[ld]Can not find dependent library: %s\n", pcLibName);
- _ErrorHandle(ERROR_LOADER_NO_MODULE);
+ if (bCreate) {
+ fprintf(stderr, "[ld]Can not find dependent library: %s\n", pcLibName);
+ _ErrorHandle(ERROR_LOADER_NO_MODULE);
+ }
return (LW_NULL);
}
}
diff --git a/SylixOS/mktemp/cl6x.mk b/SylixOS/mktemp/cl6x.mk
index 5841ba4..bfaa925 100644
--- a/SylixOS/mktemp/cl6x.mk
+++ b/SylixOS/mktemp/cl6x.mk
@@ -94,8 +94,13 @@ TOOLCHAIN_LINK_GTEST =
TOOLCHAIN_LINK_PIC_GCOV =
TOOLCHAIN_LINK_PIC_OMP =
TOOLCHAIN_LINK_PIC_CXX = cplusplus
+ifeq ($(DEBUG_LEVEL), debug)
+TOOLCHAIN_LINK_PIC_M = -Wl,-static -lm
+TOOLCHAIN_LINK_PIC_GCC = -Wl,-static -lgcc
+else
TOOLCHAIN_LINK_PIC_M =
TOOLCHAIN_LINK_PIC_GCC = -llibrts$(CPU_TYPE)_elf_pic.a
+endif
#*********************************************************************************************************
# Toolchain include & define
diff --git a/SylixOS/vpmpdm/arch/c6x/libc.c b/SylixOS/vpmpdm/arch/c6x/libc.c
index c6577e2..b73c49b 100644
--- a/SylixOS/vpmpdm/arch/c6x/libc.c
+++ b/SylixOS/vpmpdm/arch/c6x/libc.c
@@ -131,5 +131,22 @@ wchar_t *_wcsdup (const wchar_t *str)
}
/*
+ * gcc library depend
+ */
+
+void __eprintf (const char *string, const char *expression,
+ unsigned int line, const char *filename)
+{
+ fprintf(stderr, string, expression, line, filename);
+ fflush(stderr);
+ lib_abort();
+}
+
+errno_t *__errno_location (void)
+{
+ return (__errno());
+}
+
+/*
* end
*/