diff options
Diffstat (limited to 'kernel/extable.c')
-rw-r--r-- | kernel/extable.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/kernel/extable.c b/kernel/extable.c index 81e99d1f0d5b..7f8f263f8524 100644 --- a/kernel/extable.c +++ b/kernel/extable.c | |||
@@ -15,11 +15,22 @@ | |||
15 | along with this program; if not, write to the Free Software | 15 | along with this program; if not, write to the Free Software |
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | */ | 17 | */ |
18 | #include <linux/ftrace.h> | ||
19 | #include <linux/memory.h> | ||
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/mutex.h> | ||
19 | #include <linux/init.h> | 22 | #include <linux/init.h> |
20 | #include <linux/ftrace.h> | 23 | |
21 | #include <asm/uaccess.h> | ||
22 | #include <asm/sections.h> | 24 | #include <asm/sections.h> |
25 | #include <asm/uaccess.h> | ||
26 | |||
27 | /* | ||
28 | * mutex protecting text section modification (dynamic code patching). | ||
29 | * some users need to sleep (allocating memory...) while they hold this lock. | ||
30 | * | ||
31 | * NOT exported to modules - patching kernel text is a really delicate matter. | ||
32 | */ | ||
33 | DEFINE_MUTEX(text_mutex); | ||
23 | 34 | ||
24 | extern struct exception_table_entry __start___ex_table[]; | 35 | extern struct exception_table_entry __start___ex_table[]; |
25 | extern struct exception_table_entry __stop___ex_table[]; | 36 | extern struct exception_table_entry __stop___ex_table[]; |
@@ -49,7 +60,7 @@ static inline int init_kernel_text(unsigned long addr) | |||
49 | return 0; | 60 | return 0; |
50 | } | 61 | } |
51 | 62 | ||
52 | __notrace_funcgraph int core_kernel_text(unsigned long addr) | 63 | int core_kernel_text(unsigned long addr) |
53 | { | 64 | { |
54 | if (addr >= (unsigned long)_stext && | 65 | if (addr >= (unsigned long)_stext && |
55 | addr <= (unsigned long)_etext) | 66 | addr <= (unsigned long)_etext) |
@@ -61,7 +72,7 @@ __notrace_funcgraph int core_kernel_text(unsigned long addr) | |||
61 | return 0; | 72 | return 0; |
62 | } | 73 | } |
63 | 74 | ||
64 | __notrace_funcgraph int __kernel_text_address(unsigned long addr) | 75 | int __kernel_text_address(unsigned long addr) |
65 | { | 76 | { |
66 | if (core_kernel_text(addr)) | 77 | if (core_kernel_text(addr)) |
67 | return 1; | 78 | return 1; |