aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/io_trapped.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/io_trapped.c')
-rw-r--r--arch/sh/kernel/io_trapped.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index 39cd7f3aec7b..c22853b059ef 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -14,6 +14,7 @@
14#include <linux/bitops.h> 14#include <linux/bitops.h>
15#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/init.h>
17#include <asm/system.h> 18#include <asm/system.h>
18#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
@@ -32,6 +33,15 @@ EXPORT_SYMBOL_GPL(trapped_mem);
32#endif 33#endif
33static DEFINE_SPINLOCK(trapped_lock); 34static DEFINE_SPINLOCK(trapped_lock);
34 35
36static int trapped_io_disable __read_mostly;
37
38static int __init trapped_io_setup(char *__unused)
39{
40 trapped_io_disable = 1;
41 return 1;
42}
43__setup("noiotrap", trapped_io_setup);
44
35int register_trapped_io(struct trapped_io *tiop) 45int register_trapped_io(struct trapped_io *tiop)
36{ 46{
37 struct resource *res; 47 struct resource *res;
@@ -39,6 +49,9 @@ int register_trapped_io(struct trapped_io *tiop)
39 struct page *pages[TRAPPED_PAGES_MAX]; 49 struct page *pages[TRAPPED_PAGES_MAX];
40 int k, n; 50 int k, n;
41 51
52 if (unlikely(trapped_io_disable))
53 return 0;
54
42 /* structure must be page aligned */ 55 /* structure must be page aligned */
43 if ((unsigned long)tiop & (PAGE_SIZE - 1)) 56 if ((unsigned long)tiop & (PAGE_SIZE - 1))
44 goto bad; 57 goto bad;