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
635f0fbb
Commit
635f0fbb
authored
Dec 09, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: extend ppc_find_proc_name to work on __init functions
parent
302aeebf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
30 deletions
+43
-30
arch/ppc64/kernel/process.c
arch/ppc64/kernel/process.c
+43
-30
No files found.
arch/ppc64/kernel/process.c
View file @
635f0fbb
...
@@ -388,48 +388,61 @@ void initialize_paca_hardware_interrupt_stack(void)
...
@@ -388,48 +388,61 @@ void initialize_paca_hardware_interrupt_stack(void)
}
}
}
}
extern
char
_stext
[],
_etext
[];
extern
char
_stext
[],
_etext
[]
,
__init_begin
[],
__init_end
[]
;
static
char
*
ppc_find_proc_name
(
unsigned
*
p
,
char
*
buf
,
unsigned
buflen
)
static
char
*
ppc_find_proc_name
(
unsigned
*
p
,
char
*
buf
,
unsigned
buflen
)
{
{
unsigned
long
tb_flags
;
unsigned
long
tb_flags
;
unsigned
short
name_len
;
unsigned
short
name_len
;
unsigned
long
tb_start
,
code_start
,
code_ptr
,
code_offset
;
unsigned
long
tb_start
,
code_start
,
code_ptr
,
code_offset
;
unsigned
code_len
;
unsigned
int
code_len
;
strcpy
(
buf
,
"Unknown"
);
unsigned
long
end
;
strcpy
(
buf
,
"Unknown"
);
code_ptr
=
(
unsigned
long
)
p
;
code_ptr
=
(
unsigned
long
)
p
;
code_offset
=
0
;
code_offset
=
0
;
if
(
(
(
unsigned
long
)
p
>=
(
unsigned
long
)
_stext
)
&&
(
(
unsigned
long
)
p
<=
(
unsigned
long
)
_etext
)
)
{
while
(
(
unsigned
long
)
p
<=
(
unsigned
long
)
_etext
)
{
/* handle functions in text and init sections */
if
(
*
p
==
0
)
{
if
(((
unsigned
long
)
p
>=
(
unsigned
long
)
_stext
)
&&
tb_start
=
(
unsigned
long
)
p
;
((
unsigned
long
)
p
<
(
unsigned
long
)
_etext
))
++
p
;
/* Point to traceback flags */
end
=
(
unsigned
long
)
_etext
;
tb_flags
=
*
((
unsigned
long
*
)
p
);
else
if
(((
unsigned
long
)
p
>=
(
unsigned
long
)
__init_begin
)
&&
p
+=
2
;
/* Skip over traceback flags */
((
unsigned
long
)
p
<
(
unsigned
long
)
__init_end
))
if
(
tb_flags
&
TB_NAME_PRESENT
)
{
end
=
(
unsigned
long
)
__init_end
;
if
(
tb_flags
&
TB_PARMINFO
)
else
++
p
;
/* skip over parminfo data */
return
buf
;
if
(
tb_flags
&
TB_HAS_TBOFF
)
{
code_len
=
*
p
;
/* get code length */
while
((
unsigned
long
)
p
<
end
)
{
code_start
=
tb_start
-
code_len
;
if
(
*
p
==
0
)
{
code_offset
=
code_ptr
-
code_start
+
1
;
tb_start
=
(
unsigned
long
)
p
;
if
(
code_offset
>
0x100000
)
++
p
;
/* Point to traceback flags */
break
;
tb_flags
=
*
((
unsigned
long
*
)
p
);
++
p
;
/* skip over code size */
p
+=
2
;
/* Skip over traceback flags */
}
if
(
tb_flags
&
TB_NAME_PRESENT
)
{
name_len
=
*
((
unsigned
short
*
)
p
);
if
(
tb_flags
&
TB_PARMINFO
)
if
(
name_len
>
(
buflen
-
20
)
)
++
p
;
/* skip over parminfo data */
name_len
=
buflen
-
20
;
if
(
tb_flags
&
TB_HAS_TBOFF
)
{
memcpy
(
buf
,
((
char
*
)
p
)
+
2
,
name_len
);
code_len
=
*
p
;
/* get code length */
buf
[
name_len
]
=
0
;
code_start
=
tb_start
-
code_len
;
if
(
code_offset
)
code_offset
=
code_ptr
-
code_start
+
1
;
sprintf
(
buf
+
name_len
,
"+0x%lx"
,
code_offset
-
1
);
if
(
code_offset
>
0x100000
)
break
;
++
p
;
/* skip over code size */
}
}
break
;
name_len
=
*
((
unsigned
short
*
)
p
);
if
(
name_len
>
(
buflen
-
20
))
name_len
=
buflen
-
20
;
memcpy
(
buf
,
((
char
*
)
p
)
+
2
,
name_len
);
buf
[
name_len
]
=
0
;
if
(
code_offset
)
sprintf
(
buf
+
name_len
,
"+0x%lx"
,
code_offset
-
1
);
}
}
++
p
;
break
;
}
}
++
p
;
}
}
return
buf
;
return
buf
;
}
}
...
...
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