Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:06:18 -0000
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r345927 - in stable/11/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201904051124.x35BO5Fu007679@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Apr  5 11:24:05 2019
New Revision: 345927
URL: https://svnweb.freebsd.org/changeset/base/345927

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

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

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/mm.h	Fri Apr  5 11:21:00 2019	(r345926)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/mm.h	Fri Apr  5 11:24:05 2019	(r345927)
@@ -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/11/sys/compat/linuxkpi/common/src/linux_page.c
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/src/linux_page.c	Fri Apr  5 11:21:00 2019	(r345926)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_page.c	Fri Apr  5 11:24:05 2019	(r345927)
@@ -69,6 +69,14 @@ __FBSDID("$FreeBSD$");
 #undef	LINUXKPI_HAVE_DMAP
 #endif
 
+void
+si_meminfo(struct sysinfo *si)
+{
+	si->totalram = physmem;
+	si->totalhigh = 0;
+	si->mem_unit = PAGE_SIZE;
+}
+
 void *
 linux_page_address(struct page *page)
 {





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904051124.x35BO5Fu007679>