Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264627
b: refs/heads/master
c: 2ecccf9
h: refs/heads/master
i:
  264625: e0257f1
  264623: 75d69f9
v: v3
  • Loading branch information
Dave Martin authored and Russell King committed Oct 17, 2011
1 parent 91c4e49 commit 74b3199
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40c6d8aee40e373db75e6b0b4230fc8e8259d7a6
refs/heads/master: 2ecccf90f2a6d821af4d33f086d59895e5d3bedc
3 changes: 2 additions & 1 deletion trunk/arch/arm/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

#ifndef __ASSEMBLY__

#include <linux/compiler.h>
#include <linux/linkage.h>
#include <linux/irqflags.h>

Expand Down Expand Up @@ -104,7 +105,7 @@ struct mm_struct;
extern void show_pte(struct mm_struct *mm, unsigned long addr);
extern void __show_regs(struct pt_regs *);

extern int cpu_architecture(void);
extern int __pure cpu_architecture(void);
extern void cpu_init(void);

void arm_machine_restart(char mode, const char *cmd);
Expand Down
20 changes: 19 additions & 1 deletion trunk/arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/memblock.h>
#include <linux/bug.h>
#include <linux/compiler.h>

#include <asm/unified.h>
#include <asm/cpu.h>
Expand All @@ -42,6 +44,7 @@
#include <asm/cacheflush.h>
#include <asm/cachetype.h>
#include <asm/tlbflush.h>
#include <asm/system.h>

#include <asm/prom.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -115,6 +118,13 @@ struct outer_cache_fns outer_cache __read_mostly;
EXPORT_SYMBOL(outer_cache);
#endif

/*
* Cached cpu_architecture() result for use by assembler code.
* C code should use the cpu_architecture() function instead of accessing this
* variable directly.
*/
int __cpu_architecture __read_mostly = CPU_ARCH_UNKNOWN;

struct stack {
u32 irq[3];
u32 abt[3];
Expand Down Expand Up @@ -210,7 +220,7 @@ static const char *proc_arch[] = {
"?(17)",
};

int cpu_architecture(void)
static int __get_cpu_architecture(void)
{
int cpu_arch;

Expand Down Expand Up @@ -243,6 +253,13 @@ int cpu_architecture(void)
return cpu_arch;
}

int __pure cpu_architecture(void)
{
BUG_ON(__cpu_architecture == CPU_ARCH_UNKNOWN);

return __cpu_architecture;
}

static int cpu_has_aliasing_icache(unsigned int arch)
{
int aliasing_icache;
Expand Down Expand Up @@ -414,6 +431,7 @@ static void __init setup_processor(void)
}

cpu_name = list->cpu_name;
__cpu_architecture = __get_cpu_architecture();

#ifdef MULTI_CPU
processor = *list->proc;
Expand Down

0 comments on commit 74b3199

Please sign in to comment.