summaryrefslogtreecommitdiff
blob: 57666914da530100c627c78dc73ac318d71f8e5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--- usr/src/nv/conftest.sh
+++ usr/src/nv/conftest.sh
@@ -127,6 +127,7 @@
         if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
             MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default"
             MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default"
+            MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi"
         fi
         if [ "$XEN_PRESENT" != "0" ]; then
             MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-xen $MACH_CFLAGS"
@@ -136,16 +137,23 @@
         if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
             MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default"
             MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default"
+            MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi"
         fi
         if [ "$XEN_PRESENT" != "0" ]; then
             MACH_CFLAGS="-I$HEADERS/asm/mach-xen $MACH_CFLAGS"
         fi
     fi
 
-    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
+    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS $AUTOCONF_CFLAGS"
+    CFLAGS="$CFLAGS -I$HEADERS -I$HEADERS/uapi"
 
     if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
-        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated"
+        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
+        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include/uapi"
+        CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated"
+        CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated/uapi"
+        CFLAGS="$CFLAGS -I$OUTPUT/include/generated"
+        CFLAGS="$CFLAGS -I$OUTPUT/include/generated/uapi"
     fi
     if [ -n "$BUILD_PARAMS" ]; then
         CFLAGS="$CFLAGS -D$BUILD_PARAMS"
@@ -936,8 +943,10 @@
             # Determine if the acpi_walk_namespace() function is present
             # and how many arguments it takes.
             #
+            for linux_or_acpi in linux acpi; do
+
             echo "$CONFTEST_PREAMBLE
-            #include <acpi/acpi.h>
+            #include <${linux_or_acpi}/acpi.h>
             void conftest_acpi_walk_namespace(void) {
                 acpi_walk_namespace();
             }" > conftest$$.c
@@ -952,7 +961,7 @@
             fi
 
             echo "$CONFTEST_PREAMBLE
-            #include <acpi/acpi.h>
+            #include <${linux_or_acpi}/acpi.h>
             void conftest_acpi_walk_namespace(void) {
                 acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
             }" > conftest$$.c
@@ -968,7 +977,7 @@
             fi
 
             echo "$CONFTEST_PREAMBLE
-            #include <acpi/acpi.h>
+            #include <${linux_or_acpi}/acpi.h>
             void conftest_acpi_walk_namespace(void) {
                 acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
             }" > conftest$$.c
@@ -981,9 +990,9 @@
                 echo "#define NV_ACPI_WALK_NAMESPACE_PRESENT" >> conftest.h
                 echo "#define NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT 6 " >> conftest.h
                 return
-            else
-                echo "#error acpi_walk_namespace() conftest failed!" >> conftest.h
             fi
+            done
+                echo "#error acpi_walk_namespace() conftest failed!" >> conftest.h
         ;;
 
         acpi_os_wait_events_complete)
@@ -1453,7 +1462,7 @@
         FILE="linux/version.h"
         SELECTED_MAKEFILE=""
 
-        if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then
+        if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE -o -f $OUTPUT/include/generated/uapi/$FILE ]; then
             #
             # We are either looking at a configured kernel source
             # tree or at headers shipped for a specific kernel.
--- usr/src/nv/nv-linux.h
+++ usr/src/nv/nv-linux.h
@@ -64,6 +64,18 @@
 #include <linux/module.h>
 #include <linux/kmod.h>
 
+#include <linux/mm.h>
+
+#if !defined(VM_RESERVED)
+#define VM_RESERVED    0x00000000
+#endif
+#if !defined(VM_DONTEXPAND)
+#define VM_DONTEXPAND  0x00000000
+#endif
+#if !defined(VM_DONTDUMP)
+#define VM_DONTDUMP    0x00000000
+#endif
+
 #include <linux/init.h>             /* module_init, module_exit         */
 #include <linux/types.h>            /* pic_t, size_t, __u32, etc        */
 #include <linux/errno.h>            /* error codes                      */