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
ca4640bf
Commit
ca4640bf
authored
Oct 17, 2002
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] CONFIG_DEBUG_STACKOVERFLOW
Taken from unknown contributor in 2.4
parent
65dff228
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
arch/i386/config.in
arch/i386/config.in
+1
-0
arch/i386/kernel/irq.c
arch/i386/kernel/irq.c
+14
-0
No files found.
arch/i386/config.in
View file @
ca4640bf
...
@@ -453,6 +453,7 @@ fi
...
@@ -453,6 +453,7 @@ fi
bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
bool ' Check for stack overflows' CONFIG_DEBUG_STACKOVERFLOW
bool ' Debug memory allocations' CONFIG_DEBUG_SLAB
bool ' Debug memory allocations' CONFIG_DEBUG_SLAB
bool ' Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
bool ' Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ
bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ
...
...
arch/i386/kernel/irq.c
View file @
ca4640bf
...
@@ -328,8 +328,22 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs)
...
@@ -328,8 +328,22 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs)
irq_desc_t
*
desc
=
irq_desc
+
irq
;
irq_desc_t
*
desc
=
irq_desc
+
irq
;
struct
irqaction
*
action
;
struct
irqaction
*
action
;
unsigned
int
status
;
unsigned
int
status
;
long
esp
;
irq_enter
();
irq_enter
();
#ifdef CONFIG_DEBUG_STACKOVERFLOW
/* Debugging check for stack overflow: is there less than 1KB free? */
__asm__
__volatile__
(
"andl %%esp,%0"
:
"=r"
(
esp
)
:
"0"
(
8191
));
if
(
unlikely
(
esp
<
(
sizeof
(
struct
task_struct
)
+
1024
)))
{
extern
void
show_stack
(
unsigned
long
*
);
printk
(
"do_IRQ: stack overflow: %ld
\n
"
,
esp
-
sizeof
(
struct
task_struct
));
__asm__
__volatile__
(
"movl %%esp,%0"
:
"=r"
(
esp
));
show_stack
((
void
*
)
esp
);
}
#endif
kstat
.
irqs
[
cpu
][
irq
]
++
;
kstat
.
irqs
[
cpu
][
irq
]
++
;
spin_lock
(
&
desc
->
lock
);
spin_lock
(
&
desc
->
lock
);
desc
->
handler
->
ack
(
irq
);
desc
->
handler
->
ack
(
irq
);
...
...
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