Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5fdc760e
Commit
5fdc760e
authored
Apr 28, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Add read_cpuid() to aid reading CPU ID registers.
parent
a6212839
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
arch/arm/kernel/setup.c
arch/arm/kernel/setup.c
+2
-6
arch/arm/oprofile/op_model_xscale.c
arch/arm/oprofile/op_model_xscale.c
+2
-2
include/asm-arm/system.h
include/asm-arm/system.h
+13
-0
No files found.
arch/arm/kernel/setup.c
View file @
5fdc760e
...
...
@@ -219,9 +219,7 @@ static inline void dump_cache(const char *prefix, unsigned int cache)
static
void
__init
dump_cpu_info
(
void
)
{
unsigned
int
info
;
asm
(
"mrc p15, 0, %0, c0, c0, 1"
:
"=r"
(
info
));
unsigned
int
info
=
read_cpuid
(
CPUID_CACHETYPE
);
if
(
info
!=
processor_id
)
{
printk
(
"CPU: D %s cache
\n
"
,
cache_types
[
CACHE_TYPE
(
info
)]);
...
...
@@ -803,9 +801,7 @@ static int c_show(struct seq_file *m, void *v)
seq_printf
(
m
,
"CPU revision
\t
: %d
\n
"
,
processor_id
&
15
);
{
unsigned
int
cache_info
;
asm
(
"mrc p15, 0, %0, c0, c0, 1"
:
"=r"
(
cache_info
));
unsigned
int
cache_info
=
read_cpuid
(
CPUID_CACHETYPE
);
if
(
cache_info
!=
processor_id
)
{
seq_printf
(
m
,
"Cache type
\t
: %s
\n
"
"Cache clean
\t
: %s
\n
"
...
...
arch/arm/oprofile/op_model_xscale.c
View file @
5fdc760e
...
...
@@ -21,6 +21,7 @@
#include <linux/oprofile.h>
#include <linux/interrupt.h>
#include <asm/arch/irqs.h>
#include <asm/system.h>
#include "op_counter.h"
#include "op_arm_model.h"
...
...
@@ -399,8 +400,7 @@ static int xscale_detect_pmu(void)
int
ret
=
0
;
u32
id
;
__asm__
__volatile__
(
"mrc p15, 0, %0, c0, c0, 0"
:
"=r"
(
id
));
id
=
(
id
>>
13
)
&
0x7
;
id
=
(
read_cpuid
(
CPUID_ID
)
>>
13
)
&
0x7
;
switch
(
id
)
{
case
1
:
...
...
include/asm-arm/system.h
View file @
5fdc760e
...
...
@@ -42,6 +42,19 @@
#define CR_XP (1 << 23)
/* Extended page tables */
#define CR_VE (1 << 24)
/* Vectored interrupts */
#define CPUID_ID 0
#define CPUID_CACHETYPE 1
#define CPUID_TCM 2
#define CPUID_TLBTYPE 3
#define read_cpuid(reg) \
({ \
unsigned int __val; \
asm("mrc p15, 0, %0, c0, c0, " #reg \
: "=r" (__val)); \
__val; \
})
/*
* This is used to ensure the compiler did actually allocate the register we
* asked it for some inline assembly sequences. Apparently we can't trust
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment