@@ -1139,6 +1139,45 @@ compile_test() {
11391139 compile_check_conftest " $CODE " " NV_PFN_ADDRESS_SPACE_STRUCT_PRESENT" " " " types"
11401140 ;;
11411141
1142+ irq_bypass_producer_has_token)
1143+ #
1144+ # Determine if 'struct irq_bypass_producer' has 'token' field
1145+ #
1146+ # Added by commit 2b521d86ee80 ("irqbypass: Take ownership of
1147+ # producer/consumer token tracking") in v6.17
1148+ #
1149+ CODE="
1150+ #include <linux/irqbypass.h>
1151+ int conftest_irq_bypass_producer_has_token(void) {
1152+ return offsetof(struct irq_bypass_producer, token);
1153+ }"
1154+
1155+ compile_check_conftest " $CODE " " NV_IRQ_BYPASS_PRODUCER_HAS_TOKEN" " " " types"
1156+ ;;
1157+
1158+ irq_bypass_register_producer_has_eventfd_and_irq_args)
1159+ #
1160+ # Determine if irq_bypass_register_producer() function has
1161+ # additional 'eventfd' and 'irq' arguments.
1162+ #
1163+ # Added by commits 2b521d86ee80 ("irqbypass: Take ownership of
1164+ # producer/consumer token tracking") and 23b54381cee2
1165+ # ("irqbypass: Require producers to pass in Linux IRQ number
1166+ # during registration") in v6.17
1167+ #
1168+ CODE="
1169+ #include <linux/irqbypass.h>
1170+ #include <linux/eventfd.h>
1171+ void conftest_irq_bypass_register_producer_has_eventfd_and_irq_args(void) {
1172+ struct irq_bypass_producer *prod = NULL;
1173+ struct eventfd_ctx *eventfd = NULL;
1174+ int irq = 0;
1175+ irq_bypass_register_producer(prod, eventfd, irq);
1176+ }"
1177+
1178+ compile_check_conftest " $CODE " " NV_IRQ_BYPASS_REGISTER_PRODUCER_HAS_EVENTFD_AND_IRQ_ARGS" " " " types"
1179+ ;;
1180+
11421181 egm_module_helper_api_present)
11431182 #
11441183 # Determine if egm management api are present or not.
@@ -1351,6 +1390,45 @@ compile_test() {
13511390 compile_check_conftest " $CODE " " NV_GET_DEV_PAGEMAP_HAS_PGMAP_ARG" " " " types"
13521391 ;;
13531392
1393+ zone_device_page_init_has_order_arg)
1394+ #
1395+ # Determine if the zone_device_page_init() has an extra argument
1396+ #
1397+ # This change was introduced by d245f9b4ab80
1398+ # ("mm/zone_device: support large zone device private folios")
1399+ #
1400+ # in linux-next, expected in v6.19.
1401+ #
1402+ CODE="
1403+ #include <linux/memremap.h>
1404+ void init_page(void) {
1405+ struct page *page;
1406+ zone_device_page_init(page, 0);
1407+ }"
1408+ compile_check_conftest " $CODE " " NV_ZONE_DEVICE_PAGE_INIT_HAS_ORDER_ARG" " " " types"
1409+ ;;
1410+
1411+ dev_pagemap_ops_has_folio_free)
1412+ #
1413+ # Determine if the zone device now uses a folio_free() as the callback
1414+ # function instead of page_free()
1415+ #
1416+ # This change was introduced by 3a5a06554566
1417+ # (mm/zone_device: rename page_free callback to folio_free)
1418+ #
1419+ # in linux-next, expected in v6.19.
1420+ #
1421+ CODE="
1422+ #include <linux/memremap.h>
1423+ void test_folio_free(struct folio *folio) {
1424+ }
1425+ void set_folio_free_ops(void) {
1426+ struct dev_pagemap_ops ops;
1427+ ops.folio_free = test_folio_free;
1428+ }"
1429+ compile_check_conftest " $CODE " " NV_PAGEMAP_OPS_HAS_FOLIO_FREE" " " " types"
1430+ ;;
1431+
13541432 drm_available)
13551433 # Determine if the DRM subsystem is usable
13561434 CODE="
@@ -2223,6 +2301,35 @@ compile_test() {
22232301 compile_check_conftest " $CODE " " NV_GET_BACKLIGHT_DEVICE_BY_NAME_PRESENT" " " " functions"
22242302 ;;
22252303
2304+ dma_map_ops_has_map_phys)
2305+ #
2306+ # Determine if .map_phys exists in struct dma_map_ops.
2307+ #
2308+ # Commit 14cb413af00c ("dma-mapping: remove unused mapping resource callbacks")
2309+ # removed .map_resource operation and replaced it with .map_phys.
2310+ #
2311+ echo " $CONFTEST_PREAMBLE
2312+ #include <linux/dma-map-ops.h>
2313+ int conftest_dma_map_ops_has_map_phys(void) {
2314+ return offsetof(struct dma_map_ops, map_phys);
2315+ }
2316+ int conftest_dma_map_ops_has_unmap_phys(void) {
2317+ return offsetof(struct dma_map_ops, unmap_phys);
2318+ }" > conftest$$ .c
2319+
2320+ $CC $CFLAGS -c conftest$$ .c > /dev/null 2>&1
2321+ rm -f conftest$$ .c
2322+
2323+ if [ -f conftest$$ .o ]; then
2324+ echo " #define NV_DMA_MAP_OPS_HAS_MAP_PHYS" | append_conftest " types"
2325+ rm -f conftest$$ .o
2326+ return
2327+ else
2328+ echo " #undef NV_DMA_MAP_OPS_HAS_MAP_PHYS" | append_conftest " types"
2329+ return
2330+ fi
2331+ ;;
2332+
22262333 dma_buf_ops_has_map)
22272334 #
22282335 # Determine if .map exists in dma_buf_ops.
@@ -3938,6 +4045,27 @@ compile_test() {
39384045 compile_check_conftest " $CODE " " NV_PCI_REBAR_GET_POSSIBLE_SIZES_PRESENT" " " " functions"
39394046 ;;
39404047
4048+ pci_resize_resource_has_exclude_bars_arg)
4049+ #
4050+ # Determine if pci_resize_resource() has exclude_bars argument.
4051+ #
4052+ # exclude_bars argument was added to pci_resize_resource by commit
4053+ # 337b1b566db0 (11/14/2025) ("PCI: Fix restoring BARs on BAR resize rollback path")
4054+ # in linux-next.
4055+ #
4056+ CODE="
4057+ #include <linux/pci.h>
4058+
4059+ typeof(pci_resize_resource) conftest_pci_resize_resource_has_exclude_bars_arg;
4060+ int __must_check conftest_pci_resize_resource_has_exclude_bars_arg(struct pci_dev *dev,
4061+ int i, int size,
4062+ int exclude_bars) {
4063+ return 0;
4064+ }"
4065+
4066+ compile_check_conftest " $CODE " " NV_PCI_RESIZE_RESOURCE_HAS_EXCLUDE_BARS_ARG" " " " types"
4067+ ;;
4068+
39414069 drm_connector_has_override_edid)
39424070 #
39434071 # Determine if 'struct drm_connector' has an 'override_edid' member.
@@ -3976,22 +4104,39 @@ compile_test() {
39764104 compile_check_conftest " $CODE " " NV_IOMMU_SVA_BIND_DEVICE_HAS_DRVDATA_ARG" " " " types"
39774105 ;;
39784106
3979- vm_area_struct_has_const_vm_flags )
4107+ vm_flags_set )
39804108 #
3981- # Determine if the 'vm_area_struct' structure has
3982- # const 'vm_flags'.
4109+ # Determine if the vm_flags_set() function is present. The
4110+ # presence of this function indicates that the vm_flags_clear()
4111+ # function is also present.
39834112 #
3984- # A union of '__vm_flags' and 'const vm_flags' was added by
4113+ # The functions vm_flags_set()/ vm_flags_clear() were added by
39854114 # commit bc292ab00f6c ("mm: introduce vma->vm_flags wrapper
3986- # functions") in v6.3.
4115+ # functions") in v6.3-rc1 (2023-02-09) .
39874116 #
39884117 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);
4118+ #include <linux/mm.h>
4119+ void conftest_vm_flags_set(void) {
4120+ vm_flags_set();
4121+ }"
4122+
4123+ compile_check_conftest " $CODE " " NV_VM_FLAGS_SET_PRESENT" " " " functions"
4124+ ;;
4125+
4126+ vma_flags_set_word)
4127+ #
4128+ # Determine if the vma_flags_set_word() function is present.
4129+ #
4130+ # Added by commit c3f7c506e8f1 ("mm: introduce VMA flags bitmap type")
4131+ # in v6.19-rc1.
4132+ #
4133+ CODE="
4134+ #include <linux/mm.h>
4135+ void conftest_vma_flags_set_word(void) {
4136+ vma_flags_set_word();
39924137 }"
39934138
3994- compile_check_conftest " $CODE " " NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS " " " " types "
4139+ compile_check_conftest " $CODE " " NV_VMA_FLAGS_SET_WORD_PRESENT " " " " functions "
39954140 ;;
39964141
39974142 drm_driver_has_dumb_destroy)
0 commit comments