diff options
author | Tiejun Chen <tiejun.chen@windriver.com> | 2013-02-26 22:09:27 -0500 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2013-03-02 09:52:17 -0500 |
commit | e78acf67ba7e32071e6eca14d8c39c7b1f130c31 (patch) | |
tree | 457450b97550e956f954a843a52f4a2ebbea1160 /drivers/misc | |
parent | f7c82d5a3c537a4b4d9d0395db4606bf4d3c7a5f (diff) |
kgdb/kgdbts: support ppc64
We can't look up the address of the entry point of the function simply
via that function symbol for all architectures.
For PPC64 ABI, actually there is a function descriptors structure.
A function descriptor is a three doubleword data structure that contains
the following values:
* The first doubleword contains the address of the entry point of
the function.
* The second doubleword contains the TOC base address for
the function.
* The third doubleword contains the environment pointer for
languages such as Pascal and PL/1.
So we should call a wapperred dereference_function_descriptor() to get
the address of the entry point of the function.
Note this is also safe for other architecture after refer to
"include/asm-generic/sections.h" since:
dereference_function_descriptor(p) always is (p) if without arched definition.
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/kgdbts.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index 3aa9a969b373..36f5d52775a9 100644 --- a/drivers/misc/kgdbts.c +++ b/drivers/misc/kgdbts.c | |||
@@ -103,6 +103,7 @@ | |||
103 | #include <linux/delay.h> | 103 | #include <linux/delay.h> |
104 | #include <linux/kthread.h> | 104 | #include <linux/kthread.h> |
105 | #include <linux/module.h> | 105 | #include <linux/module.h> |
106 | #include <asm/sections.h> | ||
106 | 107 | ||
107 | #define v1printk(a...) do { \ | 108 | #define v1printk(a...) do { \ |
108 | if (verbose) \ | 109 | if (verbose) \ |
@@ -222,6 +223,7 @@ static unsigned long lookup_addr(char *arg) | |||
222 | addr = (unsigned long)do_fork; | 223 | addr = (unsigned long)do_fork; |
223 | else if (!strcmp(arg, "hw_break_val")) | 224 | else if (!strcmp(arg, "hw_break_val")) |
224 | addr = (unsigned long)&hw_break_val; | 225 | addr = (unsigned long)&hw_break_val; |
226 | addr = (unsigned long) dereference_function_descriptor((void *)addr); | ||
225 | return addr; | 227 | return addr; |
226 | } | 228 | } |
227 | 229 | ||