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
nexedi
linux
Commits
2c2551ab
Commit
2c2551ab
authored
Nov 21, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc64: Add interface for registering a performance counter IRQ handler.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
0871420f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
1 deletion
+67
-1
arch/sparc/include/asm/irq_64.h
arch/sparc/include/asm/irq_64.h
+3
-0
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/irq.c
+63
-0
arch/sparc64/kernel/ttable.S
arch/sparc64/kernel/ttable.S
+1
-1
No files found.
arch/sparc/include/asm/irq_64.h
View file @
2c2551ab
...
...
@@ -66,6 +66,9 @@ extern void virt_irq_free(unsigned int virt_irq);
extern
void
__init
init_IRQ
(
void
);
extern
void
fixup_irqs
(
void
);
extern
int
register_perfctr_intr
(
void
(
*
handler
)(
struct
pt_regs
*
));
extern
void
release_perfctr_intr
(
void
(
*
handler
)(
struct
pt_regs
*
));
static
inline
void
set_softint
(
unsigned
long
bits
)
{
__asm__
__volatile__
(
"wr %0, 0x0, %%set_softint"
...
...
arch/sparc64/kernel/irq.c
View file @
2c2551ab
...
...
@@ -775,6 +775,69 @@ void do_softirq(void)
local_irq_restore
(
flags
);
}
static
void
unhandled_perf_irq
(
struct
pt_regs
*
regs
)
{
unsigned
long
pcr
,
pic
;
read_pcr
(
pcr
);
read_pic
(
pic
);
write_pcr
(
0
);
printk
(
KERN_EMERG
"CPU %d: Got unexpected perf counter IRQ.
\n
"
,
smp_processor_id
());
printk
(
KERN_EMERG
"CPU %d: PCR[%016lx] PIC[%016lx]
\n
"
,
smp_processor_id
(),
pcr
,
pic
);
}
/* Almost a direct copy of the powerpc PMC code. */
static
DEFINE_SPINLOCK
(
perf_irq_lock
);
static
void
*
perf_irq_owner_caller
;
/* mostly for debugging */
static
void
(
*
perf_irq
)(
struct
pt_regs
*
regs
)
=
unhandled_perf_irq
;
/* Invoked from level 15 PIL handler in trap table. */
void
perfctr_irq
(
int
irq
,
struct
pt_regs
*
regs
)
{
clear_softint
(
1
<<
irq
);
perf_irq
(
regs
);
}
int
register_perfctr_intr
(
void
(
*
handler
)(
struct
pt_regs
*
))
{
int
ret
;
if
(
!
handler
)
return
-
EINVAL
;
spin_lock
(
&
perf_irq_lock
);
if
(
perf_irq
!=
unhandled_perf_irq
)
{
printk
(
KERN_WARNING
"register_perfctr_intr: "
"perf IRQ busy (reserved by caller %p)
\n
"
,
perf_irq_owner_caller
);
ret
=
-
EBUSY
;
goto
out
;
}
perf_irq_owner_caller
=
__builtin_return_address
(
0
);
perf_irq
=
handler
;
ret
=
0
;
out:
spin_unlock
(
&
perf_irq_lock
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
register_perfctr_intr
);
void
release_perfctr_intr
(
void
(
*
handler
)(
struct
pt_regs
*
))
{
spin_lock
(
&
perf_irq_lock
);
perf_irq_owner_caller
=
NULL
;
perf_irq
=
unhandled_perf_irq
;
spin_unlock
(
&
perf_irq_lock
);
}
EXPORT_SYMBOL_GPL
(
release_perfctr_intr
);
#ifdef CONFIG_HOTPLUG_CPU
void
fixup_irqs
(
void
)
{
...
...
arch/sparc64/kernel/ttable.S
View file @
2c2551ab
...
...
@@ -66,7 +66,7 @@ tl0_irq6: BTRAP(0x46)
tl0_irq7
:
BTRAP
(0
x47
)
BTRAP
(
0x48
)
BTRAP
(
0x49
)
tl0_irq10
:
BTRAP
(0
x4a
)
BTRAP
(
0x4b
)
BTRAP
(
0x4c
)
BTRAP
(
0x4d
)
tl0_irq14
:
TRAP_IRQ
(
timer_interrupt
,
14
)
tl0_irq15
:
TRAP_IRQ
(
handle
r_irq
,
15
)
tl0_irq15
:
TRAP_IRQ
(
perfct
r_irq
,
15
)
tl0_resv050
:
BTRAP
(0
x50
)
BTRAP
(
0x51
)
BTRAP
(
0x52
)
BTRAP
(
0x53
)
BTRAP
(
0x54
)
BTRAP
(
0x55
)
tl0_resv056
:
BTRAP
(0
x56
)
BTRAP
(
0x57
)
BTRAP
(
0x58
)
BTRAP
(
0x59
)
BTRAP
(
0x5a
)
BTRAP
(
0x5b
)
tl0_resv05c
:
BTRAP
(0
x5c
)
BTRAP
(
0x5d
)
BTRAP
(
0x5e
)
BTRAP
(
0x5f
)
...
...
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