io_trapped.c (9a64e8e0ace51b309fdcff4b4754b3649250382a) io_trapped.c (ce816fa88cca083c47ab9000b2138a83043a78be)
1/*
2 * Trapped io support
3 *
4 * Copyright (C) 2008 Magnus Damm
5 *
6 * Intercept io operations by trapping.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public

--- 8 unchanged lines hidden (view full) ---

17#include <linux/init.h>
18#include <asm/mmu_context.h>
19#include <asm/uaccess.h>
20#include <asm/io.h>
21#include <asm/io_trapped.h>
22
23#define TRAPPED_PAGES_MAX 16
24
1/*
2 * Trapped io support
3 *
4 * Copyright (C) 2008 Magnus Damm
5 *
6 * Intercept io operations by trapping.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public

--- 8 unchanged lines hidden (view full) ---

17#include <linux/init.h>
18#include <asm/mmu_context.h>
19#include <asm/uaccess.h>
20#include <asm/io.h>
21#include <asm/io_trapped.h>
22
23#define TRAPPED_PAGES_MAX 16
24
25#ifdef CONFIG_HAS_IOPORT
25#ifdef CONFIG_HAS_IOPORT_MAP
26LIST_HEAD(trapped_io);
27EXPORT_SYMBOL_GPL(trapped_io);
28#endif
29#ifdef CONFIG_HAS_IOMEM
30LIST_HEAD(trapped_mem);
31EXPORT_SYMBOL_GPL(trapped_mem);
32#endif
33static DEFINE_SPINLOCK(trapped_lock);

--- 51 unchanged lines hidden (view full) ---

85 res->flags & IORESOURCE_IO ? "io" : "mmio",
86 (unsigned long)res->start);
87 len += roundup(resource_size(res), PAGE_SIZE);
88 }
89
90 tiop->magic = IO_TRAPPED_MAGIC;
91 INIT_LIST_HEAD(&tiop->list);
92 spin_lock_irq(&trapped_lock);
26LIST_HEAD(trapped_io);
27EXPORT_SYMBOL_GPL(trapped_io);
28#endif
29#ifdef CONFIG_HAS_IOMEM
30LIST_HEAD(trapped_mem);
31EXPORT_SYMBOL_GPL(trapped_mem);
32#endif
33static DEFINE_SPINLOCK(trapped_lock);

--- 51 unchanged lines hidden (view full) ---

85 res->flags & IORESOURCE_IO ? "io" : "mmio",
86 (unsigned long)res->start);
87 len += roundup(resource_size(res), PAGE_SIZE);
88 }
89
90 tiop->magic = IO_TRAPPED_MAGIC;
91 INIT_LIST_HEAD(&tiop->list);
92 spin_lock_irq(&trapped_lock);
93#ifdef CONFIG_HAS_IOPORT
93#ifdef CONFIG_HAS_IOPORT_MAP
94 if (flags & IORESOURCE_IO)
95 list_add(&tiop->list, &trapped_io);
96#endif
97#ifdef CONFIG_HAS_IOMEM
98 if (flags & IORESOURCE_MEM)
99 list_add(&tiop->list, &trapped_mem);
100#endif
101 spin_unlock_irq(&trapped_lock);

--- 195 unchanged lines hidden ---
94 if (flags & IORESOURCE_IO)
95 list_add(&tiop->list, &trapped_io);
96#endif
97#ifdef CONFIG_HAS_IOMEM
98 if (flags & IORESOURCE_MEM)
99 list_add(&tiop->list, &trapped_mem);
100#endif
101 spin_unlock_irq(&trapped_lock);

--- 195 unchanged lines hidden ---