summaryrefslogtreecommitdiffstatsabout
path: root/SylixOS
diff options
context:
space:
mode:
authorHanhui <hanhui@acoinfo.com>2020-08-26 14:08:31 (GMT)
committer Hanhui <hanhui@acoinfo.com>2020-08-26 14:08:31 (GMT)
commitd014e333e54390e7d7d85fad4afa538a00ddb04e (patch)
tree6aa9f3f1a31d32529e7dcad9814427029922d0ad /SylixOS
parente8171897ff6e4c3d19035c24d4aeaf5926716b90 (diff)
downloadlibsylixos-d014e333e54390e7d7d85fad4afa538a00ddb04e.zip
libsylixos-d014e333e54390e7d7d85fad4afa538a00ddb04e.tar.gz
libsylixos-d014e333e54390e7d7d85fad4afa538a00ddb04e.tar.bz2
Fixed FT2004 spinlock memory barrier error.
Diffstat (limited to 'SylixOS')
-rw-r--r--SylixOS/arch/arm64/mpcore/arm64Spinlock.c5
-rw-r--r--SylixOS/config/cpu/cpu_cfg_arm64.h6
-rw-r--r--SylixOS/fs/fatFs/fatstat.c5
-rw-r--r--SylixOS/fs/tpsFs/tpsfs.c14
-rw-r--r--SylixOS/kernel/include/k_kernel.h2
-rw-r--r--SylixOS/kernel/vmm/vmmArea.c5
6 files changed, 27 insertions, 10 deletions
diff --git a/SylixOS/arch/arm64/mpcore/arm64Spinlock.c b/SylixOS/arch/arm64/mpcore/arm64Spinlock.c
index 5d5ad78..908fa1c 100644
--- a/SylixOS/arch/arm64/mpcore/arm64Spinlock.c
+++ b/SylixOS/arch/arm64/mpcore/arm64Spinlock.c
@@ -18,6 +18,7 @@
**
** 描 述: ARM64 体系构架自旋锁驱动.
*********************************************************************************************************/
+#define __SYLIXOS_SMPFMB
#define __SYLIXOS_KERNEL
#include "SylixOS.h"
/*********************************************************************************************************
@@ -68,6 +69,10 @@ static VOID arm64SpinLock (SPINLOCKTYPE *psld, VOIDFUNCPTR pfuncPoll, PVOID
ARM_WFE();
}
sldVal.SLD_usSvcNow = LW_ACCESS_ONCE(UINT16, psld->SLD_usSvcNow);
+
+#if LW_CFG_ARM64_ACCESS_ONCE_RMB > 0
+ KN_SMP_RMB();
+#endif
}
}
/*********************************************************************************************************
diff --git a/SylixOS/config/cpu/cpu_cfg_arm64.h b/SylixOS/config/cpu/cpu_cfg_arm64.h
index 70aec1e..9236c55 100644
--- a/SylixOS/config/cpu/cpu_cfg_arm64.h
+++ b/SylixOS/config/cpu/cpu_cfg_arm64.h
@@ -83,6 +83,12 @@
#define LW_CFG_ARM64_HW_STEP_EN 1 /* 硬件单步功能 */
/*********************************************************************************************************
+ Spinlock LW_ACCESS_ONCE() 需要进行 inner shareable 内存同步 (飞腾 2000 需要)
+*********************************************************************************************************/
+
+#define LW_CFG_ARM64_ACCESS_ONCE_RMB 1
+
+/*********************************************************************************************************
快速获取线程上下文 (使用 x18 Platform 特性, 仅特殊应用会使用默认关闭)
*********************************************************************************************************/
diff --git a/SylixOS/fs/fatFs/fatstat.c b/SylixOS/fs/fatFs/fatstat.c
index e4ad453..b00dea9 100644
--- a/SylixOS/fs/fatFs/fatstat.c
+++ b/SylixOS/fs/fatFs/fatstat.c
@@ -63,12 +63,13 @@ mode_t __fsAttrToMode (BYTE ucAttr)
if (ucAttr & AM_DIR) {
mode |= S_IFDIR;
-
+
} else {
mode |= S_IFREG;
- mode |= S_IXUSR | S_IXGRP; /* owner gourp 拥有可执行权限 */
}
+ mode |= S_IXUSR | S_IXGRP; /* owner gourp 拥有可执行权限 */
+
return (mode);
}
/*********************************************************************************************************
diff --git a/SylixOS/fs/tpsFs/tpsfs.c b/SylixOS/fs/tpsFs/tpsfs.c
index f01cf0e..4e8f0b5 100644
--- a/SylixOS/fs/tpsFs/tpsfs.c
+++ b/SylixOS/fs/tpsFs/tpsfs.c
@@ -1155,10 +1155,14 @@ VOID tpsFsStatfs (PTPS_SUPER_BLOCK psb, struct statfs *pstatfs)
return;
}
- pstatfs->f_bsize = (long)psb->SB_uiBlkSize;
- pstatfs->f_blocks = (long)psb->SB_ui64DataBlkCnt;
- pstatfs->f_bfree = (long)tpsFsBtreeGetBlkCnt(psb->SB_pinodeSpaceMng);
- pstatfs->f_bavail = pstatfs->f_bfree;
+ pstatfs->f_type = TPS_SUPER_MAGIC;
+ pstatfs->f_bsize = (long)psb->SB_uiBlkSize;
+ pstatfs->f_blocks = (long)psb->SB_ui64DataBlkCnt;
+ pstatfs->f_bfree = (long)tpsFsBtreeGetBlkCnt(psb->SB_pinodeSpaceMng);
+ pstatfs->f_namelen = PATH_MAX;
+
+ pstatfs->f_fsid.val[0] = (int32_t)psb->SB_ui64Generation;
+ pstatfs->f_fsid.val[1] = 0;
/*
* 统计已删除节点列表
@@ -1175,6 +1179,8 @@ VOID tpsFsStatfs (PTPS_SUPER_BLOCK psb, struct statfs *pstatfs)
inum = pinode->IND_inumDeleted;
tpsFsClose(pinode);
}
+
+ pstatfs->f_bavail = pstatfs->f_bfree;
}
/*********************************************************************************************************
** 函数名称: tpsFsGetSize
diff --git a/SylixOS/kernel/include/k_kernel.h b/SylixOS/kernel/include/k_kernel.h
index a0af215..0d07943 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 12
-#define __SYLIXOS_PATCH_VER 7
+#define __SYLIXOS_PATCH_VER 8
#define __SYLIXOS_PATCH_PAD 0
/*********************************************************************************************************
diff --git a/SylixOS/kernel/vmm/vmmArea.c b/SylixOS/kernel/vmm/vmmArea.c
index 765245c..73fe09a 100644
--- a/SylixOS/kernel/vmm/vmmArea.c
+++ b/SylixOS/kernel/vmm/vmmArea.c
@@ -163,14 +163,14 @@ static ULONG __areaSpaceInit (PLW_VMM_AREA pvmarea, addr_t ulAddr, size_t st
pvmarea->AREA_ulHashSize = ulHashSize;
pvmarea->AREA_ptrbrHash =
- (PLW_TREE_RB_ROOT)__KHEAP_ALLOC(sizeof(PLW_TREE_RB_ROOT) * (size_t)ulHashSize);
+ (PLW_TREE_RB_ROOT)__KHEAP_ALLOC(sizeof(LW_TREE_RB_ROOT) * (size_t)ulHashSize);
if (pvmarea->AREA_ptrbrHash == LW_NULL) {
_DebugHandle(__ERRORMESSAGE_LEVEL, "kernel low memory.\r\n");
_ErrorHandle(ERROR_KERNEL_LOW_MEMORY); /* 缺少内核内存 */
return (ERROR_KERNEL_LOW_MEMORY);
}
lib_bzero(pvmarea->AREA_ptrbrHash,
- (size_t)(sizeof(PLW_TREE_RB_ROOT) * ulHashSize)); /* 清空 hash 表 */
+ (size_t)(sizeof(LW_TREE_RB_ROOT) * ulHashSize)); /* 清空 hash 表 */
return (ERROR_NONE);
}
@@ -336,7 +336,6 @@ static VOID __areaInsertPage (PLW_VMM_AREA pvmarea, addr_t ulAddr, PLW_VMM_PA
while (*pptrbnRoot) {
ptrbnParent = *pptrbnRoot;
-
pvmpageTemp = _TREE_ENTRY(ptrbnParent, LW_VMM_PAGE, PAGE_trbnNode);
if (ulAddr < pvmpageTemp->PAGE_ulPageAddr) {