!1000 fix:mutex trace中ArchLRGet等接口改变实现方式

Merge pull request !1000 from zhangdengyu/mutexTraceFix
This commit is contained in:
openharmony_ci 2023-01-10 06:44:48 +00:00 committed by Gitee
commit 1ae62ebf2e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 15 additions and 13 deletions

View File

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
@ -63,12 +63,13 @@ STATIC INLINE UINTPTR ArchMspGet(VOID)
return msp; return msp;
} }
STATIC INLINE UINTPTR ArchLRGet(VOID) #define ARCH_LR_GET() \
{ ({ \
UINTPTR lr; UINTPTR lr; \
__asm("mov %0, lr" : "=r" (lr)); __asm("mov %0, lr" : "=r" (lr)); \
return lr; (lr); \
} })
#define ArchLRGet ARCH_LR_GET
#elif defined(__CLANG_ARM) || defined(__GNUC__) #elif defined(__CLANG_ARM) || defined(__GNUC__)
STATIC INLINE UINTPTR ArchSpGet(VOID) STATIC INLINE UINTPTR ArchSpGet(VOID)
{ {
@ -91,12 +92,13 @@ STATIC INLINE UINTPTR ArchMspGet(VOID)
return msp; return msp;
} }
STATIC INLINE UINTPTR ArchLRGet(VOID) #define ARCH_LR_GET() \
{ ({ \
UINTPTR lr; UINTPTR lr; \
__asm volatile("mov %0, lr" : "=r" (lr)); __asm volatile("mov %0, lr" : "=r" (lr)); \
return lr; (lr); \
} })
#define ArchLRGet ARCH_LR_GET
#else #else
/* Other platforms to be improved */ /* Other platforms to be improved */
#endif #endif