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
b0cb83ba
Commit
b0cb83ba
authored
Mar 13, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stack overflow debugging support.
From Kanoj Sarcar.
parent
3da06a3a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
1 deletion
+73
-1
arch/sparc64/Makefile
arch/sparc64/Makefile
+5
-0
arch/sparc64/config.in
arch/sparc64/config.in
+4
-0
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/kernel/sparc64_ksyms.c
+5
-0
arch/sparc64/lib/Makefile
arch/sparc64/lib/Makefile
+1
-1
arch/sparc64/lib/mcount.S
arch/sparc64/lib/mcount.S
+55
-0
arch/sparc64/prom/Makefile
arch/sparc64/prom/Makefile
+3
-0
No files found.
arch/sparc64/Makefile
View file @
b0cb83ba
...
...
@@ -48,6 +48,11 @@ else
AFLAGS
+=
-m64
-mcpu
=
ultrasparc
$(CC_UNDECL)
endif
ifeq
($(CONFIG_MCOUNT),y)
CFLAGS
:=
$(
subst
-fomit-frame-pointer
,,
$(CFLAGS)
)
CFLAGS
:=
$(CFLAGS)
-pg
endif
LINKFLAGS
=
-T
arch
/sparc64/vmlinux.lds
HEAD
:=
arch
/sparc64/kernel/head.o
arch
/sparc64/kernel/init_task.o
...
...
arch/sparc64/config.in
View file @
b0cb83ba
...
...
@@ -289,6 +289,10 @@ if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
bool ' Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE
bool ' D-cache flush debugging' CONFIG_DEBUG_DCFLUSH
fi
bool 'Stack Overflow Detection Support' CONFIG_STACK_DEBUG
if [ "$CONFIG_STACK_DEBUG" = "y" ] ; then
define_bool CONFIG_MCOUNT y
fi
endmenu
...
...
arch/sparc64/kernel/sparc64_ksyms.c
View file @
b0cb83ba
...
...
@@ -139,6 +139,11 @@ EXPORT_SYMBOL(__global_sti);
EXPORT_SYMBOL
(
__global_save_flags
);
EXPORT_SYMBOL
(
__global_restore_flags
);
#if defined(CONFIG_MCOUNT)
extern
void
mcount
(
void
);
EXPORT_SYMBOL
(
mcount
);
#endif
/* Per-CPU information table */
EXPORT_SYMBOL
(
cpu_data
);
...
...
arch/sparc64/lib/Makefile
View file @
b0cb83ba
...
...
@@ -16,6 +16,6 @@ obj-y := PeeCeeI.o blockops.o debuglocks.o strlen.o strncmp.o \
VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o
\
VIScsumcopyusr.o VISsave.o atomic.o rwlock.o bitops.o
\
dec_and_lock.o U3memcpy.o U3copy_from_user.o U3copy_to_user.o
\
U3copy_in_user.o
U3copy_in_user.o
mcount.o
include
$(TOPDIR)/Rules.make
arch/sparc64/lib/mcount.S
0 → 100644
View file @
b0cb83ba
/*
*
Copyright
(
C
)
2000
Anton
Blanchard
(
anton
@
linuxcare
.
com
)
*
*
This
file
implements
mcount
(),
which
is
used
to
collect
profiling
data
.
*
This
can
also
be
tweaked
for
kernel
stack
overflow
detection
.
*/
#include <linux/config.h>
#include <linux/linkage.h>
#include <asm/ptrace.h>
#include <asm/thread_info.h>
/*
*
This
is
the
main
variant
and
is
called
by
C
code
.
GCC
's -pg option
*
automatically
instruments
every
C
function
with
a
call
to
this
.
*/
#ifdef CONFIG_STACK_DEBUG
#define OVSTACKSIZE 4096 /* lets hope this is enough */
.
data
.
align
8
panicstring
:
.
asciz
"Stack overflow\n"
.
align
8
ovstack
:
.
skip
OVSTACKSIZE
#endif
.
text
.
align
32
.
globl
mcount
mcount
:
#ifdef CONFIG_STACK_DEBUG
/
*
*
Check
whether
%
sp
is
dangerously
low
.
*/
add
%
g6
,
(
TI_FPREGS
+
256
+
192
),
%
g5
!
where
does
task_struct
+
frame
end
?
sub
%
g5
,
STACK_BIAS
,
%
g5
cmp
%
sp
,
%
g5
bg
,
pt
%
xcc
,
1
f
sethi
%
hi
(
panicstring
),
%
g5
sethi
%
hi
(
ovstack
),
%
g7
!
cant
move
to
panic
stack
fast
enough
or
%
g7
,
%
lo
(
ovstack
),
%
g7
add
%
g7
,
OVSTACKSIZE
,
%
g7
sub
%
g7
,
STACK_BIAS
,
%
g7
mov
%
g7
,
%
sp
call
prom_printf
or
%
g5
,
%
lo
(
panicstring
),
%
o0
call
prom_halt
nop
#endif
1
:
retl
nop
arch/sparc64/prom/Makefile
View file @
b0cb83ba
...
...
@@ -19,3 +19,6 @@ obj-y := bootstr.o devops.o init.o memory.o misc.o \
$(CC)
$(AFLAGS)
-ansi
-c
$<
-o
$*
.o
include
$(TOPDIR)/Rules.make
%.o
:
%.c
$(CC)
$(
subst
-pg
,,
$(CFLAGS)
)
-c
$<
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