fix for virtualbox-70 after current commit a3a88ed

Michael Butler <[email protected]>
Newsgroups gmane.os.freebsd.devel.emulation
Message-ID <[email protected]>
In case anyone else is stuck on this ..

Recent changes in -current to remove vm_page_prev and vm_page_next break 
compilation and loading of the virtualbox kernel modules.

This patch moves the troublesome call to the new KPI. I only tested on 
virtualbox-70 but other versions probably need similar adjustments.

*** ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 
Sat Apr 19 13:11:03 2025
--- ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c     Sat Apr 
19 14:43:33 2025
***************
*** 78,83 ****
--- 78,86 ----
   #include <iprt/process.h>
   #include "internal/memobj.h"

+ #if __FreeBSD_version >= 1500038
+ #include <vm/vm_radix.h>
+ #endif

  
/*********************************************************************************************************************************
   *   Structures and Typedefs 
                                                            *
***************
*** 201,209 ****
--- 204,219 ----
   #if __FreeBSD_version < 1000000
               vm_page_lock_queues();
   #endif
+ #if __FreeBSD_version >= 1500038
+             struct pctrie_iter pages;
+
+           vm_page_iter_init(&pages, pMemFreeBSD->pObject);
+           VM_RADIX_FORALL(pPage, &pages)
+ #else
               for (vm_page_t pPage = 
vm_page_find_least(pMemFreeBSD->pObject, 0);
                    pPage != NULL;
                    pPage = vm_page_next(pPage))
+ #endif
               {
                   vm_page_unwire(pPage, 0);
               }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.