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
70e58587
Commit
70e58587
authored
Sep 23, 2003
by
Tom Rini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Further cleanups to the ppc_htab code.
parent
56bec5a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
77 deletions
+61
-77
arch/ppc/kernel/ppc_htab.c
arch/ppc/kernel/ppc_htab.c
+61
-77
No files found.
arch/ppc/kernel/ppc_htab.c
View file @
70e58587
...
@@ -214,16 +214,6 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
...
@@ -214,16 +214,6 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
if
(
!
strncmp
(
buffer
,
"size "
,
5
)
)
if
(
!
strncmp
(
buffer
,
"size "
,
5
)
)
return
-
EBUSY
;
return
-
EBUSY
;
/* turn off performance monitoring */
if
(
!
strncmp
(
buffer
,
"off"
,
3
)
)
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
mtspr
(
SPRN_MMCR0
,
0
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC2
,
0
);
}
}
if
(
!
strncmp
(
buffer
,
"reset"
,
5
)
)
if
(
!
strncmp
(
buffer
,
"reset"
,
5
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
...
@@ -237,57 +227,56 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
...
@@ -237,57 +227,56 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
pte_errors
=
0
;
pte_errors
=
0
;
}
}
/* Everything below here requires the performance monitor feature. */
if
(
!
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
return
count
;
/* turn off performance monitoring */
if
(
!
strncmp
(
buffer
,
"off"
,
3
)
)
{
mtspr
(
SPRN_MMCR0
,
0
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC2
,
0
);
}
if
(
!
strncmp
(
buffer
,
"user"
,
4
)
)
if
(
!
strncmp
(
buffer
,
"user"
,
4
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
tmp
=
(
mfspr
(
SPRN_MMCR0
)
&
~
(
0x60000000
))
|
0x20000000
;
tmp
=
(
mfspr
(
SPRN_MMCR0
)
&
~
(
0x60000000
))
|
0x20000000
;
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC2
,
0
);
mtspr
(
SPRN_PMC2
,
0
);
}
}
}
if
(
!
strncmp
(
buffer
,
"kernel"
,
6
)
)
if
(
!
strncmp
(
buffer
,
"kernel"
,
6
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
tmp
=
(
mfspr
(
SPRN_MMCR0
)
&
~
(
0x60000000
))
|
0x40000000
;
tmp
=
(
mfspr
(
SPRN_MMCR0
)
&
~
(
0x60000000
))
|
0x40000000
;
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC2
,
0
);
mtspr
(
SPRN_PMC2
,
0
);
}
}
}
/* PMC1 values */
/* PMC1 values */
if
(
!
strncmp
(
buffer
,
"dtlb"
,
4
)
)
if
(
!
strncmp
(
buffer
,
"dtlb"
,
4
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
tmp
=
mfspr
(
SPRN_MMCR0
);
tmp
=
(
mfspr
(
SPRN_MMCR0
)
&
~
(
0x7F
<<
7
))
|
MMCR0_PMC1_DTLB
;
tmp
&=
~
(
0x7f
<<
7
);
tmp
|=
MMCR0_PMC1_DTLB
;
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC1
,
0
);
}
}
}
if
(
!
strncmp
(
buffer
,
"ic miss"
,
7
)
)
if
(
!
strncmp
(
buffer
,
"ic miss"
,
7
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
tmp
=
mfspr
(
SPRN_MMCR0
);
tmp
=
(
mfspr
(
SPRN_MMCR0
)
&
~
(
0x7F
<<
7
))
|
MMCR0_PMC1_ICACHEMISS
;
tmp
&=
~
(
0x7f
<<
7
);
tmp
|=
MMCR0_PMC1_ICACHEMISS
;
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_MMCR0
,
tmp
);
mtspr
(
SPRN_PMC1
,
0
);
mtspr
(
SPRN_PMC1
,
0
);
}
}
}
/* PMC2 values */
/* PMC2 values */
if
(
!
strncmp
(
buffer
,
"load miss time"
,
14
)
)
if
(
!
strncmp
(
buffer
,
"load miss time"
,
14
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
asm
volatile
(
asm
volatile
(
"mfspr %0,%1
\n\t
"
/* get current mccr0 */
"mfspr %0,%1
\n\t
"
/* get current mccr0 */
...
@@ -300,11 +289,9 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
...
@@ -300,11 +289,9 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
"i"
(
MMCR0_PMC2_LOADMISSTIME
),
"i"
(
MMCR0_PMC2_LOADMISSTIME
),
"i"
(
SPRN_PMC2
),
"r"
(
0
)
);
"i"
(
SPRN_PMC2
),
"r"
(
0
)
);
}
}
}
if
(
!
strncmp
(
buffer
,
"itlb"
,
4
)
)
if
(
!
strncmp
(
buffer
,
"itlb"
,
4
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
asm
volatile
(
asm
volatile
(
"mfspr %0,%1
\n\t
"
/* get current mccr0 */
"mfspr %0,%1
\n\t
"
/* get current mccr0 */
...
@@ -316,11 +303,9 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
...
@@ -316,11 +303,9 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
:
"i"
(
SPRN_MMCR0
),
"i"
(
MMCR0_PMC2_ITLB
),
:
"i"
(
SPRN_MMCR0
),
"i"
(
MMCR0_PMC2_ITLB
),
"i"
(
SPRN_PMC2
),
"r"
(
0
)
);
"i"
(
SPRN_PMC2
),
"r"
(
0
)
);
}
}
}
if
(
!
strncmp
(
buffer
,
"dc miss"
,
7
)
)
if
(
!
strncmp
(
buffer
,
"dc miss"
,
7
)
)
{
{
if
(
cur_cpu_spec
[
0
]
->
cpu_features
&
CPU_FTR_604_PERF_MON
)
{
/* setup mmcr0 and clear the correct pmc */
/* setup mmcr0 and clear the correct pmc */
asm
volatile
(
asm
volatile
(
"mfspr %0,%1
\n\t
"
/* get current mccr0 */
"mfspr %0,%1
\n\t
"
/* get current mccr0 */
...
@@ -332,7 +317,6 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
...
@@ -332,7 +317,6 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
:
"i"
(
SPRN_MMCR0
),
"i"
(
MMCR0_PMC2_DCACHEMISS
),
:
"i"
(
SPRN_MMCR0
),
"i"
(
MMCR0_PMC2_DCACHEMISS
),
"i"
(
SPRN_PMC2
),
"r"
(
0
)
);
"i"
(
SPRN_PMC2
),
"r"
(
0
)
);
}
}
}
return
count
;
return
count
;
#else
/* CONFIG_PPC_STD_MMU */
#else
/* CONFIG_PPC_STD_MMU */
...
...
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