Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:06:17 -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-12@freebsd.org
Subject:   svn commit: r345928 - in stable/12/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201904051124.x35BOE15007733@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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)
 {





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