@@ -2114,6 +2114,35 @@ compile_test() {
21142114 compile_check_conftest " $CODE " " NV_GET_BACKLIGHT_DEVICE_BY_NAME_PRESENT" " " " functions"
21152115 ;;
21162116
2117+ dma_map_ops_has_map_phys)
2118+ #
2119+ # Determine if .map_phys exists in struct dma_map_ops.
2120+ #
2121+ # Commit 14cb413af00c ("dma-mapping: remove unused mapping resource callbacks")
2122+ # removed .map_resource operation and replaced it with .map_phys.
2123+ #
2124+ echo " $CONFTEST_PREAMBLE
2125+ #include <linux/dma-map-ops.h>
2126+ int conftest_dma_map_ops_has_map_phys(void) {
2127+ return offsetof(struct dma_map_ops, map_phys);
2128+ }
2129+ int conftest_dma_map_ops_has_unmap_phys(void) {
2130+ return offsetof(struct dma_map_ops, unmap_phys);
2131+ }" > conftest$$ .c
2132+
2133+ $CC $CFLAGS -c conftest$$ .c > /dev/null 2>&1
2134+ rm -f conftest$$ .c
2135+
2136+ if [ -f conftest$$ .o ]; then
2137+ echo " #define NV_DMA_MAP_OPS_HAS_MAP_PHYS" | append_conftest " types"
2138+ rm -f conftest$$ .o
2139+ return
2140+ else
2141+ echo " #undef NV_DMA_MAP_OPS_HAS_MAP_PHYS" | append_conftest " types"
2142+ return
2143+ fi
2144+ ;;
2145+
21172146 dma_buf_ops_has_map)
21182147 #
21192148 # Determine if .map exists in dma_buf_ops.
@@ -3938,6 +3967,27 @@ compile_test() {
39383967 compile_check_conftest " $CODE " " NV_PCI_REBAR_GET_POSSIBLE_SIZES_PRESENT" " " " functions"
39393968 ;;
39403969
3970+ pci_resize_resource_has_exclude_bars_arg)
3971+ #
3972+ # Determine if pci_resize_resource() has exclude_bars argument.
3973+ #
3974+ # exclude_bars argument was added to pci_resize_resource by commit
3975+ # 337b1b566db0 (11/14/2025) ("PCI: Fix restoring BARs on BAR resize rollback path")
3976+ # in linux-next.
3977+ #
3978+ CODE="
3979+ #include <linux/pci.h>
3980+
3981+ typeof(pci_resize_resource) conftest_pci_resize_resource_has_exclude_bars_arg;
3982+ int __must_check conftest_pci_resize_resource_has_exclude_bars_arg(struct pci_dev *dev,
3983+ int i, int size,
3984+ int exclude_bars) {
3985+ return 0;
3986+ }"
3987+
3988+ compile_check_conftest " $CODE " " NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG" " " " types"
3989+ ;;
3990+
39413991 drm_connector_has_override_edid)
39423992 #
39433993 # Determine if 'struct drm_connector' has an 'override_edid' member.
@@ -3976,22 +4026,39 @@ compile_test() {
39764026 compile_check_conftest " $CODE " " NV_IOMMU_SVA_BIND_DEVICE_HAS_DRVDATA_ARG" " " " types"
39774027 ;;
39784028
3979- vm_area_struct_has_const_vm_flags )
4029+ vm_flags_set )
39804030 #
3981- # Determine if the 'vm_area_struct' structure has
3982- # const 'vm_flags'.
4031+ # Determine if the vm_flags_set() function is present. The
4032+ # presence of this function indicates that the vm_flags_clear()
4033+ # function is also present.
39834034 #
3984- # A union of '__vm_flags' and 'const vm_flags' was added by
4035+ # The functions vm_flags_set()/ vm_flags_clear() were added by
39854036 # commit bc292ab00f6c ("mm: introduce vma->vm_flags wrapper
3986- # functions") in v6.3.
4037+ # functions") in v6.3-rc1 (2023-02-09) .
39874038 #
39884039 CODE="
3989- #include <linux/mm_types.h>
3990- int conftest_vm_area_struct_has_const_vm_flags(void) {
3991- return offsetof(struct vm_area_struct, __vm_flags);
4040+ #include <linux/mm.h>
4041+ void conftest_vm_flags_set(void) {
4042+ vm_flags_set();
4043+ }"
4044+
4045+ compile_check_conftest " $CODE " " NV_VM_FLAGS_SET_PRESENT" " " " functions"
4046+ ;;
4047+
4048+ vma_flags_set_word)
4049+ #
4050+ # Determine if the vma_flags_set_word() function is present.
4051+ #
4052+ # Added by commit c3f7c506e8f1 ("mm: introduce VMA flags bitmap type")
4053+ # in v6.19-rc1.
4054+ #
4055+ CODE="
4056+ #include <linux/mm.h>
4057+ void conftest_vma_flags_set_word(void) {
4058+ vma_flags_set_word();
39924059 }"
39934060
3994- compile_check_conftest " $CODE " " NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS " " " " types "
4061+ compile_check_conftest " $CODE " " NV_VMA_FLAGS_SET_WORD_PRESENT " " " " functions "
39954062 ;;
39964063
39974064 drm_driver_has_dumb_destroy)
0 commit comments