git: 53da54b936e6 - main - linuxkpi: Define `totalram_pages()`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Tue, 14 Feb 2023 22:06:32 UTC
The branch main has been updated by dumbbell (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=53da54b936e646ba1216c0cc19582dad058ca5d0

commit 53da54b936e646ba1216c0cc19582dad058ca5d0
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2023-02-08 17:52:43 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2023-02-14 22:01:06 +0000

    linuxkpi: Define `totalram_pages()`
    
    It returns `physmem`.
    
    `__FreeBSD_version` is bumped to 1400080. We need that to remove a copy
    of this function in the i915 DRM driver, maintained outside of base.
    
    Reviewed by:    manu
    Approved by:    manu
    Differential Revision:  https://reviews.freebsd.org/D38531
---
 sys/compat/linuxkpi/common/include/linux/mm.h | 6 ++++++
 sys/sys/param.h                               | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h
index 2dcf32cbe84a..8dab5b9daa76 100644
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -348,6 +348,12 @@ unlock_page(struct page *page)
 extern int is_vmalloc_addr(const void *addr);
 void si_meminfo(struct sysinfo *si);
 
+static inline unsigned long
+totalram_pages(void)
+{
+	return ((unsigned long)physmem);
+}
+
 #define	unmap_mapping_range(...)	lkpi_unmap_mapping_range(__VA_ARGS__)
 void lkpi_unmap_mapping_range(void *obj, loff_t const holebegin __unused,
     loff_t const holelen, int even_cows __unused);
diff --git a/sys/sys/param.h b/sys/sys/param.h
index b2c2b1a04b4b..751020f6d087 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -76,7 +76,7 @@
  * cannot include sys/param.h and should only be updated here.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1400079
+#define __FreeBSD_version 1400080
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,