Browse Source

Add preliminary implementation of WhereAmI()

pull/4648/head
Martin Kroeker GitHub 1 year ago
parent
commit
34fd14036c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      common_arm64.h

+ 12
- 0
common_arm64.h View File

@@ -55,6 +55,18 @@ 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"
);
if (ret > MAX_CPU_NUMBER) ret = MAX_CPU_NUMBER;
return (int)ret;
}

static __inline void blas_lock(volatile BLASULONG *address){

BLASULONG ret;


Loading…
Cancel
Save