Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Introduce pl_pi, will be used soon.



details:   https://anonhg.NetBSD.org/src/rev/d1667ab41388
branches:  trunk
changeset: 994736:d1667ab41388
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Nov 19 20:44:51 2018 +0000

description:
Introduce pl_pi, will be used soon.

diffstat:

 sys/arch/amd64/include/pmap.h |  3 ++-
 sys/arch/i386/include/pmap.h  |  3 ++-
 sys/arch/x86/include/pmap.h   |  4 +++-
 sys/arch/x86/x86/pmap.c       |  5 +++--
 4 files changed, 10 insertions(+), 5 deletions(-)

diffs (78 lines):

diff -r d87f1046cd38 -r d1667ab41388 sys/arch/amd64/include/pmap.h
--- a/sys/arch/amd64/include/pmap.h     Mon Nov 19 20:37:04 2018 +0000
+++ b/sys/arch/amd64/include/pmap.h     Mon Nov 19 20:44:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.57 2018/11/19 20:28:01 maxv Exp $   */
+/*     $NetBSD: pmap.h,v 1.58 2018/11/19 20:44:51 maxv Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -150,6 +150,7 @@
 #define NKL2_START_ENTRIES     0
 #define NKL1_START_ENTRIES     0
 
+#define PTP_MASK_INITIALIZER   { L1_MASK, L2_MASK, L3_MASK, L4_MASK }
 #define PTP_FRAME_INITIALIZER  { L1_FRAME, L2_FRAME, L3_FRAME, L4_FRAME }
 #define PTP_SHIFT_INITIALIZER  { L1_SHIFT, L2_SHIFT, L3_SHIFT, L4_SHIFT }
 #define NKPTP_INITIALIZER      { NKL1_START_ENTRIES, NKL2_START_ENTRIES, \
diff -r d87f1046cd38 -r d1667ab41388 sys/arch/i386/include/pmap.h
--- a/sys/arch/i386/include/pmap.h      Mon Nov 19 20:37:04 2018 +0000
+++ b/sys/arch/i386/include/pmap.h      Mon Nov 19 20:44:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.120 2018/11/19 20:28:01 maxv Exp $  */
+/*     $NetBSD: pmap.h,v 1.121 2018/11/19 20:44:51 maxv Exp $  */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -267,6 +267,7 @@
 #endif  /* !XEN */
 #define NPDPG                  (PAGE_SIZE / sizeof (pd_entry_t))
 
+#define PTP_MASK_INITIALIZER   { L1_MASK, L2_MASK }
 #define PTP_FRAME_INITIALIZER  { L1_FRAME, L2_FRAME }
 #define PTP_SHIFT_INITIALIZER  { L1_SHIFT, L2_SHIFT }
 #define NKPTP_INITIALIZER      { NKL1_START_ENTRIES, NKL2_START_ENTRIES }
diff -r d87f1046cd38 -r d1667ab41388 sys/arch/x86/include/pmap.h
--- a/sys/arch/x86/include/pmap.h       Mon Nov 19 20:37:04 2018 +0000
+++ b/sys/arch/x86/include/pmap.h       Mon Nov 19 20:44:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.90 2018/11/19 20:28:01 maxv Exp $   */
+/*     $NetBSD: pmap.h,v 1.91 2018/11/19 20:44:51 maxv Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -75,6 +75,8 @@
 #define pl2_pi(VA)     (((VA_SIGN_POS(VA)) & L2_MASK) >> L2_SHIFT)
 #define pl3_pi(VA)     (((VA_SIGN_POS(VA)) & L3_MASK) >> L3_SHIFT)
 #define pl4_pi(VA)     (((VA_SIGN_POS(VA)) & L4_MASK) >> L4_SHIFT)
+#define pl_pi(va, lvl) \
+        (((VA_SIGN_POS(va)) & ptp_masks[(lvl)-1]) >> ptp_shifts[(lvl)-1])
 
 /*
  * pl*_i: generate index into pde/pte arrays in virtual space
diff -r d87f1046cd38 -r d1667ab41388 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Mon Nov 19 20:37:04 2018 +0000
+++ b/sys/arch/x86/x86/pmap.c   Mon Nov 19 20:44:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.311 2018/11/19 20:28:01 maxv Exp $  */
+/*     $NetBSD: pmap.c,v 1.312 2018/11/19 20:44:51 maxv Exp $  */
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.311 2018/11/19 20:28:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.312 2018/11/19 20:44:51 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -239,6 +239,7 @@
  *   lock it when adding or removing pmaps from this list.
  */
 
+const vaddr_t ptp_masks[] = PTP_MASK_INITIALIZER;
 const vaddr_t ptp_frames[] = PTP_FRAME_INITIALIZER;
 const int ptp_shifts[] = PTP_SHIFT_INITIALIZER;
 const long nkptpmax[] = NKPTPMAX_INITIALIZER;



Home | Main Index | Thread Index | Old Index