补充完善原子接口测试用例及部分原子接口修复

Signed-off-by: ou-yangkan <519689417@qq.com>
This commit is contained in:
ou-yangkan
2022-01-13 15:02:16 +08:00
parent 697a0cbdeb
commit 3900785b8f
16 changed files with 402 additions and 43 deletions

View File

@@ -42,10 +42,6 @@ extern "C" {
STATIC INLINE INT32 ArchAtomicRead(const Atomic *v)
{
UINT32 intSave;
intSave = LOS_IntLock();
LOS_IntRestore(intSave);
return *v;
}

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);

View File

@@ -63,11 +63,11 @@ STATIC INLINE VOID ArchAtomicSet(Atomic *v, INT32 setVal)
intSave = LOS_IntLock();
__asm__ __volatile__("1:ldrex %0, [%2]\n"
" strex %0, %3, [%2]\n"
__asm__ __volatile__("1:ldrex %0, [%1]\n"
" strex %0, %2, [%1]\n"
" teq %0, #0\n"
" beq 1b"
: "=&r"(status), "+m"(*v)
" bne 1b"
: "=&r"(status)
: "r"(v), "r"(setVal)
: "cc");
LOS_IntRestore(intSave);