summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2020-10-08 19:41:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2020-10-08 19:41:06 +0000
commit2be3be2ddbafa45d11fc5c2bfd86d94328b5a99b (patch)
tree972a4ae380b7663a918480e7217306ebd1c447bb /sys
parent5b88d9a7ce49334eaf0f905b9db4cd275217edc2 (diff)
use access_type as the PROT_* variable for uvm_fault() consistantly
ok kettenis
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/alpha/trap.c16
-rw-r--r--sys/arch/amd64/amd64/trap.c15
-rw-r--r--sys/arch/arm64/arm64/trap.c9
-rw-r--r--sys/arch/hppa/hppa/trap.c32
-rw-r--r--sys/arch/i386/i386/trap.c14
-rw-r--r--sys/arch/m88k/m88k/trap.c36
-rw-r--r--sys/arch/mips64/mips64/trap.c26
-rw-r--r--sys/arch/powerpc64/powerpc64/trap.c20
-rw-r--r--sys/arch/sh/sh/trap.c14
9 files changed, 88 insertions, 94 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c
index adf5e9ff0f8..b990c69239f 100644
--- a/sys/arch/alpha/alpha/trap.c
+++ b/sys/arch/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.91 2020/09/24 20:33:10 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.92 2020/10/08 19:41:03 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
@@ -232,7 +232,7 @@ trap(a0, a1, a2, entry, framep)
caddr_t v;
int typ;
union sigval sv;
- vm_prot_t ftype;
+ vm_prot_t access_type;
unsigned long onfault;
atomic_add_int(&uvmexp.traps, 1);
@@ -378,7 +378,7 @@ trap(a0, a1, a2, entry, framep)
case ALPHA_MMCSR_FOW:
KERNEL_LOCK();
if (pmap_emulate_reference(p, a0, user, a1)) {
- ftype = PROT_EXEC;
+ access_type = PROT_EXEC;
goto do_fault;
}
KERNEL_UNLOCK();
@@ -395,13 +395,13 @@ trap(a0, a1, a2, entry, framep)
switch (a2) {
case -1: /* instruction fetch fault */
- ftype = PROT_EXEC;
+ access_type = PROT_EXEC;
break;
case 0: /* load instruction */
- ftype = PROT_READ;
+ access_type = PROT_READ;
break;
case 1: /* store instruction */
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
break;
}
@@ -427,7 +427,7 @@ do_fault:
va = trunc_page((vaddr_t)a0);
onfault = p->p_addr->u_pcb.pcb_onfault;
p->p_addr->u_pcb.pcb_onfault = 0;
- rv = uvm_fault(map, va, 0, ftype);
+ rv = uvm_fault(map, va, 0, access_type);
p->p_addr->u_pcb.pcb_onfault = onfault;
/*
@@ -461,7 +461,7 @@ do_fault:
goto dopanic;
}
KERNEL_UNLOCK();
- ucode = ftype;
+ ucode = access_type;
v = (caddr_t)a0;
typ = SEGV_MAPERR;
if (rv == ENOMEM) {
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index f18162c9084..83a30701505 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.82 2020/09/24 17:54:29 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.83 2020/10/08 19:41:04 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -164,7 +164,7 @@ pageflttrap(struct trapframe *frame, uint64_t cr2, int usermode)
int error;
vaddr_t va;
struct vm_map *map;
- vm_prot_t ftype;
+ vm_prot_t access_type;
if (p == NULL || p->p_addr == NULL || p->p_vmspace == NULL)
return 0;
@@ -205,19 +205,18 @@ pageflttrap(struct trapframe *frame, uint64_t cr2, int usermode)
}
if (frame->tf_err & PGEX_W)
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
else if (frame->tf_err & PGEX_I)
- ftype = PROT_EXEC;
+ access_type = PROT_EXEC;
else
- ftype = PROT_READ;
+ access_type = PROT_READ;
if (curcpu()->ci_inatomic == 0 || map == kernel_map) {
/* Fault the original page in. */
caddr_t onfault = pcb->pcb_onfault;
pcb->pcb_onfault = NULL;
- error = uvm_fault(map, va, frame->tf_err & PGEX_P ?
- VM_FAULT_PROTECT : VM_FAULT_INVALID, ftype);
+ error = uvm_fault(map, va, 0, access_type);
pcb->pcb_onfault = onfault;
} else
error = EFAULT;
@@ -233,7 +232,7 @@ pageflttrap(struct trapframe *frame, uint64_t cr2, int usermode)
} else {
/* bad memory access in the kernel */
fault("uvm_fault(%p, 0x%llx, 0, %d) -> %x",
- map, cr2, ftype, error);
+ map, cr2, access_type, error);
/* retain kernel lock */
return 0;
}
diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c
index 7604cca0845..093d4c30980 100644
--- a/sys/arch/arm64/arm64/trap.c
+++ b/sys/arch/arm64/arm64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.31 2020/09/25 07:52:25 kettenis Exp $ */
+/* $OpenBSD: trap.c,v 1.32 2020/10/08 19:41:04 deraadt Exp $ */
/*-
* Copyright (c) 2014 Andrew Turner
* All rights reserved.
@@ -80,7 +80,6 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far,
struct vm_map *map;
struct proc *p;
struct pcb *pcb;
- vm_fault_t ftype;
vm_prot_t access_type;
vaddr_t va;
union sigval sv;
@@ -137,13 +136,11 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far,
access_type = (!(esr & ISS_DATA_CM) && (esr & ISS_DATA_WnR)) ?
PROT_WRITE : PROT_READ;
- ftype = VM_FAULT_INVALID; // should check for failed permissions.
-
if (map != kernel_map) {
/* Fault in the user page: */
if (!pmap_fault_fixup(map->pmap, va, access_type, 1)) {
KERNEL_LOCK();
- error = uvm_fault(map, va, ftype, access_type);
+ error = uvm_fault(map, va, 0, access_type);
if (error == 0)
uvm_grow(p, va);
KERNEL_UNLOCK();
@@ -155,7 +152,7 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far,
*/
if (!pmap_fault_fixup(map->pmap, va, access_type, 0)) {
KERNEL_LOCK();
- error = uvm_fault(map, va, ftype, access_type);
+ error = uvm_fault(map, va, 0, access_type);
KERNEL_UNLOCK();
}
}
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index ddc148a75c1..64879d4ddb0 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.149 2020/09/24 17:54:29 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.150 2020/10/08 19:41:04 deraadt Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -152,13 +152,12 @@ trap(int type, struct trapframe *frame)
vaddr_t va;
struct vm_map *map;
struct vmspace *vm;
- register vm_prot_t vftype;
+ register vm_prot_t access_type;
register pa_space_t space;
union sigval sv;
u_int opcode;
int ret, trapnum;
const char *tts;
- vm_fault_t fault = VM_FAULT_INVALID;
#ifdef DIAGNOSTIC
int oldcpl = curcpu()->ci_cpl;
#endif
@@ -170,16 +169,16 @@ trap(int type, struct trapframe *frame)
trapnum == T_IDEBUG || trapnum == T_PERFMON) {
va = frame->tf_iioq_head;
space = frame->tf_iisq_head;
- vftype = PROT_EXEC;
+ access_type = PROT_EXEC;
} else {
va = frame->tf_ior;
space = frame->tf_isr;
if (va == frame->tf_iioq_head)
- vftype = PROT_EXEC;
+ access_type = PROT_EXEC;
else if (inst_store(opcode))
- vftype = PROT_WRITE;
+ access_type = PROT_WRITE;
else
- vftype = PROT_READ;
+ access_type = PROT_READ;
}
if (frame->tf_flags & TFF_LAST)
@@ -380,7 +379,7 @@ trap(int type, struct trapframe *frame)
case T_LOWERPL | T_USER:
case T_DATAPID | T_USER:
sv.sival_int = va;
- trapsignal(p, SIGSEGV, vftype, SEGV_ACCERR, sv);
+ trapsignal(p, SIGSEGV, access_type, SEGV_ACCERR, sv);
break;
/*
@@ -397,7 +396,7 @@ trap(int type, struct trapframe *frame)
}
sv.sival_int = va;
- trapsignal(p, SIGSEGV, vftype, SEGV_ACCERR, sv);
+ trapsignal(p, SIGSEGV, access_type, SEGV_ACCERR, sv);
break;
case T_ITLBMISSNA:
@@ -430,7 +429,7 @@ trap(int type, struct trapframe *frame)
if ((type & T_USER && space == HPPA_SID_KERNEL) ||
(frame->tf_iioq_head & 3) != pl ||
(type & T_USER && va >= VM_MAXUSER_ADDRESS) ||
- uvm_fault(map, trunc_page(va), fault,
+ uvm_fault(map, trunc_page(va), 0,
opcode & 0x40? PROT_WRITE : PROT_READ)) {
frame_regmap(frame, opcode & 0x1f) = 0;
frame->tf_ipsw |= PSL_N;
@@ -452,7 +451,6 @@ trap(int type, struct trapframe *frame)
case T_DATACC:
case T_DATACC | T_USER:
datacc:
- fault = VM_FAULT_PROTECT;
case T_ITLBMISS:
case T_ITLBMISS | T_USER:
case T_DTLBMISS:
@@ -485,13 +483,13 @@ datacc:
if ((type & T_USER && va >= VM_MAXUSER_ADDRESS) ||
(type & T_USER && map->pmap->pm_space != space)) {
sv.sival_int = va;
- trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv);
+ trapsignal(p, SIGSEGV, access_type, SEGV_MAPERR, sv);
break;
}
KERNEL_LOCK();
- ret = uvm_fault(map, trunc_page(va), fault, vftype);
+ ret = uvm_fault(map, trunc_page(va), 0, access_type);
/*
* If this was a stack access we keep track of the maximum
@@ -519,7 +517,7 @@ datacc:
sicode = BUS_OBJERR;
}
sv.sival_int = va;
- trapsignal(p, signal, vftype, sicode, sv);
+ trapsignal(p, signal, access_type, sicode, sv);
} else {
if (p && p->p_addr->u_pcb.pcb_onfault) {
frame->tf_iioq_tail = 4 +
@@ -530,8 +528,8 @@ datacc:
#endif
} else {
panic("trap: "
- "uvm_fault(%p, %lx, %d, %d): %d",
- map, va, fault, vftype, ret);
+ "uvm_fault(%p, %lx, 0, %d): %d",
+ map, va, access_type, ret);
}
}
}
@@ -553,7 +551,7 @@ datacc:
case T_DATALIGN | T_USER:
datalign_user:
sv.sival_int = va;
- trapsignal(p, SIGBUS, vftype, BUS_ADRALN, sv);
+ trapsignal(p, SIGBUS, access_type, BUS_ADRALN, sv);
break;
case T_INTERRUPT:
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index 74359a00f3d..82353fc5693 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.149 2020/09/24 20:21:50 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.150 2020/10/08 19:41:04 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
@@ -116,7 +116,7 @@ trap(struct trapframe *frame)
resume_pop_fs[], resume_pop_gs[];
struct trapframe *vframe;
int resume;
- vm_prot_t ftype;
+ vm_prot_t access_type;
union sigval sv;
caddr_t onfault;
vaddr_t gdt_cs = SEGDESC_LIMIT(curcpu()->ci_gdt[GUCODE_SEL].sd);
@@ -126,11 +126,11 @@ trap(struct trapframe *frame)
/* SIGSEGV and SIGBUS need this */
if (frame->tf_err & PGEX_W) {
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
} else if (frame->tf_err & PGEX_I) {
- ftype = PROT_EXEC;
+ access_type = PROT_EXEC;
} else
- ftype = PROT_READ;
+ access_type = PROT_READ;
#ifdef DEBUG
if (trapdebug) {
@@ -379,7 +379,7 @@ trap(struct trapframe *frame)
if (curcpu()->ci_inatomic == 0 || map == kernel_map) {
onfault = p->p_addr->u_pcb.pcb_onfault;
p->p_addr->u_pcb.pcb_onfault = NULL;
- error = uvm_fault(map, va, 0, ftype);
+ error = uvm_fault(map, va, 0, access_type);
p->p_addr->u_pcb.pcb_onfault = onfault;
} else
error = EFAULT;
@@ -401,7 +401,7 @@ trap(struct trapframe *frame)
goto copyfault;
}
printf("uvm_fault(%p, 0x%lx, 0, %d) -> %x\n",
- map, va, ftype, error);
+ map, va, access_type, error);
goto we_re_toast;
}
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c
index 7174a520c1c..3a43b18cedf 100644
--- a/sys/arch/m88k/m88k/trap.c
+++ b/sys/arch/m88k/m88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.116 2020/09/27 16:40:26 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.117 2020/10/08 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -218,7 +218,7 @@ m88100_trap(u_int type, struct trapframe *frame)
struct proc *p;
struct vm_map *map;
vaddr_t va, pcb_onfault;
- vm_prot_t ftype;
+ vm_prot_t access_type;
int fault_type, pbus_type;
u_long fault_code;
vaddr_t fault_addr;
@@ -292,10 +292,10 @@ lose:
fault_addr = frame->tf_dma0;
if (frame->tf_dmt0 & (DMT_WRITE|DMT_LOCKBAR)) {
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
fault_code = PROT_WRITE;
} else {
- ftype = PROT_READ;
+ access_type = PROT_READ;
fault_code = PROT_READ;
}
@@ -330,7 +330,7 @@ lose:
case CMMU_PFSR_SFAULT:
case CMMU_PFSR_PFAULT:
p->p_addr->u_pcb.pcb_onfault = 0;
- result = uvm_fault(map, va, VM_FAULT_INVALID, ftype);
+ result = uvm_fault(map, va, 0, access_type);
p->p_addr->u_pcb.pcb_onfault = pcb_onfault;
if (result == 0) {
/*
@@ -400,10 +400,10 @@ user_fault:
}
if (frame->tf_dmt0 & (DMT_WRITE | DMT_LOCKBAR)) {
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
fault_code = PROT_WRITE;
} else {
- ftype = PROT_READ;
+ access_type = PROT_READ;
fault_code = PROT_READ;
}
@@ -423,7 +423,7 @@ user_fault:
result = EACCES;
break;
default:
- result = uvm_fault(map, va, VM_FAULT_INVALID, ftype);
+ result = uvm_fault(map, va, 0, access_type);
if (result == EACCES)
result = EFAULT;
break;
@@ -606,7 +606,7 @@ m88110_trap(u_int type, struct trapframe *frame)
struct proc *p;
struct vm_map *map;
vaddr_t va, pcb_onfault;
- vm_prot_t ftype;
+ vm_prot_t access_type;
int fault_type;
u_long fault_code;
vaddr_t fault_addr;
@@ -810,10 +810,10 @@ lose:
fault_addr = frame->tf_dlar;
if (frame->tf_dsr & CMMU_DSR_RW) {
- ftype = PROT_READ;
+ access_type = PROT_READ;
fault_code = PROT_READ;
} else {
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
fault_code = PROT_WRITE;
}
@@ -830,7 +830,7 @@ lose:
*/
if ((pcb_onfault = p->p_addr->u_pcb.pcb_onfault) != 0)
p->p_addr->u_pcb.pcb_onfault = 0;
- result = uvm_fault(map, va, VM_FAULT_INVALID, ftype);
+ result = uvm_fault(map, va, 0, access_type);
p->p_addr->u_pcb.pcb_onfault = pcb_onfault;
/*
* This could be a fault caused in copyout*()
@@ -861,7 +861,7 @@ lose:
m88110_user_fault:
KERNEL_LOCK();
if (type == T_INSTFLT+T_USER) {
- ftype = PROT_READ;
+ access_type = PROT_READ;
fault_code = PROT_READ;
#ifdef TRAPDEBUG
printf("User Instruction fault exip %x isr %x ilar %x\n",
@@ -870,10 +870,10 @@ m88110_user_fault:
} else {
fault_addr = frame->tf_dlar;
if (frame->tf_dsr & CMMU_DSR_RW) {
- ftype = PROT_READ;
+ access_type = PROT_READ;
fault_code = PROT_READ;
} else {
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
fault_code = PROT_WRITE;
}
#ifdef TRAPDEBUG
@@ -902,7 +902,7 @@ m88110_user_fault:
} else
if (frame->tf_isr & (CMMU_ISR_SI | CMMU_ISR_PI)) {
/* segment or page fault */
- result = uvm_fault(map, va, VM_FAULT_INVALID, ftype);
+ result = uvm_fault(map, va, 0, access_type);
if (result == EACCES)
result = EFAULT;
} else {
@@ -921,7 +921,7 @@ m88110_user_fault:
} else
if (frame->tf_dsr & (CMMU_DSR_SI | CMMU_DSR_PI)) {
/* segment or page fault */
- result = uvm_fault(map, va, VM_FAULT_INVALID, ftype);
+ result = uvm_fault(map, va, 0, access_type);
if (result == EACCES)
result = EFAULT;
} else
@@ -953,7 +953,7 @@ m88110_user_fault:
printf("Uncorrected userland write fault, pmap %p va %p\n",
map->pmap, va);
#endif
- result = uvm_fault(map, va, VM_FAULT_INVALID, ftype);
+ result = uvm_fault(map, va, 0, access_type);
if (result == EACCES)
result = EFAULT;
}
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index 09e18c44e44..4dad42894b9 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.148 2020/09/24 17:57:57 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.149 2020/10/08 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -277,7 +277,7 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci, struct proc *p,
int type)
{
unsigned ucode = 0;
- vm_prot_t ftype;
+ vm_prot_t access_type;
extern vaddr_t onfault_table[];
int onfault;
int signal, sicode;
@@ -291,7 +291,7 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci, struct proc *p,
if (pmap_emulate_modify(pmap_kernel(),
trapframe->badvaddr)) {
/* write to read only page in the kernel */
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
pcb = &p->p_addr->u_pcb;
goto kernel_fault;
}
@@ -303,7 +303,7 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci, struct proc *p,
if (pmap_emulate_modify(p->p_vmspace->vm_map.pmap,
trapframe->badvaddr)) {
/* write to read only page */
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
pcb = &p->p_addr->u_pcb;
goto fault_common_no_miss;
}
@@ -323,12 +323,12 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci, struct proc *p,
if (trapframe->cause & CR_BR_DELAY)
pc += 4;
if (pc == trapframe->badvaddr)
- ftype = PROT_EXEC;
+ access_type = PROT_EXEC;
else
#endif
- ftype = PROT_READ;
+ access_type = PROT_READ;
} else
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
pcb = &p->p_addr->u_pcb;
/* check for kernel address */
@@ -341,7 +341,7 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci, struct proc *p,
onfault = pcb->pcb_onfault;
pcb->pcb_onfault = 0;
KERNEL_LOCK();
- rv = uvm_fault(kernel_map, va, 0, ftype);
+ rv = uvm_fault(kernel_map, va, 0, access_type);
KERNEL_UNLOCK();
pcb->pcb_onfault = onfault;
if (rv == 0)
@@ -376,16 +376,16 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci, struct proc *p,
if (trapframe->cause & CR_BR_DELAY)
pc += 4;
if (pc == trapframe->badvaddr)
- ftype = PROT_EXEC;
+ access_type = PROT_EXEC;
else
#endif
- ftype = PROT_READ;
+ access_type = PROT_READ;
pcb = &p->p_addr->u_pcb;
goto fault_common;
}
case T_TLB_ST_MISS+T_USER:
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
pcb = &p->p_addr->u_pcb;
fault_common:
if ((type & T_USER) &&
@@ -423,7 +423,7 @@ fault_common_no_miss:
pcb->pcb_onfault = 0;
KERNEL_LOCK();
- rv = uvm_fault(map, va, 0, ftype);
+ rv = uvm_fault(map, va, 0, access_type);
pcb->pcb_onfault = onfault;
/*
@@ -448,7 +448,7 @@ fault_common_no_miss:
goto err;
}
- ucode = ftype;
+ ucode = access_type;
signal = SIGSEGV;
sicode = SEGV_MAPERR;
if (rv == EACCES)
diff --git a/sys/arch/powerpc64/powerpc64/trap.c b/sys/arch/powerpc64/powerpc64/trap.c
index ad9c78583c9..d46fbf3ddb4 100644
--- a/sys/arch/powerpc64/powerpc64/trap.c
+++ b/sys/arch/powerpc64/powerpc64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.40 2020/09/25 07:50:26 kettenis Exp $ */
+/* $OpenBSD: trap.c,v 1.41 2020/10/08 19:41:05 deraadt Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -52,7 +52,7 @@ trap(struct trapframe *frame)
struct vm_map *map;
pmap_t pm;
vaddr_t va;
- int ftype;
+ int access_type;
int error, sig, code;
/* Disable access to floating-point and vector registers. */
@@ -120,11 +120,11 @@ trap(struct trapframe *frame)
va = curpcb->pcb_userva | (va & SEGMENT_MASK);
}
if (frame->dsisr & DSISR_STORE)
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
else
- ftype = PROT_READ;
+ access_type = PROT_READ;
KERNEL_LOCK();
- error = uvm_fault(map, trunc_page(va), 0, ftype);
+ error = uvm_fault(map, trunc_page(va), 0, access_type);
KERNEL_UNLOCK();
if (error == 0)
return;
@@ -176,11 +176,11 @@ trap(struct trapframe *frame)
map = &p->p_vmspace->vm_map;
va = frame->dar;
if (frame->dsisr & DSISR_STORE)
- ftype = PROT_READ | PROT_WRITE;
+ access_type = PROT_READ | PROT_WRITE;
else
- ftype = PROT_READ;
+ access_type = PROT_READ;
KERNEL_LOCK();
- error = uvm_fault(map, trunc_page(va), 0, ftype);
+ error = uvm_fault(map, trunc_page(va), 0, access_type);
if (error == 0)
uvm_grow(p, trunc_page(va));
KERNEL_UNLOCK();
@@ -224,9 +224,9 @@ trap(struct trapframe *frame)
map = &p->p_vmspace->vm_map;
va = frame->srr0;
- ftype = PROT_READ | PROT_EXEC;
+ access_type = PROT_READ | PROT_EXEC;
KERNEL_LOCK();
- error = uvm_fault(map, trunc_page(va), 0, ftype);
+ error = uvm_fault(map, trunc_page(va), 0, access_type);
if (error == 0)
uvm_grow(p, trunc_page(va));
KERNEL_UNLOCK();
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index be252802363..b17b3effa85 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.44 2020/09/25 14:42:25 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.45 2020/10/08 19:41:05 deraadt Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
@@ -318,7 +318,7 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va)
pmap_t pmap;
union sigval sv;
int usermode;
- int err, track, ftype;
+ int err, track, access_type;
const char *panic_msg;
#define TLB_ASSERT(assert, msg) \
@@ -348,15 +348,15 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va)
switch (tf->tf_expevt) {
case EXPEVT_TLB_MISS_LD:
track = PVH_REFERENCED;
- ftype = PROT_READ;
+ access_type = PROT_READ;
break;
case EXPEVT_TLB_MISS_ST:
track = PVH_REFERENCED;
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
break;
case EXPEVT_TLB_MOD:
track = PVH_REFERENCED | PVH_MODIFIED;
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
break;
case EXPEVT_TLB_PROT_LD:
TLB_ASSERT((int)va > 0,
@@ -374,7 +374,7 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va)
case EXPEVT_TLB_PROT_ST:
track = 0; /* call uvm_fault first. (COW) */
- ftype = PROT_WRITE;
+ access_type = PROT_WRITE;
break;
default:
@@ -415,7 +415,7 @@ tlb_exception(struct proc *p, struct trapframe *tf, uint32_t va)
return;
}
- err = uvm_fault(map, va, 0, ftype);
+ err = uvm_fault(map, va, 0, access_type);
/* User stack extension */
if (map != kernel_map &&