Date: Wed, 13 Mar 2019 19:01:56 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345101 - in head/sys/compat/linuxkpi/common: include/linux src Message-ID: <201903131901.x2DJ1umx094332@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Mar 13 19:01:55 2019 New Revision: 345101 URL: https://svnweb.freebsd.org/changeset/base/345101 Log: Implement si_meminfo() in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Wed Mar 13 18:55:41 2019 (r345100) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Wed Mar 13 19:01:55 2019 (r345101) @@ -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: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Wed Mar 13 18:55:41 2019 (r345100) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Wed Mar 13 19:01:55 2019 (r345101) @@ -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?201903131901.x2DJ1umx094332>