diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/iomap.h | 30 | ||||
-rw-r--r-- | include/drm/i915_drm.h | 13 | ||||
-rw-r--r-- | include/linux/ftrace.h | 2 | ||||
-rw-r--r-- | include/linux/ftrace_irq.h | 13 | ||||
-rw-r--r-- | include/linux/hardirq.h | 2 | ||||
-rw-r--r-- | include/linux/io-mapping.h | 125 |
6 files changed, 182 insertions, 3 deletions
diff --git a/include/asm-x86/iomap.h b/include/asm-x86/iomap.h new file mode 100644 index 000000000000..c1f06289b14b --- /dev/null +++ b/include/asm-x86/iomap.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright © 2008 Ingo Molnar | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but | ||
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/fs.h> | ||
20 | #include <linux/mm.h> | ||
21 | #include <linux/uaccess.h> | ||
22 | #include <asm/cacheflush.h> | ||
23 | #include <asm/pgtable.h> | ||
24 | #include <asm/tlbflush.h> | ||
25 | |||
26 | void * | ||
27 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | ||
28 | |||
29 | void | ||
30 | iounmap_atomic(void *kvaddr, enum km_type type); | ||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index eb4b35031a55..152b34da927c 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -159,6 +159,7 @@ typedef struct _drm_i915_sarea { | |||
159 | #define DRM_I915_GEM_SW_FINISH 0x20 | 159 | #define DRM_I915_GEM_SW_FINISH 0x20 |
160 | #define DRM_I915_GEM_SET_TILING 0x21 | 160 | #define DRM_I915_GEM_SET_TILING 0x21 |
161 | #define DRM_I915_GEM_GET_TILING 0x22 | 161 | #define DRM_I915_GEM_GET_TILING 0x22 |
162 | #define DRM_I915_GEM_GET_APERTURE 0x23 | ||
162 | 163 | ||
163 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 164 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
164 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 165 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -190,6 +191,7 @@ typedef struct _drm_i915_sarea { | |||
190 | #define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) | 191 | #define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) |
191 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) | 192 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) |
192 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) | 193 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) |
194 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) | ||
193 | 195 | ||
194 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 196 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
195 | * on the security mechanisms provided by hardware. | 197 | * on the security mechanisms provided by hardware. |
@@ -600,4 +602,15 @@ struct drm_i915_gem_get_tiling { | |||
600 | uint32_t swizzle_mode; | 602 | uint32_t swizzle_mode; |
601 | }; | 603 | }; |
602 | 604 | ||
605 | struct drm_i915_gem_get_aperture { | ||
606 | /** Total size of the aperture used by i915_gem_execbuffer, in bytes */ | ||
607 | uint64_t aper_size; | ||
608 | |||
609 | /** | ||
610 | * Available space in the aperture used by i915_gem_execbuffer, in | ||
611 | * bytes | ||
612 | */ | ||
613 | uint64_t aper_available_size; | ||
614 | }; | ||
615 | |||
603 | #endif /* _I915_DRM_H_ */ | 616 | #endif /* _I915_DRM_H_ */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 7a75fc6d41f4..1f5608c11023 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -74,7 +74,6 @@ static inline void ftrace_start(void) { } | |||
74 | #endif /* CONFIG_FUNCTION_TRACER */ | 74 | #endif /* CONFIG_FUNCTION_TRACER */ |
75 | 75 | ||
76 | #ifdef CONFIG_DYNAMIC_FTRACE | 76 | #ifdef CONFIG_DYNAMIC_FTRACE |
77 | |||
78 | enum { | 77 | enum { |
79 | FTRACE_FL_FREE = (1 << 0), | 78 | FTRACE_FL_FREE = (1 << 0), |
80 | FTRACE_FL_FAILED = (1 << 1), | 79 | FTRACE_FL_FAILED = (1 << 1), |
@@ -135,7 +134,6 @@ extern void ftrace_release(void *start, unsigned long size); | |||
135 | 134 | ||
136 | extern void ftrace_disable_daemon(void); | 135 | extern void ftrace_disable_daemon(void); |
137 | extern void ftrace_enable_daemon(void); | 136 | extern void ftrace_enable_daemon(void); |
138 | |||
139 | #else | 137 | #else |
140 | # define skip_trace(ip) ({ 0; }) | 138 | # define skip_trace(ip) ({ 0; }) |
141 | # define ftrace_force_update() ({ 0; }) | 139 | # define ftrace_force_update() ({ 0; }) |
diff --git a/include/linux/ftrace_irq.h b/include/linux/ftrace_irq.h new file mode 100644 index 000000000000..b1299d6729f2 --- /dev/null +++ b/include/linux/ftrace_irq.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _LINUX_FTRACE_IRQ_H | ||
2 | #define _LINUX_FTRACE_IRQ_H | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
6 | extern void ftrace_nmi_enter(void); | ||
7 | extern void ftrace_nmi_exit(void); | ||
8 | #else | ||
9 | static inline void ftrace_nmi_enter(void) { } | ||
10 | static inline void ftrace_nmi_exit(void) { } | ||
11 | #endif | ||
12 | |||
13 | #endif /* _LINUX_FTRACE_IRQ_H */ | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 0087cb43becf..89a56d79e4c6 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -4,8 +4,8 @@ | |||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #include <linux/smp_lock.h> | 5 | #include <linux/smp_lock.h> |
6 | #include <linux/lockdep.h> | 6 | #include <linux/lockdep.h> |
7 | #include <linux/ftrace_irq.h> | ||
7 | #include <asm/hardirq.h> | 8 | #include <asm/hardirq.h> |
8 | #include <asm/ftrace.h> | ||
9 | #include <asm/system.h> | 9 | #include <asm/system.h> |
10 | 10 | ||
11 | /* | 11 | /* |
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h new file mode 100644 index 000000000000..82df31726a54 --- /dev/null +++ b/include/linux/io-mapping.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | * Copyright © 2008 Keith Packard <keithp@keithp.com> | ||
3 | * | ||
4 | * This file is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of version 2 of the GNU General Public License | ||
6 | * as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software Foundation, | ||
15 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | ||
16 | */ | ||
17 | |||
18 | #ifndef _LINUX_IO_MAPPING_H | ||
19 | #define _LINUX_IO_MAPPING_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <asm/io.h> | ||
23 | #include <asm/page.h> | ||
24 | #include <asm/iomap.h> | ||
25 | |||
26 | /* | ||
27 | * The io_mapping mechanism provides an abstraction for mapping | ||
28 | * individual pages from an io device to the CPU in an efficient fashion. | ||
29 | * | ||
30 | * See Documentation/io_mapping.txt | ||
31 | */ | ||
32 | |||
33 | /* this struct isn't actually defined anywhere */ | ||
34 | struct io_mapping; | ||
35 | |||
36 | #ifdef CONFIG_HAVE_ATOMIC_IOMAP | ||
37 | |||
38 | /* | ||
39 | * For small address space machines, mapping large objects | ||
40 | * into the kernel virtual space isn't practical. Where | ||
41 | * available, use fixmap support to dynamically map pages | ||
42 | * of the object at run time. | ||
43 | */ | ||
44 | |||
45 | static inline struct io_mapping * | ||
46 | io_mapping_create_wc(unsigned long base, unsigned long size) | ||
47 | { | ||
48 | return (struct io_mapping *) base; | ||
49 | } | ||
50 | |||
51 | static inline void | ||
52 | io_mapping_free(struct io_mapping *mapping) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | /* Atomic map/unmap */ | ||
57 | static inline void * | ||
58 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | ||
59 | { | ||
60 | offset += (unsigned long) mapping; | ||
61 | return iomap_atomic_prot_pfn(offset >> PAGE_SHIFT, KM_USER0, | ||
62 | __pgprot(__PAGE_KERNEL_WC)); | ||
63 | } | ||
64 | |||
65 | static inline void | ||
66 | io_mapping_unmap_atomic(void *vaddr) | ||
67 | { | ||
68 | iounmap_atomic(vaddr, KM_USER0); | ||
69 | } | ||
70 | |||
71 | static inline void * | ||
72 | io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) | ||
73 | { | ||
74 | offset += (unsigned long) mapping; | ||
75 | return ioremap_wc(offset, PAGE_SIZE); | ||
76 | } | ||
77 | |||
78 | static inline void | ||
79 | io_mapping_unmap(void *vaddr) | ||
80 | { | ||
81 | iounmap(vaddr); | ||
82 | } | ||
83 | |||
84 | #else | ||
85 | |||
86 | /* Create the io_mapping object*/ | ||
87 | static inline struct io_mapping * | ||
88 | io_mapping_create_wc(unsigned long base, unsigned long size) | ||
89 | { | ||
90 | return (struct io_mapping *) ioremap_wc(base, size); | ||
91 | } | ||
92 | |||
93 | static inline void | ||
94 | io_mapping_free(struct io_mapping *mapping) | ||
95 | { | ||
96 | iounmap(mapping); | ||
97 | } | ||
98 | |||
99 | /* Atomic map/unmap */ | ||
100 | static inline void * | ||
101 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | ||
102 | { | ||
103 | return ((char *) mapping) + offset; | ||
104 | } | ||
105 | |||
106 | static inline void | ||
107 | io_mapping_unmap_atomic(void *vaddr) | ||
108 | { | ||
109 | } | ||
110 | |||
111 | /* Non-atomic map/unmap */ | ||
112 | static inline void * | ||
113 | io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) | ||
114 | { | ||
115 | return ((char *) mapping) + offset; | ||
116 | } | ||
117 | |||
118 | static inline void | ||
119 | io_mapping_unmap(void *vaddr) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | #endif /* HAVE_ATOMIC_IOMAP */ | ||
124 | |||
125 | #endif /* _LINUX_IO_MAPPING_H */ | ||