diff options
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/io_trapped.c | 13 |
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 |
33 | static DEFINE_SPINLOCK(trapped_lock); | 34 | static DEFINE_SPINLOCK(trapped_lock); |
34 | 35 | ||
36 | static int trapped_io_disable __read_mostly; | ||
37 | |||
38 | static int __init trapped_io_setup(char *__unused) | ||
39 | { | ||
40 | trapped_io_disable = 1; | ||
41 | return 1; | ||
42 | } | ||
43 | __setup("noiotrap", trapped_io_setup); | ||
44 | |||
35 | int register_trapped_io(struct trapped_io *tiop) | 45 | int 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; |