Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys x86: Move page attribute table bits to x86/pat.h.
details: https://anonhg.NetBSD.org/src/rev/f9ce9e64a5a8
branches: trunk
changeset: 369525:f9ce9e64a5a8
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Aug 20 23:13:51 2022 +0000
description:
x86: Move page attribute table bits to x86/pat.h.
diffstat:
sys/arch/x86/include/pat.h | 40 ++++++++++++++++++++++++++++++++++++++++
sys/arch/x86/include/pmap.h | 10 +---------
sys/arch/x86/x86/pmap.c | 5 +++--
sys/dev/nvmm/x86/nvmm_x86.c | 5 +++--
4 files changed, 47 insertions(+), 13 deletions(-)
diffs (120 lines):
diff -r 024916fdfde2 -r f9ce9e64a5a8 sys/arch/x86/include/pat.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/x86/include/pat.h Sat Aug 20 23:13:51 2022 +0000
@@ -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_ */
diff -r 024916fdfde2 -r f9ce9e64a5a8 sys/arch/x86/include/pmap.h
--- a/sys/arch/x86/include/pmap.h Sat Aug 20 23:12:00 2022 +0000
+++ b/sys/arch/x86/include/pmap.h Sat Aug 20 23:13:51 2022 +0000
@@ -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
diff -r 024916fdfde2 -r f9ce9e64a5a8 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c Sat Aug 20 23:12:00 2022 +0000
+++ b/sys/arch/x86/x86/pmap.c Sat Aug 20 23:13:51 2022 +0000
@@ -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 @@
#include <machine/cpuvar.h>
#include <machine/cputypes.h>
+#include <x86/pat.h>
#include <x86/pmap_pv.h>
#include <x86/i82489reg.h>
diff -r 024916fdfde2 -r f9ce9e64a5a8 sys/dev/nvmm/x86/nvmm_x86.c
--- a/sys/dev/nvmm/x86/nvmm_x86.c Sat Aug 20 23:12:00 2022 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86.c Sat Aug 20 23:13:51 2022 +0000
@@ -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 @@
#include <uvm/uvm_extern.h>
#include <x86/cputypes.h>
+#include <x86/pat.h>
#include <x86/specialreg.h>
#include <dev/nvmm/nvmm.h>
Home |
Main Index |
Thread Index |
Old Index