svn commit: r362276 - stable/12/sys/compat/linux
Mark Johnston
markj at FreeBSD.org
Wed Jun 17 13:46:06 UTC 2020
Author: markj
Date: Wed Jun 17 13:46:05 2020
New Revision: 362276
URL: https://svnweb.freebsd.org/changeset/base/362276
Log:
MFC r362037:
Fix a couple of nits in Linux sysinfo(2) emulation.
Modified:
stable/12/sys/compat/linux/linux_misc.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/12/sys/compat/linux/linux_misc.c Wed Jun 17 13:27:13 2020 (r362275)
+++ stable/12/sys/compat/linux/linux_misc.c Wed Jun 17 13:46:05 2020 (r362276)
@@ -131,8 +131,8 @@ struct l_sysinfo {
l_ulong freeswap; /* swap space still available */
l_ushort procs; /* Number of current processes */
l_ushort pads;
- l_ulong totalbig;
- l_ulong freebig;
+ l_ulong totalhigh;
+ l_ulong freehigh;
l_uint mem_unit;
char _f[20-2*sizeof(l_long)-sizeof(l_int)]; /* padding */
};
@@ -164,7 +164,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_
LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale;
sysinfo.totalram = physmem * PAGE_SIZE;
- sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE;
+ sysinfo.freeram = (u_long)vm_free_count() * PAGE_SIZE;
/*
* sharedram counts pages allocated to named, swap-backed objects such
@@ -181,9 +181,13 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_
sysinfo.procs = nprocs;
- /* The following are only present in newer Linux kernels. */
- sysinfo.totalbig = 0;
- sysinfo.freebig = 0;
+ /*
+ * Platforms supported by the emulation layer do not have a notion of
+ * high memory.
+ */
+ sysinfo.totalhigh = 0;
+ sysinfo.freehigh = 0;
+
sysinfo.mem_unit = 1;
return (copyout(&sysinfo, args->info, sizeof(sysinfo)));
More information about the svn-src-all
mailing list