|
@@ -14,6 +14,7 @@
|
|
#include <linux/bitops.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
|
|
+#include <linux/init.h>
|
|
#include <asm/system.h>
|
|
#include <asm/system.h>
|
|
#include <asm/mmu_context.h>
|
|
#include <asm/mmu_context.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
@@ -32,6 +33,15 @@ EXPORT_SYMBOL_GPL(trapped_mem);
|
|
#endif
|
|
#endif
|
|
static DEFINE_SPINLOCK(trapped_lock);
|
|
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)
|
|
int register_trapped_io(struct trapped_io *tiop)
|
|
{
|
|
{
|
|
struct resource *res;
|
|
struct resource *res;
|
|
@@ -39,6 +49,9 @@ int register_trapped_io(struct trapped_io *tiop)
|
|
struct page *pages[TRAPPED_PAGES_MAX];
|
|
struct page *pages[TRAPPED_PAGES_MAX];
|
|
int k, n;
|
|
int k, n;
|
|
|
|
|
|
|
|
+ if (unlikely(trapped_io_disable))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
/* structure must be page aligned */
|
|
/* structure must be page aligned */
|
|
if ((unsigned long)tiop & (PAGE_SIZE - 1))
|
|
if ((unsigned long)tiop & (PAGE_SIZE - 1))
|
|
goto bad;
|
|
goto bad;
|