Browse Source
Add implementation of WhereAmI() to support NO_AFFINITY=0 on ARM64 (#4648)
* Add preliminary implementation of WhereAmI()
tags/v0.3.28^2
Martin Kroeker
GitHub
1 year ago
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
13 additions and
0 deletions
-
common_arm64.h
|
@@ -55,6 +55,19 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
#ifndef ASSEMBLER |
|
|
#ifndef ASSEMBLER |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static __inline int WhereAmI(void){ |
|
|
|
|
|
uint64_t ret; |
|
|
|
|
|
__asm__ volatile ( |
|
|
|
|
|
" mrs x0, mpidr_el1 \n" |
|
|
|
|
|
" and x0, x0, 0xff \n" |
|
|
|
|
|
:"=r" (ret) |
|
|
|
|
|
:: "memory" |
|
|
|
|
|
); |
|
|
|
|
|
ret +=1; |
|
|
|
|
|
if ((int)ret <0) ret = 0; |
|
|
|
|
|
return (int)ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static __inline void blas_lock(volatile BLASULONG *address){ |
|
|
static __inline void blas_lock(volatile BLASULONG *address){ |
|
|
|
|
|
|
|
|
BLASULONG ret; |
|
|
BLASULONG ret; |
|
|