diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 16:43:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 16:43:24 -0400 |
commit | a3da5bf84a97d48cfaf66c6842470fc403da5121 (patch) | |
tree | cdf66c0cff8c61eedd60601fc9dffdd1ed39b880 /include/asm-x86/io.h | |
parent | 3b23e665b68387f5ee7b21f7b75ceea4d9acae4a (diff) | |
parent | d59fdcf2ac501de99c3dfb452af5e254d4342886 (diff) |
Merge branch 'x86/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (821 commits)
x86: make 64bit hpet_set_mapping to use ioremap too, v2
x86: get x86_phys_bits early
x86: max_low_pfn_mapped fix #4
x86: change _node_to_cpumask_ptr to return const ptr
x86: I/O APIC: remove an IRQ2-mask hack
x86: fix numaq_tsc_disable calling
x86, e820: remove end_user_pfn
x86: max_low_pfn_mapped fix, #3
x86: max_low_pfn_mapped fix, #2
x86: max_low_pfn_mapped fix, #1
x86_64: fix delayed signals
x86: remove conflicting nx6325 and nx6125 quirks
x86: Recover timer_ack lost in the merge of the NMI watchdog
x86: I/O APIC: Never configure IRQ2
x86: L-APIC: Always fully configure IRQ0
x86: L-APIC: Set IRQ0 as edge-triggered
x86: merge dwarf2 headers
x86: use AS_CFI instead of UNWIND_INFO
x86: use ignore macro instead of hash comment
x86: use matching CFI_ENDPROC
...
Diffstat (limited to 'include/asm-x86/io.h')
-rw-r--r-- | include/asm-x86/io.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/include/asm-x86/io.h b/include/asm-x86/io.h index d5b11f60dbd0..bf5d629b3a39 100644 --- a/include/asm-x86/io.h +++ b/include/asm-x86/io.h | |||
@@ -3,6 +3,76 @@ | |||
3 | 3 | ||
4 | #define ARCH_HAS_IOREMAP_WC | 4 | #define ARCH_HAS_IOREMAP_WC |
5 | 5 | ||
6 | #include <linux/compiler.h> | ||
7 | |||
8 | /* | ||
9 | * early_ioremap() and early_iounmap() are for temporary early boot-time | ||
10 | * mappings, before the real ioremap() is functional. | ||
11 | * A boot-time mapping is currently limited to at most 16 pages. | ||
12 | */ | ||
13 | #ifndef __ASSEMBLY__ | ||
14 | extern void early_ioremap_init(void); | ||
15 | extern void early_ioremap_clear(void); | ||
16 | extern void early_ioremap_reset(void); | ||
17 | extern void *early_ioremap(unsigned long offset, unsigned long size); | ||
18 | extern void early_iounmap(void *addr, unsigned long size); | ||
19 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
20 | #endif | ||
21 | |||
22 | #define build_mmio_read(name, size, type, reg, barrier) \ | ||
23 | static inline type name(const volatile void __iomem *addr) \ | ||
24 | { type ret; asm volatile("mov" size " %1,%0":"=" reg (ret) \ | ||
25 | :"m" (*(volatile type __force *)addr) barrier); return ret; } | ||
26 | |||
27 | #define build_mmio_write(name, size, type, reg, barrier) \ | ||
28 | static inline void name(type val, volatile void __iomem *addr) \ | ||
29 | { asm volatile("mov" size " %0,%1": :reg (val), \ | ||
30 | "m" (*(volatile type __force *)addr) barrier); } | ||
31 | |||
32 | build_mmio_read(readb, "b", unsigned char, "q", :"memory") | ||
33 | build_mmio_read(readw, "w", unsigned short, "r", :"memory") | ||
34 | build_mmio_read(readl, "l", unsigned int, "r", :"memory") | ||
35 | |||
36 | build_mmio_read(__readb, "b", unsigned char, "q", ) | ||
37 | build_mmio_read(__readw, "w", unsigned short, "r", ) | ||
38 | build_mmio_read(__readl, "l", unsigned int, "r", ) | ||
39 | |||
40 | build_mmio_write(writeb, "b", unsigned char, "q", :"memory") | ||
41 | build_mmio_write(writew, "w", unsigned short, "r", :"memory") | ||
42 | build_mmio_write(writel, "l", unsigned int, "r", :"memory") | ||
43 | |||
44 | build_mmio_write(__writeb, "b", unsigned char, "q", ) | ||
45 | build_mmio_write(__writew, "w", unsigned short, "r", ) | ||
46 | build_mmio_write(__writel, "l", unsigned int, "r", ) | ||
47 | |||
48 | #define readb_relaxed(a) __readb(a) | ||
49 | #define readw_relaxed(a) __readw(a) | ||
50 | #define readl_relaxed(a) __readl(a) | ||
51 | #define __raw_readb __readb | ||
52 | #define __raw_readw __readw | ||
53 | #define __raw_readl __readl | ||
54 | |||
55 | #define __raw_writeb __writeb | ||
56 | #define __raw_writew __writew | ||
57 | #define __raw_writel __writel | ||
58 | |||
59 | #define mmiowb() barrier() | ||
60 | |||
61 | #ifdef CONFIG_X86_64 | ||
62 | build_mmio_read(readq, "q", unsigned long, "r", :"memory") | ||
63 | build_mmio_read(__readq, "q", unsigned long, "r", ) | ||
64 | build_mmio_write(writeq, "q", unsigned long, "r", :"memory") | ||
65 | build_mmio_write(__writeq, "q", unsigned long, "r", ) | ||
66 | |||
67 | #define readq_relaxed(a) __readq(a) | ||
68 | #define __raw_readq __readq | ||
69 | #define __raw_writeq writeq | ||
70 | |||
71 | /* Let people know we have them */ | ||
72 | #define readq readq | ||
73 | #define writeq writeq | ||
74 | #endif | ||
75 | |||
6 | #ifdef CONFIG_X86_32 | 76 | #ifdef CONFIG_X86_32 |
7 | # include "io_32.h" | 77 | # include "io_32.h" |
8 | #else | 78 | #else |
@@ -16,4 +86,17 @@ extern int ioremap_change_attr(unsigned long vaddr, unsigned long size, | |||
16 | unsigned long prot_val); | 86 | unsigned long prot_val); |
17 | extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size); | 87 | extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size); |
18 | 88 | ||
89 | /* | ||
90 | * early_ioremap() and early_iounmap() are for temporary early boot-time | ||
91 | * mappings, before the real ioremap() is functional. | ||
92 | * A boot-time mapping is currently limited to at most 16 pages. | ||
93 | */ | ||
94 | extern void early_ioremap_init(void); | ||
95 | extern void early_ioremap_clear(void); | ||
96 | extern void early_ioremap_reset(void); | ||
97 | extern void *early_ioremap(unsigned long offset, unsigned long size); | ||
98 | extern void early_iounmap(void *addr, unsigned long size); | ||
99 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
100 | |||
101 | |||
19 | #endif /* _ASM_X86_IO_H */ | 102 | #endif /* _ASM_X86_IO_H */ |