svn commit: r345928 - in stable/12/sys/compat/linuxkpi/common: include/linux src

Hans Petter Selasky hselasky at FreeBSD.org
Tue Sep 3 14:06:40 UTC 2019


Author: hselasky
Date: Fri Apr  5 11:24:14 2019
New Revision: 345928
URL: https://svnweb.freebsd.org/changeset/base/345928

Log:
  MFC r345101:
  Implement si_meminfo() in the LinuxKPI.
  
  Submitted by:		Johannes Lundberg <johalun0 at gmail.com>
  Sponsored by:		Limelight Networks
  Sponsored by:		Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/mm.h
  stable/12/sys/compat/linuxkpi/common/src/linux_page.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mm.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/linux/mm.h	Fri Apr  5 11:24:05 2019	(r345927)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/mm.h	Fri Apr  5 11:24:14 2019	(r345928)
@@ -134,6 +134,12 @@ struct vm_operations_struct {
 	int	(*access) (struct vm_area_struct *, unsigned long, void *, int, int);
 };
 
+struct sysinfo {
+	uint64_t totalram;
+	uint64_t totalhigh;
+	uint32_t mem_unit;
+};
+
 /*
  * Compute log2 of the power of two rounded up count of pages
  * needed for size bytes.
@@ -268,5 +274,6 @@ vmalloc_to_page(const void *addr)
 }
 
 extern int is_vmalloc_addr(const void *addr);
+void si_meminfo(struct sysinfo *si);
 
 #endif					/* _LINUX_MM_H_ */

Modified: stable/12/sys/compat/linuxkpi/common/src/linux_page.c
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/src/linux_page.c	Fri Apr  5 11:24:05 2019	(r345927)
+++ stable/12/sys/compat/linuxkpi/common/src/linux_page.c	Fri Apr  5 11:24:14 2019	(r345928)
@@ -63,6 +63,14 @@ __FBSDID("$FreeBSD$");
 #include <linux/preempt.h>
 #include <linux/fs.h>
 
+void
+si_meminfo(struct sysinfo *si)
+{
+	si->totalram = physmem;
+	si->totalhigh = 0;
+	si->mem_unit = PAGE_SIZE;
+}
+
 void *
 linux_page_address(struct page *page)
 {




More information about the svn-src-all mailing list