Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339564
b: refs/heads/master
c: 7f124aa
h: refs/heads/master
v: v3
  • Loading branch information
Lorenzo Pieralisi committed Nov 19, 2012
1 parent 9d4ba1e commit 8ba64e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5587164eea4aad88fcb79d9b21dc8f14fea598cd
refs/heads/master: 7f124aaf01439d2fa54283f3c375ce3b9fc776d4
17 changes: 17 additions & 0 deletions trunk/arch/arm/include/asm/smp_plat.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#ifndef __ASMARM_SMP_PLAT_H
#define __ASMARM_SMP_PLAT_H

#include <linux/cpumask.h>
#include <linux/err.h>

#include <asm/cputype.h>

/*
Expand Down Expand Up @@ -48,5 +51,19 @@ static inline int cache_ops_need_broadcast(void)
*/
extern int __cpu_logical_map[];
#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
/*
* Retrieve logical cpu index corresponding to a given MPIDR[23:0]
* - mpidr: MPIDR[23:0] to be used for the look-up
*
* Returns the cpu logical index or -EINVAL on look-up error
*/
static inline int get_logical_index(u32 mpidr)
{
int cpu;
for (cpu = 0; cpu < nr_cpu_ids; cpu++)
if (cpu_logical_map(cpu) == mpidr)
return cpu;
return -EINVAL;
}

#endif

0 comments on commit 8ba64e2

Please sign in to comment.