aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-04-01 23:31:16 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-01 23:31:16 -0400
commiteeee7853c4ffaf5b9eb58f39708e3c78f66cee15 (patch)
tree55506c48a8e841573f1d869cd6e0fbfc6e8443e1 /arch/sh
parent8dafc34616282c1fd79d42a4353ee5322767d720 (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.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;