diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-04-02 12:31:16 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-02 12:31:16 +0900 |
commit | eeee7853c4ffaf5b9eb58f39708e3c78f66cee15 (patch) | |
tree | 55506c48a8e841573f1d869cd6e0fbfc6e8443e1 /arch/sh | |
parent | 8dafc34616282c1fd79d42a4353ee5322767d720 (diff) |
sh: Add a command line option for disabling I/O trapping.
This adds a 'noiotrap' kernel command line option to permit disabling of
I/O trapping. This is mostly useful for running on emulators where the
physical device limitations are not an issue.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
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 39cd7f3aec7..c22853b059e 100644 --- a/arch/sh/kernel/io_trapped.c +++ b/arch/sh/kernel/io_trapped.c @@ -14,6 +14,7 @@ #include <linux/bitops.h> #include <linux/vmalloc.h> #include <linux/module.h> +#include <linux/init.h> #include <asm/system.h> #include <asm/mmu_context.h> #include <asm/uaccess.h> @@ -32,6 +33,15 @@ EXPORT_SYMBOL_GPL(trapped_mem); #endif static DEFINE_SPINLOCK(trapped_lock); +static int trapped_io_disable __read_mostly; + +static int __init trapped_io_setup(char *__unused) +{ + trapped_io_disable = 1; + return 1; +} +__setup("noiotrap", trapped_io_setup); + int register_trapped_io(struct trapped_io *tiop) { struct resource *res; @@ -39,6 +49,9 @@ int register_trapped_io(struct trapped_io *tiop) struct page *pages[TRAPPED_PAGES_MAX]; int k, n; + if (unlikely(trapped_io_disable)) + return 0; + /* structure must be page aligned */ if ((unsigned long)tiop & (PAGE_SIZE - 1)) goto bad; |