diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-12-11 05:01:53 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-12-11 05:01:53 -0500 |
| commit | 0fa5d3996dbda1ee9653c43d39b7ef159fb57ee7 (patch) | |
| tree | 70f0adc3b86bb1511be6607c959506f6365fc2a9 /arch/arm/include | |
| parent | 0b99cb73105f0527c1c4096960796b8772343a39 (diff) | |
| parent | 14318efb322e2fe1a034c69463d725209eb9d548 (diff) | |
Merge branch 'devel-stable' into for-linus
Diffstat (limited to 'arch/arm/include')
| -rw-r--r-- | arch/arm/include/asm/Kbuild | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/cpu.h | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/cputype.h | 13 | ||||
| -rw-r--r-- | arch/arm/include/asm/cti.h | 20 | ||||
| -rw-r--r-- | arch/arm/include/asm/hw_breakpoint.h | 8 | ||||
| -rw-r--r-- | arch/arm/include/asm/mmu.h | 13 | ||||
| -rw-r--r-- | arch/arm/include/asm/mmu_context.h | 88 | ||||
| -rw-r--r-- | arch/arm/include/asm/percpu.h | 45 | ||||
| -rw-r--r-- | arch/arm/include/asm/perf_event.h | 7 | ||||
| -rw-r--r-- | arch/arm/include/asm/pgtable-2level.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/pgtable-3level.h | 4 | ||||
| -rw-r--r-- | arch/arm/include/asm/pgtable.h | 10 | ||||
| -rw-r--r-- | arch/arm/include/asm/pmu.h | 28 | ||||
| -rw-r--r-- | arch/arm/include/asm/prom.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/smp_plat.h | 17 |
15 files changed, 123 insertions, 136 deletions
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index f70ae175a3d..2ffdaacd461 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
| @@ -16,7 +16,6 @@ generic-y += local64.h | |||
| 16 | generic-y += msgbuf.h | 16 | generic-y += msgbuf.h |
| 17 | generic-y += param.h | 17 | generic-y += param.h |
| 18 | generic-y += parport.h | 18 | generic-y += parport.h |
| 19 | generic-y += percpu.h | ||
| 20 | generic-y += poll.h | 19 | generic-y += poll.h |
| 21 | generic-y += resource.h | 20 | generic-y += resource.h |
| 22 | generic-y += sections.h | 21 | generic-y += sections.h |
diff --git a/arch/arm/include/asm/cpu.h b/arch/arm/include/asm/cpu.h index d797223b39d..2744f060255 100644 --- a/arch/arm/include/asm/cpu.h +++ b/arch/arm/include/asm/cpu.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | struct cpuinfo_arm { | 16 | struct cpuinfo_arm { |
| 17 | struct cpu cpu; | 17 | struct cpu cpu; |
| 18 | u32 cpuid; | ||
| 18 | #ifdef CONFIG_SMP | 19 | #ifdef CONFIG_SMP |
| 19 | unsigned int loops_per_jiffy; | 20 | unsigned int loops_per_jiffy; |
| 20 | #endif | 21 | #endif |
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index cb47d28cbe1..a59dcb5ab5f 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h | |||
| @@ -25,6 +25,19 @@ | |||
| 25 | #define CPUID_EXT_ISAR4 "c2, 4" | 25 | #define CPUID_EXT_ISAR4 "c2, 4" |
| 26 | #define CPUID_EXT_ISAR5 "c2, 5" | 26 | #define CPUID_EXT_ISAR5 "c2, 5" |
| 27 | 27 | ||
| 28 | #define MPIDR_SMP_BITMASK (0x3 << 30) | ||
| 29 | #define MPIDR_SMP_VALUE (0x2 << 30) | ||
| 30 | |||
| 31 | #define MPIDR_MT_BITMASK (0x1 << 24) | ||
| 32 | |||
| 33 | #define MPIDR_HWID_BITMASK 0xFFFFFF | ||
| 34 | |||
| 35 | #define MPIDR_LEVEL_BITS 8 | ||
| 36 | #define MPIDR_LEVEL_MASK ((1 << MPIDR_LEVEL_BITS) - 1) | ||
| 37 | |||
| 38 | #define MPIDR_AFFINITY_LEVEL(mpidr, level) \ | ||
| 39 | ((mpidr >> (MPIDR_LEVEL_BITS * level)) & MPIDR_LEVEL_MASK) | ||
| 40 | |||
| 28 | extern unsigned int processor_id; | 41 | extern unsigned int processor_id; |
| 29 | 42 | ||
| 30 | #ifdef CONFIG_CPU_CP15 | 43 | #ifdef CONFIG_CPU_CP15 |
diff --git a/arch/arm/include/asm/cti.h b/arch/arm/include/asm/cti.h index a0ada3ea435..f2e5cad3f30 100644 --- a/arch/arm/include/asm/cti.h +++ b/arch/arm/include/asm/cti.h | |||
| @@ -146,15 +146,7 @@ static inline void cti_irq_ack(struct cti *cti) | |||
| 146 | */ | 146 | */ |
| 147 | static inline void cti_unlock(struct cti *cti) | 147 | static inline void cti_unlock(struct cti *cti) |
| 148 | { | 148 | { |
| 149 | void __iomem *base = cti->base; | 149 | __raw_writel(LOCKCODE, cti->base + LOCKACCESS); |
| 150 | unsigned long val; | ||
| 151 | |||
| 152 | val = __raw_readl(base + LOCKSTATUS); | ||
| 153 | |||
| 154 | if (val & 1) { | ||
| 155 | val = LOCKCODE; | ||
| 156 | __raw_writel(val, base + LOCKACCESS); | ||
| 157 | } | ||
| 158 | } | 150 | } |
| 159 | 151 | ||
| 160 | /** | 152 | /** |
| @@ -166,14 +158,6 @@ static inline void cti_unlock(struct cti *cti) | |||
| 166 | */ | 158 | */ |
| 167 | static inline void cti_lock(struct cti *cti) | 159 | static inline void cti_lock(struct cti *cti) |
| 168 | { | 160 | { |
| 169 | void __iomem *base = cti->base; | 161 | __raw_writel(~LOCKCODE, cti->base + LOCKACCESS); |
| 170 | unsigned long val; | ||
| 171 | |||
| 172 | val = __raw_readl(base + LOCKSTATUS); | ||
| 173 | |||
| 174 | if (!(val & 1)) { | ||
| 175 | val = ~LOCKCODE; | ||
| 176 | __raw_writel(val, base + LOCKACCESS); | ||
| 177 | } | ||
| 178 | } | 162 | } |
| 179 | #endif | 163 | #endif |
diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h index c190bc992f0..01169dd723f 100644 --- a/arch/arm/include/asm/hw_breakpoint.h +++ b/arch/arm/include/asm/hw_breakpoint.h | |||
| @@ -98,12 +98,12 @@ static inline void decode_ctrl_reg(u32 reg, | |||
| 98 | #define ARM_BASE_WCR 112 | 98 | #define ARM_BASE_WCR 112 |
| 99 | 99 | ||
| 100 | /* Accessor macros for the debug registers. */ | 100 | /* Accessor macros for the debug registers. */ |
| 101 | #define ARM_DBG_READ(M, OP2, VAL) do {\ | 101 | #define ARM_DBG_READ(N, M, OP2, VAL) do {\ |
| 102 | asm volatile("mrc p14, 0, %0, c0," #M ", " #OP2 : "=r" (VAL));\ | 102 | asm volatile("mrc p14, 0, %0, " #N "," #M ", " #OP2 : "=r" (VAL));\ |
| 103 | } while (0) | 103 | } while (0) |
| 104 | 104 | ||
| 105 | #define ARM_DBG_WRITE(M, OP2, VAL) do {\ | 105 | #define ARM_DBG_WRITE(N, M, OP2, VAL) do {\ |
| 106 | asm volatile("mcr p14, 0, %0, c0," #M ", " #OP2 : : "r" (VAL));\ | 106 | asm volatile("mcr p14, 0, %0, " #N "," #M ", " #OP2 : : "r" (VAL));\ |
| 107 | } while (0) | 107 | } while (0) |
| 108 | 108 | ||
| 109 | struct notifier_block; | 109 | struct notifier_block; |
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 14965658a92..9f77e7804f3 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h | |||
| @@ -5,18 +5,15 @@ | |||
| 5 | 5 | ||
| 6 | typedef struct { | 6 | typedef struct { |
| 7 | #ifdef CONFIG_CPU_HAS_ASID | 7 | #ifdef CONFIG_CPU_HAS_ASID |
| 8 | unsigned int id; | 8 | u64 id; |
| 9 | raw_spinlock_t id_lock; | ||
| 10 | #endif | 9 | #endif |
| 11 | unsigned int kvm_seq; | 10 | unsigned int vmalloc_seq; |
| 12 | } mm_context_t; | 11 | } mm_context_t; |
| 13 | 12 | ||
| 14 | #ifdef CONFIG_CPU_HAS_ASID | 13 | #ifdef CONFIG_CPU_HAS_ASID |
| 15 | #define ASID(mm) ((mm)->context.id & 255) | 14 | #define ASID_BITS 8 |
| 16 | 15 | #define ASID_MASK ((~0ULL) << ASID_BITS) | |
| 17 | /* init_mm.context.id_lock should be initialized. */ | 16 | #define ASID(mm) ((mm)->context.id & ~ASID_MASK) |
| 18 | #define INIT_MM_CONTEXT(name) \ | ||
| 19 | .context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock), | ||
| 20 | #else | 17 | #else |
| 21 | #define ASID(mm) (0) | 18 | #define ASID(mm) (0) |
| 22 | #endif | 19 | #endif |
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index 0306bc642c0..e1f644bc7cc 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h | |||
| @@ -20,88 +20,12 @@ | |||
| 20 | #include <asm/proc-fns.h> | 20 | #include <asm/proc-fns.h> |
| 21 | #include <asm-generic/mm_hooks.h> | 21 | #include <asm-generic/mm_hooks.h> |
| 22 | 22 | ||
| 23 | void __check_kvm_seq(struct mm_struct *mm); | 23 | void __check_vmalloc_seq(struct mm_struct *mm); |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_CPU_HAS_ASID | 25 | #ifdef CONFIG_CPU_HAS_ASID |
| 26 | 26 | ||
| 27 | /* | 27 | void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); |
| 28 | * On ARMv6, we have the following structure in the Context ID: | 28 | #define init_new_context(tsk,mm) ({ mm->context.id = 0; }) |
| 29 | * | ||
| 30 | * 31 7 0 | ||
| 31 | * +-------------------------+-----------+ | ||
| 32 | * | process ID | ASID | | ||
| 33 | * +-------------------------+-----------+ | ||
| 34 | * | context ID | | ||
| 35 | * +-------------------------------------+ | ||
| 36 | * | ||
| 37 | * The ASID is used to tag entries in the CPU caches and TLBs. | ||
| 38 | * The context ID is used by debuggers and trace logic, and | ||
| 39 | * should be unique within all running processes. | ||
| 40 | */ | ||
| 41 | #define ASID_BITS 8 | ||
| 42 | #define ASID_MASK ((~0) << ASID_BITS) | ||
| 43 | #define ASID_FIRST_VERSION (1 << ASID_BITS) | ||
| 44 | |||
| 45 | extern unsigned int cpu_last_asid; | ||
| 46 | |||
| 47 | void __init_new_context(struct task_struct *tsk, struct mm_struct *mm); | ||
| 48 | void __new_context(struct mm_struct *mm); | ||
| 49 | void cpu_set_reserved_ttbr0(void); | ||
| 50 | |||
| 51 | static inline void switch_new_context(struct mm_struct *mm) | ||
| 52 | { | ||
| 53 | unsigned long flags; | ||
| 54 | |||
| 55 | __new_context(mm); | ||
| 56 | |||
| 57 | local_irq_save(flags); | ||
| 58 | cpu_switch_mm(mm->pgd, mm); | ||
| 59 | local_irq_restore(flags); | ||
| 60 | } | ||
