summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-02-07 17:00:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-02-07 17:00:16 +0000
commit3f06bdfd3de6e66c862de2c7734009ac6b794d83 (patch)
tree7a33d8ddb799e0da5ddcea814c518786dc763f7d /sys/arch
parentad5fa7de9c9393cb861872da2baa3eb20f57caa5 (diff)
Be sure to flag pte constants as UL, and cope with this in locore.
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/genassym.cf17
-rw-r--r--sys/arch/amd64/amd64/locore.S4
-rw-r--r--sys/arch/amd64/include/pte.h48
3 files changed, 41 insertions, 28 deletions
diff --git a/sys/arch/amd64/amd64/genassym.cf b/sys/arch/amd64/amd64/genassym.cf
index da5462ebd46..52dbec0bdb5 100644
--- a/sys/arch/amd64/amd64/genassym.cf
+++ b/sys/arch/amd64/amd64/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.1 2004/01/28 01:39:38 mickey Exp $
+# $OpenBSD: genassym.cf,v 1.2 2004/02/07 17:00:12 miod Exp $
# Written by Artur Grabowski art@openbsd.org, Public Domain
@@ -12,11 +12,13 @@ include <uvm/uvm.h>
include <machine/trap.h>
include <machine/pmap.h>
+include <machine/pte.h>
include <machine/vmparam.h>
include <machine/intr.h>
export SRUN
+export L4_SLOT_KERNBASE
define L3_SLOT_KERNBASE pl3_pi(KERNBASE)
define L2_SLOT_KERNBASE pl2_pi(KERNBASE)
define L1_SLOT_KERNBASE pl1_pi(KERNBASE)
@@ -120,3 +122,16 @@ member ih_arg
member ih_next
member ih_level
+# pte fields
+export PG_V
+export PG_KR
+export PG_KW
+export PG_N
+export PG_NX
+
+# pmap constants
+export PDIR_SLOT_PTE
+
+export NKL4_KIMG_ENTRIES
+export NKL3_KIMG_ENTRIES
+export NKL2_KIMG_ENTRIES
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index 1d9d74be9cb..c54c00bd384 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.2 2004/02/03 12:09:47 mickey Exp $ */
+/* $OpenBSD: locore.S,v 1.3 2004/02/07 17:00:12 miod Exp $ */
/* $NetBSD: locore.S,v 1.2 2003/04/26 19:34:45 fvdl Exp $ */
/*
@@ -124,8 +124,6 @@
#include <sys/syscall.h>
#include <machine/param.h>
-#include <machine/pte.h>
-#include <machine/pmap.h>
#include <machine/segments.h>
#include <machine/specialreg.h>
#include <machine/trap.h>
diff --git a/sys/arch/amd64/include/pte.h b/sys/arch/amd64/include/pte.h
index bab70f51eae..842c49c4b8d 100644
--- a/sys/arch/amd64/include/pte.h
+++ b/sys/arch/amd64/include/pte.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pte.h,v 1.2 2004/02/06 00:23:21 deraadt Exp $ */
+/* $OpenBSD: pte.h,v 1.3 2004/02/07 17:00:15 miod Exp $ */
/* $NetBSD: pte.h,v 1.1 2003/04/26 18:39:47 fvdl Exp $ */
/*
@@ -87,10 +87,10 @@ typedef u_int64_t pt_entry_t; /* PTE */
#define NBPD_L3 (1ULL << L3_SHIFT) /* # bytes mapped by L3 ent (1G) */
#define NBPD_L4 (1ULL << L4_SHIFT) /* # bytes mapped by L4 ent (512G) */
-#define L4_MASK 0x0000ff8000000000
-#define L3_MASK 0x0000007fc0000000
-#define L2_MASK 0x000000003fe00000
-#define L1_MASK 0x00000000001ff000
+#define L4_MASK 0x0000ff8000000000UL
+#define L3_MASK 0x0000007fc0000000UL
+#define L2_MASK 0x000000003fe00000UL
+#define L1_MASK 0x00000000001ff000UL
#define L4_FRAME L4_MASK
#define L3_FRAME (L4_FRAME|L3_MASK)
@@ -101,30 +101,30 @@ typedef u_int64_t pt_entry_t; /* PTE */
* PDE/PTE bits. These are no different from their i386 counterparts.
*/
-#define PG_V 0x0000000000000001 /* valid */
-#define PG_RO 0x0000000000000000 /* read-only */
-#define PG_RW 0x0000000000000002 /* read-write */
-#define PG_u 0x0000000000000004 /* user accessible */
-#define PG_PROT 0x0000000000000006
-#define PG_N 0x0000000000000018 /* non-cacheable */
-#define PG_U 0x0000000000000020 /* used */
-#define PG_M 0x0000000000000040 /* modified */
-#define PG_PS 0x0000000000000080 /* 2MB page size */
-#define PG_G 0x0000000000000100 /* not flushed */
-#define PG_AVAIL1 0x0000000000000200
-#define PG_AVAIL2 0x0000000000000400
-#define PG_AVAIL3 0x0000000000000800
-#define PG_NX 0x8000000000000000 /* non-executable */
-#define PG_FRAME 0xfffffffffffff000
-
-#define PG_LGFRAME 0xffffffffffc00000 /* large (2M) page frame mask */
+#define PG_V 0x0000000000000001UL /* valid */
+#define PG_RO 0x0000000000000000UL /* read-only */
+#define PG_RW 0x0000000000000002UL /* read-write */
+#define PG_u 0x0000000000000004UL /* user accessible */
+#define PG_PROT 0x0000000000000006UL
+#define PG_N 0x0000000000000018UL /* non-cacheable */
+#define PG_U 0x0000000000000020UL /* used */
+#define PG_M 0x0000000000000040UL /* modified */
+#define PG_PS 0x0000000000000080UL /* 2MB page size */
+#define PG_G 0x0000000000000100UL /* not flushed */
+#define PG_AVAIL1 0x0000000000000200UL
+#define PG_AVAIL2 0x0000000000000400UL
+#define PG_AVAIL3 0x0000000000000800UL
+#define PG_NX 0x8000000000000000UL /* non-executable */
+#define PG_FRAME 0xfffffffffffff000UL
+
+#define PG_LGFRAME 0xffffffffffc00000UL /* large (2M) page frame mask */
/*
* short forms of protection codes
*/
-#define PG_KR 0x0000000000000000 /* kernel read-only */
-#define PG_KW 0x0000000000000002 /* kernel read-write */
+#define PG_KR 0x0000000000000000UL /* kernel read-only */
+#define PG_KW 0x0000000000000002UL /* kernel read-write */
/*
* page protection exception bits