Skip to content

Commit

Permalink
Add implementation of WhereAmI() to support NO_AFFINITY=0 on ARM64 (#…
Browse files Browse the repository at this point in the history
…4648)

* Add preliminary implementation of WhereAmI()
  • Loading branch information
martin-frbg authored Apr 17, 2024
1 parent a0083fd commit c57f932
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions common_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#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){

BLASULONG ret;
Expand Down

0 comments on commit c57f932

Please sign in to comment.