diff -ru usr/src/nv/conftest.sh usr/src/nv-new/conftest.sh --- usr/src/nv/conftest.sh 2005-07-29 22:30:43.000000000 +0200 +++ usr/src/nv-new/conftest.sh 2006-03-21 09:27:35.000000000 +0100 @@ -12,8 +12,8 @@ OUTPUT=$3 CFLAGS="-D__KERNEL__ \ --nostdinc -isystem $ISYSTEM \ --Werror -Wimplicit-function-declaration" +-DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \ +-nostdinc -isystem $ISYSTEM" if [ "$OUTPUT" != "$SOURCES" ]; then CFLAGS="$CFLAGS -I$OUTPUT/include2 -I$OUTPUT/include \ @@ -29,7 +29,20 @@ # echo "#include - int nv_remap_page_range(void) { + void conftest_remap_page_range(void) { + remap_page_range(); + }" > conftest$$.c + + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 + rm -f conftest$$.c + + if [ -f conftest$$.o ]; then + rm -f conftest$$.o + exit 1 + fi + + echo "#include + int conftest_remap_page_range(void) { pgprot_t pgprot = __pgprot(0); remap_page_range(NULL, 0L, 0L, 0L, pgprot); }" > conftest$$.c @@ -44,7 +57,7 @@ fi echo "#include - int nv_remap_page_range(void) { + int conftest_remap_page_range(void) { pgprot_t pgprot = __pgprot(0); remap_page_range(0L, 0L, 0L, pgprot); }" > conftest$$.c @@ -372,8 +385,8 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) #include #endif - int nv_change_page_attr(struct page *pp, int i, pgprot_t prot) { - return change_page_attr(pp, i, prot); + void conftest_change_page_attr() { + change_page_attr(); }" > conftest$$.c $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 @@ -381,9 +394,9 @@ if [ -f conftest$$.o ]; then rm -f conftest$$.o - echo 1 - else echo 0 + else + echo 1 fi ;; @@ -414,9 +427,8 @@ # echo "#include - struct pci_dev* - nv_pci_get_class(unsigned int class, struct pci_dev *from) { - return pci_get_class(class, from); + void conftest_pci_get_class(void) { + pci_get_class(); }" > conftest$$.c $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 @@ -424,9 +436,9 @@ if [ -f conftest$$.o ]; then rm -f conftest$$.o - echo 1 - else echo 0 + else + echo 1 fi ;; @@ -436,9 +448,8 @@ # echo "#include - int nv_remap_pfn_range(void) { - pgprot_t pgprot = __pgprot(0); - remap_pfn_range(NULL, 0L, 0L, 0L, pgprot); + int conftest_remap_pfn_range(void) { + remap_pfn_range(); }" > conftest$$.c $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 @@ -446,9 +457,9 @@ if [ -f conftest$$.o ]; then rm -f conftest$$.o - echo 1 - else echo 0 + else + echo 1 fi ;; @@ -496,11 +507,11 @@ # echo "#include - struct rlimit *nv_signal_struct_rlim(void) { + struct rlimit *conftest_signal_struct_rlim(void) { return current->signal->rlim; }" > conftest$$.c - $CC $CFLAGS -Wno-error -c conftest$$.c > /dev/null 2>&1 + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 rm -f conftest$$.c if [ -f conftest$$.o ]; then @@ -520,7 +531,7 @@ echo "#include #include typedef struct agp_bridge_data agp_bridge_data; - agp_bridge_data *nv_agp_backend_acquire(struct pci_dev *dev) { + agp_bridge_data *conftest_agp_backend_acquire(struct pci_dev *dev) { return agp_backend_acquire(dev); }" > conftest$$.c @@ -541,9 +552,23 @@ # echo "#include - void *nv_vmap(struct page **pg, int cnt) { + void conftest_vmap(void) { + vmap(); + }" > conftest$$.c + + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 + rm -f conftest$$.c + + if [ -f conftest$$.o ]; then + rm -f conftest$$.o + exit 1 + fi + + echo "#include + void *conftest_vmap(struct page **pg, int cnt) { return vmap(pg, cnt); }" > conftest$$.c + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 rm -f conftest$$.c @@ -555,9 +580,10 @@ echo "#include #include - void *nv_vmap(struct page **pg, int cnt) { + void *conftest_vmap(struct page **pg, int cnt) { return vmap(pg, cnt, 0, PAGE_KERNEL); }" > conftest$$.c + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1 rm -f conftest$$.c @@ -565,6 +591,10 @@ rm -f conftest$$.o echo 4 else - exit 1 # there ain't no vmap() + # + # We couldn't determine the number of arguments expected by the + # vmap() function. + # + exit 1 fi esac