freebsd-ports/emulators/open-vm-kmod/files/patch-vmmemctl_os.c
Baptiste Daroussin 77dbd57b8e emulators/open-vm-{tools,kmod}: split the package
Split the package to build the kmods separatly! Building separately has
multiple benefits:
1. it allows user to rebuild when they upgrade their kernel without
   rebuilding all of the tools which can take a long time.
2. it allows us to provide the modules in the new kmods package
   repository
3. it installs the kmods the in the same place as the regular kmods:
   /boot/modules

It means we can probably get rid of the rc script in favor if letting
users use kld_list mecanism but I will let this decision to the
maintainer based on what it probably best for users.

Approved by:	garga (maintainer)
Reviewed by:	garga (maintainer)
Differential Revision:	https://reviews.freebsd.org/D48059
2024-12-12 18:18:23 +01:00

24 lines
741 B
C

--- vmmemctl/os.c.orig 2024-10-10 15:05:07 UTC
+++ vmmemctl/os.c
@@ -103,7 +103,11 @@ MALLOC_DEFINE(M_VMMEMCTL, BALLOON_NAME, "vmmemctl meta
#define KVA_FREE(offset, size) kva_free(offset, size)
#define KMEM_ALLOC(size) kmem_malloc(size, M_WAITOK | M_ZERO)
-#define KMEM_FREE(offset, size) kmem_free(offset, size)
+#if __FreeBSD_version < 1400070
+ #define KMEM_FREE(offset, size) kmem_free((vm_offset_t)offset, size)
+#else
+ #define KMEM_FREE(offset, size) kmem_free(offset, size)
+#endif
/*
* Globals
@@ -404,7 +408,7 @@ os_pmap_free(os_pmap *p) // IN
static void
os_pmap_free(os_pmap *p) // IN
{
- KMEM_FREE((vm_offset_t)p->bitmap, p->size);
+ KMEM_FREE(p->bitmap, p->size);
p->size = 0;
p->bitmap = NULL;
}