Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linux/linux_misc.c
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) | ||||
sysinfo.uptime = ts.tv_sec; | sysinfo.uptime = ts.tv_sec; | ||||
/* Use the information from the mib to get our load averages */ | /* Use the information from the mib to get our load averages */ | ||||
for (i = 0; i < 3; i++) | for (i = 0; i < 3; i++) | ||||
sysinfo.loads[i] = averunnable.ldavg[i] * | sysinfo.loads[i] = averunnable.ldavg[i] * | ||||
LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; | LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; | ||||
sysinfo.totalram = physmem * PAGE_SIZE; | sysinfo.totalram = physmem * PAGE_SIZE; | ||||
sysinfo.freeram = sysinfo.totalram - vm_cnt.v_wire_count * PAGE_SIZE; | sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; | ||||
sysinfo.sharedram = 0; | sysinfo.sharedram = 0; | ||||
mtx_lock(&vm_object_list_mtx); | mtx_lock(&vm_object_list_mtx); | ||||
TAILQ_FOREACH(object, &vm_object_list, object_list) | TAILQ_FOREACH(object, &vm_object_list, object_list) | ||||
if (object->shadow_count > 1) | if (object->shadow_count > 1) | ||||
sysinfo.sharedram += object->resident_page_count; | sysinfo.sharedram += object->resident_page_count; | ||||
mtx_unlock(&vm_object_list_mtx); | mtx_unlock(&vm_object_list_mtx); | ||||
▲ Show 20 Lines • Show All 2,376 Lines • Show Last 20 Lines |