~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/30-kernel-2.6.39.patch

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-07-04 13:02:31 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110704130231-l843es6wqhx614n7
Tags: 4.0.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add the Modaliases control field manually for maximum backportability.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Fix build failure with kernel 2.6.39-rc1.
2
 
Origin: upstream, http://www.virtualbox.org/changeset/36471
3
 
 
4
 
Index: trunk/src/VBox/Additions/linux/drm/vboxvideo_drm.c
5
 
===================================================================
6
 
--- trunk/src/VBox/Additions/linux/drm/vboxvideo_drm.c (revision 35662)
7
 
+++ trunk/src/VBox/Additions/linux/drm/vboxvideo_drm.c (revision 36471)
8
 
@@ -67,5 +67,5 @@
9
 
 
10
 
 static struct pci_device_id pciidlist[] = {
11
 
-       vboxvideo_PCI_IDS
12
 
+        vboxvideo_PCI_IDS
13
 
 };
14
 
 
15
 
@@ -73,5 +73,5 @@
16
 
 {
17
 
 # if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 28)
18
 
-       return drm_vblank_init(dev, 1);
19
 
+    return drm_vblank_init(dev, 1);
20
 
 #else
21
 
     return 0;
22
 
@@ -79,49 +79,69 @@
23
 
 }
24
 
 
25
 
-static struct drm_driver driver = {
26
 
-       /* .driver_features = DRIVER_USE_MTRR, */
27
 
-       .load = vboxvideo_driver_load,
28
 
-       .reclaim_buffers = drm_core_reclaim_buffers,
29
 
-        /* As of Linux 2.65.37, always the internal functions are used. */
30
 
+static struct drm_driver driver =
31
 
+{
32
 
+    /* .driver_features = DRIVER_USE_MTRR, */
33
 
+    .load = vboxvideo_driver_load,
34
 
+    .reclaim_buffers = drm_core_reclaim_buffers,
35
 
+    /* As of Linux 2.65.37, always the internal functions are used. */
36
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 37)
37
 
-       .get_map_ofs = drm_core_get_map_ofs,
38
 
-       .get_reg_ofs = drm_core_get_reg_ofs,
39
 
+    .get_map_ofs = drm_core_get_map_ofs,
40
 
+    .get_reg_ofs = drm_core_get_reg_ofs,
41
 
 #endif
42
 
-       .fops = {
43
 
-                .owner = THIS_MODULE,
44
 
-                .open = drm_open,
45
 
-                .release = drm_release,
46
 
-                 /* This was changed with Linux 2.6.33 but Fedora backported this
47
 
-                  * change to their 2.6.32 kernel. */
48
 
+    .fops =
49
 
+    {
50
 
+        .owner = THIS_MODULE,
51
 
+        .open = drm_open,
52
 
+        .release = drm_release,
53
 
+        /* This was changed with Linux 2.6.33 but Fedora backported this
54
 
+         * change to their 2.6.32 kernel. */
55
 
 #if defined(DRM_UNLOCKED) || LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 33)
56
 
-                .unlocked_ioctl = drm_ioctl,
57
 
+        .unlocked_ioctl = drm_ioctl,
58
 
 #else
59
 
-                .ioctl = drm_ioctl,
60
 
+        .ioctl = drm_ioctl,
61
 
 #endif
62
 
-                .mmap = drm_mmap,
63
 
-                .poll = drm_poll,
64
 
-                .fasync = drm_fasync,
65
 
-       },
66
 
-       .pci_driver = {
67
 
-                .name = DRIVER_NAME,
68
 
-                .id_table = pciidlist,
69
 
-       },
70
 
+        .mmap = drm_mmap,
71
 
+        .poll = drm_poll,
72
 
+        .fasync = drm_fasync,
73
 
+    },
74
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39)
75
 
+    .pci_driver =
76
 
+    {
77
 
+        .name = DRIVER_NAME,
78
 
+        .id_table = pciidlist,
79
 
+    },
80
 
+#endif
81
 
+    .name = DRIVER_NAME,
82
 
+    .desc = DRIVER_DESC,
83
 
+    .date = DRIVER_DATE,
84
 
+    .major = DRIVER_MAJOR,
85
 
+    .minor = DRIVER_MINOR,
86
 
+    .patchlevel = DRIVER_PATCHLEVEL,
87
 
+};
88
 
 
89
 
-       .name = DRIVER_NAME,
90
 
-       .desc = DRIVER_DESC,
91
 
-       .date = DRIVER_DATE,
92
 
-       .major = DRIVER_MAJOR,
93
 
-       .minor = DRIVER_MINOR,
94
 
-       .patchlevel = DRIVER_PATCHLEVEL,
95
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION (2, 6, 39)
96
 
+static struct pci_driver pci_driver =
97
 
+{
98
 
+    .name = DRIVER_NAME,
99
 
+    .id_table = pciidlist,
100
 
 };
101
 
+#endif
102
 
 
103
 
 static int __init vboxvideo_init(void)
104
 
 {
105
 
-       return drm_init(&driver);
106
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39)
107
 
+    return drm_init(&driver);
108
 
+#else
109
 
+    return drm_pci_init(&driver, &pci_driver);
110
 
+#endif
111
 
 }
112
 
 
113
 
 static void __exit vboxvideo_exit(void)
114
 
 {
115
 
-       drm_exit(&driver);
116
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION (2, 6, 39)
117
 
+    drm_exit(&driver);
118
 
+#else
119
 
+    drm_pci_exit(&driver, &pci_driver);
120
 
+#endif
121
 
 }
122
 
 
123
 
Index: trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
124
 
===================================================================
125
 
--- trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c (revision 33994)
126
 
+++ trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c (revision 36471)
127
 
@@ -447,12 +447,12 @@
128
 
 }
129
 
 
130
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
131
 
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
132
 
 static struct super_block *sf_get_sb(struct file_system_type *fs_type, int flags,
133
 
-        const char *dev_name, void *data)
134
 
+                                     const char *dev_name, void *data)
135
 
 {
136
 
     TRACE();
137
 
     return get_sb_nodev(fs_type, flags, data, sf_read_super_26);
138
 
 }
139
 
-#else
140
 
+# elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
141
 
 static int sf_get_sb(struct file_system_type *fs_type, int flags,
142
 
                      const char *dev_name, void *data, struct vfsmount *mnt)
143
 
@@ -461,5 +461,12 @@
144
 
     return get_sb_nodev(fs_type, flags, data, sf_read_super_26, mnt);
145
 
 }
146
 
-#endif
147
 
+# else
148
 
+static struct dentry *sf_mount(struct file_system_type *fs_type, int flags,
149
 
+                               const char *dev_name, void *data)
150
 
+{
151
 
+    TRACE();
152
 
+    return mount_nodev(fs_type, flags, data, sf_read_super_26);
153
 
+}
154
 
+# endif
155
 
 
156
 
 static struct file_system_type vboxsf_fs_type =
157
 
@@ -467,5 +474,9 @@
158
 
     .owner   = THIS_MODULE,
159
 
     .name    = "vboxsf",
160
 
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
161
 
     .get_sb  = sf_get_sb,
162
 
+# else
163
 
+    .mount   = sf_mount,
164
 
+# endif
165
 
     .kill_sb = kill_anon_super
166
 
 };