aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/extable.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/extable.c')
-rw-r--r--kernel/extable.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/kernel/extable.c b/kernel/extable.c
index e136ed8d82ba..b54a6017b6b5 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 */
33DEFINE_MUTEX(text_mutex);
23 34
24extern struct exception_table_entry __start___ex_table[]; 35extern struct exception_table_entry __start___ex_table[];
25extern struct exception_table_entry __stop___ex_table[]; 36extern struct exception_table_entry __stop___ex_table[];
@@ -41,7 +52,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
41 return e; 52 return e;
42} 53}
43 54
44__notrace_funcgraph int core_kernel_text(unsigned long addr) 55int core_kernel_text(unsigned long addr)
45{ 56{
46 if (addr >= (unsigned long)_stext && 57 if (addr >= (unsigned long)_stext &&
47 addr <= (unsigned long)_etext) 58 addr <= (unsigned long)_etext)
@@ -54,7 +65,7 @@ __notrace_funcgraph int core_kernel_text(unsigned long addr)
54 return 0; 65 return 0;
55} 66}
56 67
57__notrace_funcgraph int __kernel_text_address(unsigned long addr) 68int __kernel_text_address(unsigned long addr)
58{ 69{
59 if (core_kernel_text(addr)) 70 if (core_kernel_text(addr))
60 return 1; 71 return 1;