Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/nvmm Add nram in struct nvmm_ctl_mach_info.



details:   https://anonhg.NetBSD.org/src/rev/60c5dee1d415
branches:  trunk
changeset: 464887:60c5dee1d415
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Oct 28 09:00:08 2019 +0000

description:
Add nram in struct nvmm_ctl_mach_info.

diffstat:

 sys/dev/nvmm/nvmm.c       |  12 ++++++++++--
 sys/dev/nvmm/nvmm_ioctl.h |   5 +++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 42eab0c1998f -r 60c5dee1d415 sys/dev/nvmm/nvmm.c
--- a/sys/dev/nvmm/nvmm.c       Mon Oct 28 08:30:49 2019 +0000
+++ b/sys/dev/nvmm/nvmm.c       Mon Oct 28 09:00:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm.c,v 1.24 2019/10/27 20:17:36 maxv Exp $   */
+/*     $NetBSD: nvmm.c,v 1.25 2019/10/28 09:00:08 maxv Exp $   */
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.24 2019/10/27 20:17:36 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm.c,v 1.25 2019/10/28 09:00:08 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -915,6 +915,14 @@
                ctl.nvcpus++;
                nvmm_vcpu_put(vcpu);
        }
+
+       ctl.nram = 0;
+       for (i = 0; i < NVMM_MAX_HMAPPINGS; i++) {
+               if (!mach->hmap[i].present)
+                       continue;
+               ctl.nram += mach->hmap[i].size;
+       }
+
        ctl.pid = mach->owner->pid;
        ctl.time = mach->time;
 
diff -r 42eab0c1998f -r 60c5dee1d415 sys/dev/nvmm/nvmm_ioctl.h
--- a/sys/dev/nvmm/nvmm_ioctl.h Mon Oct 28 08:30:49 2019 +0000
+++ b/sys/dev/nvmm/nvmm_ioctl.h Mon Oct 28 09:00:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_ioctl.h,v 1.8 2019/10/23 07:01:11 maxv Exp $      */
+/*     $NetBSD: nvmm_ioctl.h,v 1.9 2019/10/28 09:00:08 maxv Exp $      */
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -122,7 +122,8 @@
 
 struct nvmm_ctl_mach_info {
        nvmm_machid_t machid;
-       size_t nvcpus;
+       uint32_t nvcpus;
+       uint64_t nram;
        pid_t pid;
        time_t time;
 };



Home | Main Index | Thread Index | Old Index