summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/acpi_machdep.c4
-rw-r--r--sys/arch/amd64/amd64/bios.c4
-rw-r--r--sys/arch/amd64/amd64/bus_dma.c6
-rw-r--r--sys/arch/amd64/amd64/bus_space.c5
-rw-r--r--sys/arch/amd64/amd64/cpu.c9
-rw-r--r--sys/arch/amd64/amd64/gdt.c5
-rw-r--r--sys/arch/amd64/amd64/hibernate_machdep.c26
-rw-r--r--sys/arch/amd64/amd64/machdep.c12
-rw-r--r--sys/arch/amd64/amd64/mpbios.c4
-rw-r--r--sys/arch/amd64/amd64/pmap.c31
-rw-r--r--sys/arch/amd64/amd64/trap.c8
-rw-r--r--sys/arch/amd64/amd64/vm_machdep.c4
-rw-r--r--sys/arch/amd64/include/pmap.h11
-rw-r--r--sys/arch/amd64/pci/vga_post.c8
14 files changed, 67 insertions, 70 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c
index 2e686a2b546..7ecc744bbf8 100644
--- a/sys/arch/amd64/amd64/acpi_machdep.c
+++ b/sys/arch/amd64/amd64/acpi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_machdep.c,v 1.63 2014/09/19 20:02:25 kettenis Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.64 2014/11/16 12:30:56 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -82,7 +82,7 @@ acpi_map(paddr_t pa, size_t len, struct acpi_mem_map *handle)
handle->pa = pa;
do {
- pmap_kenter_pa(va, pgpa, VM_PROT_READ | VM_PROT_WRITE);
+ pmap_kenter_pa(va, pgpa, PROT_READ | PROT_WRITE);
va += NBPG;
pgpa += NBPG;
} while (pgpa < endpa);
diff --git a/sys/arch/amd64/amd64/bios.c b/sys/arch/amd64/amd64/bios.c
index 659affed2c3..577c8b49758 100644
--- a/sys/arch/amd64/amd64/bios.c
+++ b/sys/arch/amd64/amd64/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.28 2014/09/14 14:17:23 jsg Exp $ */
+/* $OpenBSD: bios.c,v 1.29 2014/11/16 12:30:56 deraadt Exp $ */
/*
* Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca>
*
@@ -133,7 +133,7 @@ bios_attach(struct device *parent, struct device *self, void *aux)
smbios_entry.count = hdr->count;
for (; pa < end; pa+= NBPG, va+= NBPG)
- pmap_kenter_pa(va, pa, VM_PROT_READ);
+ pmap_kenter_pa(va, pa, PROT_READ);
printf(": SMBIOS rev. %d.%d @ 0x%x (%d entries)",
hdr->majrev, hdr->minrev, hdr->addr, hdr->count);
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c
index 053a0305eeb..9f86bdaa4ec 100644
--- a/sys/arch/amd64/amd64/bus_dma.c
+++ b/sys/arch/amd64/amd64/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.45 2014/07/12 18:44:41 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.46 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -494,8 +494,8 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
if (size == 0)
panic("_bus_dmamem_map: size botch");
error = pmap_enter(pmap_kernel(), va, addr | pmapflags,
- VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ |
- VM_PROT_WRITE | PMAP_WIRED | PMAP_CANFAIL);
+ PROT_READ | PROT_WRITE,
+ PROT_READ | PROT_WRITE | PMAP_WIRED | PMAP_CANFAIL);
if (error) {
pmap_update(pmap_kernel());
km_free((void *)sva, ssize, &kv_any, &kp_none);
diff --git a/sys/arch/amd64/amd64/bus_space.c b/sys/arch/amd64/amd64/bus_space.c
index 3b8a345d427..5cf9a745314 100644
--- a/sys/arch/amd64/amd64/bus_space.c
+++ b/sys/arch/amd64/amd64/bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_space.c,v 1.24 2014/10/25 16:57:58 kettenis Exp $ */
+/* $OpenBSD: bus_space.c,v 1.25 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: bus_space.c,v 1.2 2003/03/14 18:47:53 christos Exp $ */
/*-
@@ -508,8 +508,7 @@ x86_mem_add_mapping(bus_addr_t bpa, bus_size_t size, int flags,
for (; map_size > 0;
pa += PAGE_SIZE, va += PAGE_SIZE, map_size -= PAGE_SIZE)
- pmap_kenter_pa(va, pa | pmap_flags,
- VM_PROT_READ | VM_PROT_WRITE);
+ pmap_kenter_pa(va, pa | pmap_flags, PROT_READ | PROT_WRITE);
pmap_update(pmap_kernel());
return 0;
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index c3b596c7d3d..209fff74ea4 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.66 2014/10/09 03:59:58 tedu Exp $ */
+/* $OpenBSD: cpu.c,v 1.67 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -170,9 +170,8 @@ replacesmap(void)
pmap_extract(pmap_kernel(), kva, &pa1);
pmap_extract(pmap_kernel(), kva + PAGE_SIZE, &pa2);
- pmap_kenter_pa(nva, pa1, VM_PROT_READ | VM_PROT_WRITE);
- pmap_kenter_pa(nva + PAGE_SIZE, pa2, VM_PROT_READ |
- VM_PROT_WRITE);
+ pmap_kenter_pa(nva, pa1, PROT_READ | PROT_WRITE);
+ pmap_kenter_pa(nva + PAGE_SIZE, pa2, PROT_READ | PROT_WRITE);
pmap_update(pmap_kernel());
/* replace 3 byte nops with stac/clac instructions */
@@ -833,7 +832,7 @@ mp_cpu_start(struct cpu_info *ci)
dwordptr[0] = 0;
dwordptr[1] = MP_TRAMPOLINE >> 4;
- pmap_kenter_pa(0, 0, VM_PROT_READ|VM_PROT_WRITE);
+ pmap_kenter_pa(0, 0, PROT_READ | PROT_WRITE);
memcpy((u_int8_t *) 0x467, dwordptr, 4);
pmap_kremove(0, PAGE_SIZE);
diff --git a/sys/arch/amd64/amd64/gdt.c b/sys/arch/amd64/amd64/gdt.c
index 6f822cf69f1..50588686167 100644
--- a/sys/arch/amd64/amd64/gdt.c
+++ b/sys/arch/amd64/amd64/gdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gdt.c,v 1.20 2014/09/14 14:17:23 jsg Exp $ */
+/* $OpenBSD: gdt.c,v 1.21 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: gdt.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -65,8 +65,7 @@ gdt_alloc_cpu(struct cpu_info *ci)
pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO);
if (pg == NULL)
panic("gdt_init: no pages");
- pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
- VM_PROT_READ | VM_PROT_WRITE);
+ pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg), PROT_READ | PROT_WRITE);
}
bcopy(gdtstore, ci->ci_gdt, GDT_SIZE);
bzero(ci->ci_tss, sizeof(*ci->ci_tss));
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c
index 42d22593d27..265ecb758d2 100644
--- a/sys/arch/amd64/amd64/hibernate_machdep.c
+++ b/sys/arch/amd64/amd64/hibernate_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hibernate_machdep.c,v 1.30 2014/11/08 08:18:37 mlarkin Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.31 2014/11/16 12:30:56 deraadt Exp $ */
/*
* Copyright (c) 2012 Mike Larkin <mlarkin@openbsd.org>
@@ -272,22 +272,22 @@ hibernate_populate_resume_pt(union hibernate_info *hib_info,
pt_entry_t *pde, npde;
/* Identity map MMU pages */
- pmap_kenter_pa(HIBERNATE_PML4T, HIBERNATE_PML4T, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PDPT_LOW, HIBERNATE_PDPT_LOW, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PDPT_HI, HIBERNATE_PDPT_HI, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PD_LOW, HIBERNATE_PD_LOW, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PD_LOW2, HIBERNATE_PD_LOW2, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PD_HI, HIBERNATE_PD_HI, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PT_LOW, HIBERNATE_PT_LOW, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PT_LOW2, HIBERNATE_PT_LOW2, VM_PROT_ALL);
- pmap_kenter_pa(HIBERNATE_PT_HI, HIBERNATE_PT_HI, VM_PROT_ALL);
+ pmap_kenter_pa(HIBERNATE_PML4T, HIBERNATE_PML4T, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PDPT_LOW, HIBERNATE_PDPT_LOW, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PDPT_HI, HIBERNATE_PDPT_HI, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PD_LOW, HIBERNATE_PD_LOW, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PD_LOW2, HIBERNATE_PD_LOW2, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PD_HI, HIBERNATE_PD_HI, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PT_LOW, HIBERNATE_PT_LOW, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PT_LOW2, HIBERNATE_PT_LOW2, PROT_MASK);
+ pmap_kenter_pa(HIBERNATE_PT_HI, HIBERNATE_PT_HI, PROT_MASK);
/* Identity map 3 pages for stack */
- pmap_kenter_pa(HIBERNATE_STACK_PAGE, HIBERNATE_STACK_PAGE, VM_PROT_ALL);
+ pmap_kenter_pa(HIBERNATE_STACK_PAGE, HIBERNATE_STACK_PAGE, PROT_MASK);
pmap_kenter_pa(HIBERNATE_STACK_PAGE - PAGE_SIZE,
- HIBERNATE_STACK_PAGE - PAGE_SIZE, VM_PROT_ALL);
+ HIBERNATE_STACK_PAGE - PAGE_SIZE, PROT_MASK);
pmap_kenter_pa(HIBERNATE_STACK_PAGE - 2*PAGE_SIZE,
- HIBERNATE_STACK_PAGE - 2*PAGE_SIZE, VM_PROT_ALL);
+ HIBERNATE_STACK_PAGE - 2*PAGE_SIZE, PROT_MASK);
pmap_activate(curproc);
bzero((caddr_t)HIBERNATE_PML4T, PAGE_SIZE);
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 5f5c32e02df..157587e4707 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.194 2014/11/08 03:31:58 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.195 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1179,7 +1179,7 @@ void
map_tramps(void) {
struct pmap *kmp = pmap_kernel();
- pmap_kenter_pa(lo32_vaddr, lo32_paddr, VM_PROT_ALL);
+ pmap_kenter_pa(lo32_vaddr, lo32_paddr, PROT_READ | PROT_WRITE | PROT_EXEC);
/*
* The initial PML4 pointer must be below 4G, so if the
@@ -1195,12 +1195,12 @@ map_tramps(void) {
#ifdef MULTIPROCESSOR
pmap_kenter_pa((vaddr_t)MP_TRAMPOLINE, /* virtual */
(paddr_t)MP_TRAMPOLINE, /* physical */
- VM_PROT_ALL); /* protection */
+ PROT_MASK); /* protection */
#endif /* MULTIPROCESSOR */
pmap_kenter_pa((vaddr_t)ACPI_TRAMPOLINE, /* virtual */
(paddr_t)ACPI_TRAMPOLINE, /* physical */
- VM_PROT_ALL); /* protection */
+ PROT_MASK); /* protection */
}
#endif
@@ -1507,9 +1507,9 @@ init_x86_64(paddr_t first_avail)
pmap_growkernel(VM_MIN_KERNEL_ADDRESS + 32 * 1024 * 1024);
- pmap_kenter_pa(idt_vaddr, idt_paddr, VM_PROT_READ|VM_PROT_WRITE);
+ pmap_kenter_pa(idt_vaddr, idt_paddr, PROT_READ | PROT_WRITE);
pmap_kenter_pa(idt_vaddr + PAGE_SIZE, idt_paddr + PAGE_SIZE,
- VM_PROT_READ|VM_PROT_WRITE);
+ PROT_READ | PROT_WRITE);
#if defined(MULTIPROCESSOR) || \
(NACPI > 0 && !defined(SMALL_KERNEL))
diff --git a/sys/arch/amd64/amd64/mpbios.c b/sys/arch/amd64/amd64/mpbios.c
index aef32f6ffa1..614dbbec79e 100644
--- a/sys/arch/amd64/amd64/mpbios.c
+++ b/sys/arch/amd64/amd64/mpbios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpbios.c,v 1.22 2014/05/26 19:03:28 kettenis Exp $ */
+/* $OpenBSD: mpbios.c,v 1.23 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: mpbios.c,v 1.7 2003/05/15 16:32:50 fvdl Exp $ */
/*-
@@ -259,7 +259,7 @@ mpbios_map(paddr_t pa, int len, struct mp_map *handle)
handle->vsize = endpa - pgpa;
do {
- pmap_kenter_pa(va, pgpa, VM_PROT_READ);
+ pmap_kenter_pa(va, pgpa, PROT_READ);
va += PAGE_SIZE;
pgpa += PAGE_SIZE;
} while (pgpa < endpa);
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index cc726f0fbd2..6ed7fefb44d 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.77 2014/11/07 03:20:02 mlarkin Exp $ */
+/* $OpenBSD: pmap.c,v 1.78 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -296,7 +296,7 @@ static const struct nx_range_description nx_ranges[] = {
/*
* List of ranges to map as NX (non-execute) if the processor supports
* NX. Each range consists of a start vaddr and size (in bytes), and a
- * protection value (eg, VM_PROT_READ or VM_PROT_READ | VM_PROT_WRITE).
+ * protection value (eg, PROT_READ or PROT_READ | PROT_WRITE).
*
* The list also includes an 'is_ptr' field in each element to denote
* if the 'start' value is a constant (is_ptr == 0) or should be
@@ -308,13 +308,13 @@ static const struct nx_range_description nx_ranges[] = {
{ /* .rodata range */
(vaddr_t)&__rodata_start,
(size_t)&__rodata_size,
- VM_PROT_READ,
+ PROT_READ,
0
},
{ /* ISA hole */
(vaddr_t)&atdevbase,
IOM_SIZE,
- VM_PROT_READ | VM_PROT_WRITE,
+ PROT_READ | PROT_WRITE,
1
}
};
@@ -493,7 +493,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot)
pte = kvtopte(va);
- npte = (pa & PMAP_PA_MASK) | ((prot & VM_PROT_WRITE) ? PG_RW : PG_RO) |
+ npte = (pa & PMAP_PA_MASK) | ((prot & PROT_WRITE) ? PG_RW : PG_RO) |
((pa & PMAP_NOCACHE) ? PG_N : 0) |
((pa & PMAP_WC) ? pmap_pg_wc : 0) | PG_V;
@@ -501,7 +501,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot)
if (va >= (vaddr_t)NBPD_L2)
npte |= PG_G;
- if ((cpu_feature & CPUID_NXE) && !(prot & VM_PROT_EXECUTE))
+ if ((cpu_feature & CPUID_NXE) && !(prot & PROT_EXEC))
npte |= PG_NX;
opte = pmap_pte_set(pte, npte);
#ifdef LARGEPAGES
@@ -593,15 +593,14 @@ pmap_bootstrap(paddr_t first_avail, paddr_t max_pa)
* we can jam into a i386 PTE.
*/
- protection_codes[VM_PROT_NONE] = pg_nx; /* --- */
- protection_codes[VM_PROT_EXECUTE] = PG_RO; /* --x */
- protection_codes[VM_PROT_READ] = PG_RO | pg_nx; /* -r- */
- protection_codes[VM_PROT_READ|VM_PROT_EXECUTE] = PG_RO; /* -rx */
- protection_codes[VM_PROT_WRITE] = PG_RW | pg_nx; /* w-- */
- protection_codes[VM_PROT_WRITE|VM_PROT_EXECUTE] = PG_RW;/* w-x */
- protection_codes[VM_PROT_WRITE|VM_PROT_READ] = PG_RW | pg_nx;
- /* wr- */
- protection_codes[VM_PROT_ALL] = PG_RW; /* wrx */
+ protection_codes[PROT_NONE] = pg_nx; /* --- */
+ protection_codes[PROT_EXEC] = PG_RO; /* --x */
+ protection_codes[PROT_READ] = PG_RO | pg_nx; /* -r- */
+ protection_codes[PROT_READ | PROT_EXEC] = PG_RO; /* -rx */
+ protection_codes[PROT_WRITE] = PG_RW | pg_nx; /* w-- */
+ protection_codes[PROT_WRITE | PROT_EXEC] = PG_RW; /* w-x */
+ protection_codes[PROT_WRITE | PROT_READ] = PG_RW | pg_nx; /* wr- */
+ protection_codes[PROT_READ | PROT_WRITE | PROT_EXEC] = PG_RW; /* wrx */
/*
* now we init the kernel's pmap
@@ -1850,7 +1849,7 @@ pmap_write_protect(struct pmap *pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot)
eva &= PG_FRAME;
nx = 0;
- if ((cpu_feature & CPUID_NXE) && !(prot & VM_PROT_EXECUTE))
+ if ((cpu_feature & CPUID_NXE) && !(prot & PROT_EXEC))
nx = PG_NX;
if ((eva - sva > 32 * PAGE_SIZE) && pmap != pmap_kernel())
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index 8ec6571fd0e..59775682c6a 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.42 2014/07/13 12:11:01 jasper Exp $ */
+/* $OpenBSD: trap.c,v 1.43 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -353,11 +353,11 @@ faultcommon:
else
map = &vm->vm_map;
if (frame->tf_err & PGEX_W)
- ftype = VM_PROT_WRITE;
+ ftype = PROT_WRITE;
else if (frame->tf_err & PGEX_I)
- ftype = VM_PROT_EXECUTE;
+ ftype = PROT_EXEC;
else
- ftype = VM_PROT_READ;
+ ftype = PROT_READ;
#ifdef DIAGNOSTIC
if (map == kernel_map && va == 0) {
diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c
index 6da163abcf2..f1c135e03cf 100644
--- a/sys/arch/amd64/amd64/vm_machdep.c
+++ b/sys/arch/amd64/amd64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.28 2013/06/02 16:38:05 guenther Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.29 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
@@ -249,7 +249,7 @@ vmapbuf(struct buf *bp, vsize_t len)
while (len) {
(void) pmap_extract(vm_map_pmap(&bp->b_proc->p_vmspace->vm_map),
faddr, &fpa);
- pmap_kenter_pa(taddr, fpa, VM_PROT_READ|VM_PROT_WRITE);
+ pmap_kenter_pa(taddr, fpa, PROT_READ | PROT_WRITE);
faddr += PAGE_SIZE;
taddr += PAGE_SIZE;
len -= PAGE_SIZE;
diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h
index 0aef748ad37..5c3a22b832a 100644
--- a/sys/arch/amd64/include/pmap.h
+++ b/sys/arch/amd64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.47 2014/10/06 20:34:58 sf Exp $ */
+/* $OpenBSD: pmap.h,v 1.48 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */
/*
@@ -70,6 +70,7 @@
#ifndef _LOCORE
#ifdef _KERNEL
+#include <sys/mman.h>
#include <machine/cpufunc.h>
#include <machine/segments.h>
#endif /* _KERNEL */
@@ -464,8 +465,8 @@ pmap_update_2pg(vaddr_t va, vaddr_t vb)
__inline static void
pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
{
- if ((prot & VM_PROT_WRITE) == 0) {
- if (prot & (VM_PROT_READ|VM_PROT_EXECUTE)) {
+ if ((prot & PROT_WRITE) == 0) {
+ if (prot & (PROT_READ | PROT_EXEC)) {
(void) pmap_clear_attrs(pg, PG_RW);
} else {
pmap_page_remove(pg);
@@ -484,8 +485,8 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
__inline static void
pmap_protect(struct pmap *pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot)
{
- if ((prot & VM_PROT_WRITE) == 0) {
- if (prot & (VM_PROT_READ|VM_PROT_EXECUTE)) {
+ if ((prot & PROT_WRITE) == 0) {
+ if (prot & (PROT_READ| PROT_EXEC)) {
pmap_write_protect(pmap, sva, eva, prot);
} else {
pmap_remove(pmap, sva, eva);
diff --git a/sys/arch/amd64/pci/vga_post.c b/sys/arch/amd64/pci/vga_post.c
index ccef775ea7d..cdb04147cc2 100644
--- a/sys/arch/amd64/pci/vga_post.c
+++ b/sys/arch/amd64/pci/vga_post.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga_post.c,v 1.7 2014/07/12 18:44:41 tedu Exp $ */
+/* $OpenBSD: vga_post.c,v 1.8 2014/11/16 12:30:56 deraadt Exp $ */
/* $NetBSD: vga_post.c,v 1.12 2009/03/15 21:32:36 cegger Exp $ */
/*-
@@ -149,7 +149,7 @@ vga_post_init(int bus, int device, int function)
sc->sys_image = sys_image;
sc->emu.sys_private = sc;
- pmap_kenter_pa(sys_bios_data, 0, VM_PROT_READ);
+ pmap_kenter_pa(sys_bios_data, 0, PROT_READ);
pmap_update(pmap_kernel());
memcpy((void *)sc->bios_data, (void *)sys_bios_data, PAGE_SIZE);
pmap_kremove(sys_bios_data, PAGE_SIZE);
@@ -158,14 +158,14 @@ vga_post_init(int bus, int device, int function)
iter = 0;
TAILQ_FOREACH(pg, &sc->ram_backing, pageq) {
pmap_kenter_pa(sc->sys_image + iter, VM_PAGE_TO_PHYS(pg),
- VM_PROT_READ | VM_PROT_WRITE);
+ PROT_READ | PROT_WRITE);
iter += PAGE_SIZE;
}
KASSERT(iter == BASE_MEMORY);
for (iter = 640 * 1024; iter < 1024 * 1024; iter += PAGE_SIZE)
pmap_kenter_pa(sc->sys_image + iter, iter,
- VM_PROT_READ | VM_PROT_WRITE);
+ PROT_READ | PROT_WRITE);
pmap_update(pmap_kernel());
memset(&sc->emu, 0, sizeof(sc->emu));