Sat Feb 23 10:59:12 2019 UTC ()
Move PATENTRY into pmap.h, will be used outside.


(maxv)
diff -r1.97 -r1.98 src/sys/arch/x86/include/pmap.h
diff -r1.326 -r1.327 src/sys/arch/x86/x86/pmap.c

cvs diff -r1.97 -r1.98 src/sys/arch/x86/include/pmap.h (expand / switch to unified diff)

--- src/sys/arch/x86/include/pmap.h 2019/02/13 08:38:25 1.97
+++ src/sys/arch/x86/include/pmap.h 2019/02/23 10:59:12 1.98
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.h,v 1.97 2019/02/13 08:38:25 maxv Exp $ */ 1/* $NetBSD: pmap.h,v 1.98 2019/02/23 10:59:12 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Charles D. Cranor and Washington University. 4 * Copyright (c) 1997 Charles D. Cranor and Washington University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -104,26 +104,34 @@ @@ -104,26 +104,34 @@
104/* size of a PDP: usually one page, except for PAE */ 104/* size of a PDP: usually one page, except for PAE */
105#ifdef PAE 105#ifdef PAE
106#define PDP_SIZE 4 106#define PDP_SIZE 4
107#else 107#else
108#define PDP_SIZE 1 108#define PDP_SIZE 1
109#endif 109#endif
110 110
111 111
112#if defined(_KERNEL) 112#if defined(_KERNEL)
113#include <sys/kcpuset.h> 113#include <sys/kcpuset.h>
114#include <x86/pmap_pv.h> 114#include <x86/pmap_pv.h>
115#include <uvm/pmap/pmap_pvt.h> 115#include <uvm/pmap/pmap_pvt.h>
116 116
 117#define PATENTRY(n, type) (type << ((n) * 8))
 118#define PAT_UC 0x0ULL
 119#define PAT_WC 0x1ULL
 120#define PAT_WT 0x4ULL
 121#define PAT_WP 0x5ULL
 122#define PAT_WB 0x6ULL
 123#define PAT_UCMINUS 0x7ULL
 124
117#define BTSEG_NONE 0 125#define BTSEG_NONE 0
118#define BTSEG_TEXT 1 126#define BTSEG_TEXT 1
119#define BTSEG_RODATA 2 127#define BTSEG_RODATA 2
120#define BTSEG_DATA 3 128#define BTSEG_DATA 3
121#define BTSPACE_NSEGS 64 129#define BTSPACE_NSEGS 64
122 130
123struct bootspace { 131struct bootspace {
124 struct { 132 struct {
125 vaddr_t va; 133 vaddr_t va;
126 paddr_t pa; 134 paddr_t pa;
127 size_t sz; 135 size_t sz;
128 } head; 136 } head;
129 137

cvs diff -r1.326 -r1.327 src/sys/arch/x86/x86/pmap.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/pmap.c 2019/02/23 10:43:37 1.326
+++ src/sys/arch/x86/x86/pmap.c 2019/02/23 10:59:12 1.327
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.c,v 1.326 2019/02/23 10:43:37 maxv Exp $ */ 1/* $NetBSD: pmap.c,v 1.327 2019/02/23 10:59:12 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran, and by Maxime Villard. 8 * by Andrew Doran, and by Maxime Villard.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -120,27 +120,27 @@ @@ -120,27 +120,27 @@
120 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 120 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
121 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 121 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
122 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 122 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
123 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 123 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
124 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 124 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
125 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 125 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
126 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 126 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
127 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 127 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
128 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 128 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
129 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 129 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
130 */ 130 */
131 131
132#include <sys/cdefs.h> 132#include <sys/cdefs.h>
133__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.326 2019/02/23 10:43:37 maxv Exp $"); 133__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.327 2019/02/23 10:59:12 maxv Exp $");
134 134
135#include "opt_user_ldt.h" 135#include "opt_user_ldt.h"
136#include "opt_lockdebug.h" 136#include "opt_lockdebug.h"
137#include "opt_multiprocessor.h" 137#include "opt_multiprocessor.h"
138#include "opt_xen.h" 138#include "opt_xen.h"
139#include "opt_svs.h" 139#include "opt_svs.h"
140#include "opt_kasan.h" 140#include "opt_kasan.h"
141#include "opt_kaslr.h" 141#include "opt_kaslr.h"
142 142
143#include <sys/param.h> 143#include <sys/param.h>
144#include <sys/systm.h> 144#include <sys/systm.h>
145#include <sys/proc.h> 145#include <sys/proc.h>
146#include <sys/pool.h> 146#include <sys/pool.h>
@@ -277,34 +277,26 @@ static vaddr_t pmap_maxkvaddr; @@ -277,34 +277,26 @@ static vaddr_t pmap_maxkvaddr;
277#define PMAP_SUBOBJ_LOCK(pm, idx) /* nothing */ 277#define PMAP_SUBOBJ_LOCK(pm, idx) /* nothing */
278#define PMAP_SUBOBJ_UNLOCK(pm, idx) /* nothing */ 278#define PMAP_SUBOBJ_UNLOCK(pm, idx) /* nothing */
279#endif /* defined(DIAGNOSTIC) */ 279#endif /* defined(DIAGNOSTIC) */
280 280
281/* 281/*
282 * Misc. event counters. 282 * Misc. event counters.
283 */ 283 */
284struct evcnt pmap_iobmp_evcnt; 284struct evcnt pmap_iobmp_evcnt;
285struct evcnt pmap_ldt_evcnt; 285struct evcnt pmap_ldt_evcnt;
286 286
287/* 287/*
288 * PAT 288 * PAT
289 */ 289 */
290#define PATENTRY(n, type) (type << ((n) * 8)) 
291#define PAT_UC 0x0ULL 
292#define PAT_WC 0x1ULL 
293#define PAT_WT 0x4ULL 
294#define PAT_WP 0x5ULL 
295#define PAT_WB 0x6ULL 
296#define PAT_UCMINUS 0x7ULL 
297 
298static bool cpu_pat_enabled __read_mostly = false; 290static bool cpu_pat_enabled __read_mostly = false;
299 291
300/* 292/*
301 * Global data structures 293 * Global data structures
302 */ 294 */
303 295
304static struct pmap kernel_pmap_store; /* the kernel's pmap (proc0) */ 296static struct pmap kernel_pmap_store; /* the kernel's pmap (proc0) */
305struct pmap *const kernel_pmap_ptr = &kernel_pmap_store; 297struct pmap *const kernel_pmap_ptr = &kernel_pmap_store;
306 298
307struct bootspace bootspace __read_mostly; 299struct bootspace bootspace __read_mostly;
308struct slotspace slotspace __read_mostly; 300struct slotspace slotspace __read_mostly;
309 301
310/* Set to PG_NX if supported. */ 302/* Set to PG_NX if supported. */