Module Name:    src
Committed By:   riastradh
Date:           Sat Aug 20 23:13:51 UTC 2022

Modified Files:
        src/sys/arch/x86/include: pmap.h
        src/sys/arch/x86/x86: pmap.c
        src/sys/dev/nvmm/x86: nvmm_x86.c
Added Files:
        src/sys/arch/x86/include: pat.h

Log Message:
x86: Move page attribute table bits to x86/pat.h.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/include/pat.h
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.415 -r1.416 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/nvmm/x86/nvmm_x86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.128 src/sys/arch/x86/include/pmap.h:1.129
--- src/sys/arch/x86/include/pmap.h:1.128	Sat Jun 18 22:11:01 2022
+++ src/sys/arch/x86/include/pmap.h	Sat Aug 20 23:13:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.128 2022/06/18 22:11:01 andvar Exp $	*/
+/*	$NetBSD: pmap.h,v 1.129 2022/08/20 23:13:51 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -115,14 +115,6 @@
 #include <x86/pmap_pv.h>
 #include <uvm/pmap/pmap_pvt.h>
 
-#define	PATENTRY(n, type)	(type << ((n) * 8))
-#define	PAT_UC		0x0ULL
-#define	PAT_WC		0x1ULL
-#define	PAT_WT		0x4ULL
-#define	PAT_WP		0x5ULL
-#define	PAT_WB		0x6ULL
-#define	PAT_UCMINUS	0x7ULL
-
 #define BTSEG_NONE	0
 #define BTSEG_TEXT	1
 #define BTSEG_RODATA	2

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.415 src/sys/arch/x86/x86/pmap.c:1.416
--- src/sys/arch/x86/x86/pmap.c:1.415	Fri May 13 09:39:40 2022
+++ src/sys/arch/x86/x86/pmap.c	Sat Aug 20 23:13:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.415 2022/05/13 09:39:40 riastradh Exp $	*/
+/*	$NetBSD: pmap.c,v 1.416 2022/08/20 23:13:51 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.415 2022/05/13 09:39:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.416 2022/08/20 23:13:51 riastradh Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -167,6 +167,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.4
 #include <machine/cpuvar.h>
 #include <machine/cputypes.h>
 
+#include <x86/pat.h>
 #include <x86/pmap_pv.h>
 
 #include <x86/i82489reg.h>

Index: src/sys/dev/nvmm/x86/nvmm_x86.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86.c:1.21 src/sys/dev/nvmm/x86/nvmm_x86.c:1.22
--- src/sys/dev/nvmm/x86/nvmm_x86.c:1.21	Tue Sep  8 16:58:38 2020
+++ src/sys/dev/nvmm/x86/nvmm_x86.c	Sat Aug 20 23:13:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.c,v 1.21 2020/09/08 16:58:38 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.c,v 1.22 2022/08/20 23:13:51 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.21 2020/09/08 16:58:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.22 2022/08/20 23:13:51 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v
 #include <uvm/uvm_extern.h>
 
 #include <x86/cputypes.h>
+#include <x86/pat.h>
 #include <x86/specialreg.h>
 
 #include <dev/nvmm/nvmm.h>

Added files:

Index: src/sys/arch/x86/include/pat.h
diff -u /dev/null src/sys/arch/x86/include/pat.h:1.1
--- /dev/null	Sat Aug 20 23:13:51 2022
+++ src/sys/arch/x86/include/pat.h	Sat Aug 20 23:13:51 2022
@@ -0,0 +1,40 @@
+/*	$NetBSD: pat.h,v 1.1 2022/08/20 23:13:51 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2022 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef	_X86_PAT_H_
+#define	_X86_PAT_H_
+
+#define	PATENTRY(n, type)	((type) << ((n) * 8))
+#define	PAT_UC			0x0ULL
+#define	PAT_WC			0x1ULL
+#define	PAT_WT			0x4ULL
+#define	PAT_WP			0x5ULL
+#define	PAT_WB			0x6ULL
+#define	PAT_UCMINUS		0x7ULL
+
+#endif	/* _X86_PAT_H_ */

Reply via email to